You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rya.apache.org by pu...@apache.org on 2018/04/23 13:21:06 UTC
[01/48] incubator-rya git commit: RYA-405 PR Updates
Repository: incubator-rya
Updated Branches:
refs/heads/master ca055ae21 -> 9c2bad66b
RYA-405 PR Updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/b35a2f3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/b35a2f3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/b35a2f3d
Branch: refs/heads/master
Commit: b35a2f3df6897cb564686de3921c3592d240ea23
Parents: 81b9932
Author: eric.white <Er...@parsons.com>
Authored: Thu Apr 19 14:28:51 2018 -0400
Committer: Valiyil <Pu...@parsons.com>
Committed: Mon Apr 23 09:19:10 2018 -0400
----------------------------------------------------------------------
README.md | 2 +-
common/rya.api/pom.xml | 1 -
.../rya/api/RdfCloudTripleStoreUtils.java | 26 +++++-----
.../java/org/apache/rya/api/domain/Node.java | 8 ++--
.../api/persist/index/RyaSecondaryIndexer.java | 9 ++--
.../org/apache/rya/api/utils/RdfIOTest.java | 4 +-
dao/accumulo.rya/pom.xml | 1 -
.../accumulo/DefineTripleQueryRangeFactory.java | 4 +-
.../DefineTripleQueryRangeFactoryTest.java | 48 +++++++++----------
extras/indexingExample/pom.xml | 1 -
.../geotemporal/GeoTemporalIndexer.java | 1 -
.../accumulo/VisibilityBindingSetSerDe.java | 2 -
.../pcj/storage/accumulo/PcjTablesIT.java | 2 +-
.../rya.manual/src/site/markdown/querydata.md | 2 +-
.../rya.manual/src/site/markdown/sm-addauth.md | 6 +--
extras/rya.manual/src/site/markdown/sm-infer.md | 50 ++++++++++----------
.../src/site/markdown/sm-simpleaqr.md | 6 +--
.../src/site/markdown/sm-sparqlquery.md | 10 ++--
extras/rya.pcj.fluo/pcj.fluo.client/pom.xml | 1 -
extras/rya.reasoning/pom.xml | 1 -
.../vagrantExample/src/main/vagrant/Vagrantfile | 28 ++++++-----
.../mr/tools/AccumuloRdfCountToolTest.java | 24 +++++-----
pom.xml | 10 ++++
sail/pom.xml | 1 -
.../rya/RdfCloudTripleStoreUtilsTest.java | 12 ++---
.../web/cloudbase/sail/QueryDataServlet.java | 2 +-
26 files changed, 132 insertions(+), 130 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index fa79ef9..3daa347 100644
--- a/README.md
+++ b/README.md
@@ -157,7 +157,7 @@ RepositoryConnection conn = myRepository.getConnection();
System.out.println(query);
TupleQuery tupleQuery = conn.prepareTupleQuery(
QueryLanguage.SPARQL, query);
-ValueFactory vf = ValueFactoryImpl.getInstance();
+ValueFactory vf = SimpleValueFactory.getInstance();
TupleQueryResultHandler writer = new SPARQLResultsXMLWriter(System.out);
tupleQuery.evaluate(writer);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/common/rya.api/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.api/pom.xml b/common/rya.api/pom.xml
index 70bc691..13cd4cf 100644
--- a/common/rya.api/pom.xml
+++ b/common/rya.api/pom.xml
@@ -111,7 +111,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-sail-base</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
index acb0b91..91cb74e 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
@@ -42,9 +42,9 @@ public class RdfCloudTripleStoreUtils {
//// if (value == null)
//// return new byte[]{};
//// ByteArrayDataOutput dataOut = ByteStreams.newDataOutput();
-//// if (value instanceof URI) {
+//// if (value instanceof IRI) {
//// dataOut.writeByte(RdfCloudTripleStoreConstants.URI_MARKER);
-//// writeString(((URI) value).toString(), dataOut);
+//// writeString(((IRI) value).toString(), dataOut);
//// } else if (value instanceof BNode) {
//// dataOut.writeByte(RdfCloudTripleStoreConstants.BNODE_MARKER);
//// writeString(((BNode) value).getID(), dataOut);
@@ -53,7 +53,7 @@ public class RdfCloudTripleStoreUtils {
////
//// String label = lit.getLabel();
//// String language = lit.getLanguage();
-//// URI datatype = lit.getDatatype();
+//// IRI datatype = lit.getDatatype();
////
//// if (datatype != null) {
//// dataOut.writeByte(RdfCloudTripleStoreConstants.DATATYPE_LITERAL_MARKER);
@@ -100,7 +100,7 @@ public class RdfCloudTripleStoreUtils {
//// ret = vf.createLiteral(label, language);
//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.DATATYPE_LITERAL_MARKER) {
//// String label = readString(dataIn);
-//// URI datatype = (URI) readValue(dataIn, vf);
+//// IRI datatype = (IRI) readValue(dataIn, vf);
//// ret = vf.createLiteral(label, datatype);
//// } else {
//// throw new InvalidValueTypeMarkerRuntimeException(valueTypeMarker, "Invalid value type marker: "
@@ -148,27 +148,27 @@ public class RdfCloudTripleStoreUtils {
// public static Statement translateStatementFromRow(ByteArrayDataInput input, Text context, TABLE_LAYOUT tble, ValueFactory vf) throws IOException {
// Resource subject;
-// URI predicate;
+// IRI predicate;
// Value object;
// if (TABLE_LAYOUT.SPO.equals(tble)) {
// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf);
-// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf);
+// predicate = (IRI) RdfCloudTripleStoreUtils.readValue(input, vf);
// object = RdfCloudTripleStoreUtils.readValue(input, vf);
// } else if (TABLE_LAYOUT.OSP.equals(tble)) {
// object = RdfCloudTripleStoreUtils.readValue(input, vf);
// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf);
-// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf);
+// predicate = (IRI) RdfCloudTripleStoreUtils.readValue(input, vf);
// } else if (TABLE_LAYOUT.PO.equals(tble)) {
-// predicate = (URI) RdfCloudTripleStoreUtils.readValue(input, vf);
+// predicate = (IRI) RdfCloudTripleStoreUtils.readValue(input, vf);
// object = RdfCloudTripleStoreUtils.readValue(input, vf);
// subject = (Resource) RdfCloudTripleStoreUtils.readValue(input, vf);
// } else {
// throw new IllegalArgumentException("Table[" + tble + "] is not valid");
// }
// if (context == null || INFO_TXT.equals(context))
-// return new StatementImpl(subject, predicate, object); //default graph
+// return vf.createStatement(subject, predicate, object); //default graph
// else
-// return new ContextStatementImpl(subject, predicate, object, (Resource) readValue(ByteStreams.newDataInput(context.getBytes()), vf)); //TODO: Seems like a perf hog
+// return vf.createStatement(subject, predicate, object, (Resource) readValue(ByteStreams.newDataInput(context.getBytes()), vf)); //TODO: Seems like a perf hog
// }
// public static byte[] buildRowWith(byte[] bytes_one, byte[] bytes_two, byte[] bytes_three) throws IOException {
@@ -252,7 +252,7 @@ public class RdfCloudTripleStoreUtils {
}
/**
- * If value is a URI, then return as URI, otherwise return namespace/value as the URI
+ * If value is a IRI, then return as IRI, otherwise return namespace/value as the IRI
*
* @param namespace
* @param value
@@ -315,7 +315,7 @@ public class RdfCloudTripleStoreUtils {
// }
-// public static void addTimeIndexUri(Configuration conf, URI timeUri, Class<? extends TtlValueConverter> ttlValueConvClass) {
+// public static void addTimeIndexUri(Configuration conf, IRI timeUri, Class<? extends TtlValueConverter> ttlValueConvClass) {
// String[] timeIndexUris = conf.getStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS);
// if (timeIndexUris == null)
// timeIndexUris = new String[0];
@@ -327,7 +327,7 @@ public class RdfCloudTripleStoreUtils {
// conf.set(timeUri_s, ttlValueConvClass.getName());
// }
-// public static Class<? extends TtlValueConverter> getTtlValueConverter(Configuration conf, URI predicate) throws ClassNotFoundException {
+// public static Class<? extends TtlValueConverter> getTtlValueConverter(Configuration conf, IRI predicate) throws ClassNotFoundException {
// if (predicate == null)
// return null;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
index a1e1468..7ecac9d 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
@@ -24,15 +24,15 @@ package org.apache.rya.api.domain;
import org.eclipse.rdf4j.model.impl.SimpleIRI;
/**
- * A Node is an expected node in the global graph. This typing of the URI allows us to dictate the difference between a
- * URI that is just an Attribute on the subject vs. a URI that is another subject Node in the global graph. It does not
+ * A Node is an expected node in the global graph. This typing of the IRI allows us to dictate the difference between an
+ * IRI that is just an Attribute on the subject vs. an IRI that is another subject Node in the global graph. It does not
* guarantee that the subject exists, just that there is an Edge to it.
*/
public class Node extends SimpleIRI {
public Node() {
}
- public Node(String uriString) {
- super(uriString);
+ public Node(String iriString) {
+ super(iriString);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
index 1bdc95b..2696e5b 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
@@ -31,10 +31,11 @@ import org.apache.rya.api.domain.RyaURI;
import org.eclipse.rdf4j.model.IRI;
public interface RyaSecondaryIndexer extends Closeable, Flushable, Configurable {
- /**
- * initialize after setting configuration.
- */
- public void init();
+ /**
+ * initialize after setting configuration.
+ */
+ public void init();
+
/**
* Returns the table name if the implementation supports it.
* Note that some indexers use multiple tables, this only returns one.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java b/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
index 1a07184..83c1fd8 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
@@ -23,7 +23,7 @@
//import junit.framework.TestCase;
//import org.apache.rya.api.RdfCloudTripleStoreUtils;
//import org.eclipse.rdf4j.model.Statement;
-//import org.eclipse.rdf4j.model.impl.StatementImpl;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//
//import static org.apache.rya.api.RdfCloudTripleStoreConstants.*;
//
@@ -34,7 +34,7 @@
// */
//public class RdfIOTest extends TestCase {
//
-// Statement st = new StatementImpl(RTS_SUBJECT, RTS_VERSION_PREDICATE, VERSION);
+// Statement st = SimpleValueFactory.getInstance().createStatement(RTS_SUBJECT, RTS_VERSION_PREDICATE, VERSION);
// int num = 100000;
//
// public void testPerf() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/dao/accumulo.rya/pom.xml
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/pom.xml b/dao/accumulo.rya/pom.xml
index a90c30a..03f4dc7 100644
--- a/dao/accumulo.rya/pom.xml
+++ b/dao/accumulo.rya/pom.xml
@@ -57,7 +57,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-sail-api</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
index 1609f2f..cc3ef43 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
@@ -28,7 +28,7 @@
//import org.apache.hadoop.io.Text;
//import org.eclipse.rdf4j.model.Value;
//import org.eclipse.rdf4j.model.ValueFactory;
-//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//
//import java.io.IOException;
//import java.util.Map;
@@ -43,7 +43,7 @@
// */
//public class DefineTripleQueryRangeFactory {
//
-// ValueFactory vf = ValueFactoryImpl.getInstance();
+// ValueFactory vf = SimpleValueFactory.getInstance();
//
// protected void fillRange(ByteArrayDataOutput startRowOut, ByteArrayDataOutput endRowOut, Value val, boolean empty)
// throws IOException {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
index cf2ae4f..6119ce7 100644
--- a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
+++ b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
@@ -23,14 +23,12 @@
//import junit.framework.TestCase;
//import org.apache.rya.accumulo.AccumuloRdfConfiguration;
//import org.apache.rya.accumulo.DefineTripleQueryRangeFactory;
-//import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-//import org.apache.rya.accumulo.DefineTripleQueryRangeFactory;
//import org.apache.rya.api.domain.RangeValue;
//import org.apache.accumulo.core.data.Range;
//import org.eclipse.rdf4j.model.IRI;
//import org.eclipse.rdf4j.model.Value;
//import org.eclipse.rdf4j.model.ValueFactory;
-//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//
//import java.util.Map;
//
@@ -44,15 +42,15 @@
// public static final String URI_MARKER_STR = "\u0007";
// public static final String RANGE_ENDKEY_SUFFIX = "\u0000";
// DefineTripleQueryRangeFactory factory = new DefineTripleQueryRangeFactory();
-// ValueFactory vf = ValueFactoryImpl.getInstance();
+// ValueFactory vf = SimpleValueFactory.getInstance();
// static String litdupsNS = "urn:test:litdups#";
//
// private AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
//
// public void testSPOCases() throws Exception {
-// URI cpu = vf.createIRI(litdupsNS, "cpu");
-// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-// URI obj = vf.createIRI(litdupsNS, "uri1");
+// IRI cpu = vf.createIRI(litdupsNS, "cpu");
+// IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// IRI obj = vf.createIRI(litdupsNS, "uri1");
//
// //spo
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -96,12 +94,12 @@
// }
//
// public void testSPOCasesWithRanges() throws Exception {
-// URI subj_start = vf.createIRI(litdupsNS, "subj_start");
-// URI subj_end = vf.createIRI(litdupsNS, "subj_stop");
-// URI pred_start = vf.createIRI(litdupsNS, "pred_start");
-// URI pred_end = vf.createIRI(litdupsNS, "pred_stop");
-// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
-// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
+// IRI subj_start = vf.createIRI(litdupsNS, "subj_start");
+// IRI subj_end = vf.createIRI(litdupsNS, "subj_stop");
+// IRI pred_start = vf.createIRI(litdupsNS, "pred_start");
+// IRI pred_end = vf.createIRI(litdupsNS, "pred_stop");
+// IRI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// IRI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value subj = new RangeValue(subj_start, subj_end);
// Value pred = new RangeValue(pred_start, pred_end);
@@ -146,8 +144,8 @@
// }
//
// public void testPOCases() throws Exception {
-// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-// URI obj = vf.createIRI(litdupsNS, "uri1");
+// IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// IRI obj = vf.createIRI(litdupsNS, "uri1");
//
// //po
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -171,10 +169,10 @@
// }
//
// public void testPOCasesWithRanges() throws Exception {
-// URI pred_start = vf.createIRI(litdupsNS, "pred_start");
-// URI pred_end = vf.createIRI(litdupsNS, "pred_stop");
-// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
-// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
+// IRI pred_start = vf.createIRI(litdupsNS, "pred_start");
+// IRI pred_end = vf.createIRI(litdupsNS, "pred_stop");
+// IRI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// IRI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value pred = new RangeValue(pred_start, pred_end);
// Value obj = new RangeValue(obj_start, obj_end);
@@ -204,8 +202,8 @@
// }
//
// public void testOSPCases() throws Exception {
-// URI cpu = vf.createIRI(litdupsNS, "cpu");
-// URI obj = vf.createIRI(litdupsNS, "uri1");
+// IRI cpu = vf.createIRI(litdupsNS, "cpu");
+// IRI obj = vf.createIRI(litdupsNS, "uri1");
//
// //so
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -230,10 +228,10 @@
//
//
// public void testOSPCasesWithRanges() throws Exception {
-// URI subj_start = vf.createIRI(litdupsNS, "subj_start");
-// URI subj_end = vf.createIRI(litdupsNS, "subj_stop");
-// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
-// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
+// IRI subj_start = vf.createIRI(litdupsNS, "subj_start");
+// IRI subj_end = vf.createIRI(litdupsNS, "subj_stop");
+// IRI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// IRI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value subj = new RangeValue(subj_start, subj_end);
// Value obj = new RangeValue(obj_start, obj_end);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/indexingExample/pom.xml
----------------------------------------------------------------------
diff --git a/extras/indexingExample/pom.xml b/extras/indexingExample/pom.xml
index 5740f08..abb03c3 100644
--- a/extras/indexingExample/pom.xml
+++ b/extras/indexingExample/pom.xml
@@ -76,7 +76,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-queryrender</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
index 9db4bd7..37cb99d 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
@@ -23,7 +23,6 @@ import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Statement;
-import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
index 3ba5e06..0dbc880 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
@@ -26,9 +26,7 @@ import java.io.ObjectOutputStream;
import org.apache.commons.io.serialization.ValidatingObjectInputStream;
import org.apache.fluo.api.data.Bytes;
-import org.apache.rya.api.model.BindingSetDecorator;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.eclipse.rdf4j.query.AbstractBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
index f142b77..be1a64d 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
@@ -82,7 +82,7 @@ public class PcjTablesIT {
private static final String CLOUDBASE_INSTANCE = "sc.cloudbase.instancename";
private static final String CLOUDBASE_USER = "sc.cloudbase.username";
private static final String CLOUDBASE_PASSWORD = "sc.cloudbase.password";
- private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final AccumuloPcjSerializer converter = new AccumuloPcjSerializer();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.manual/src/site/markdown/querydata.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/querydata.md b/extras/rya.manual/src/site/markdown/querydata.md
index adc5d12..b18728d 100644
--- a/extras/rya.manual/src/site/markdown/querydata.md
+++ b/extras/rya.manual/src/site/markdown/querydata.md
@@ -110,7 +110,7 @@ RepositoryConnection conn = myRepository.getConnection();
System.out.println(query);
TupleQuery tupleQuery = conn.prepareTupleQuery(
QueryLanguage.SPARQL, query);
-ValueFactory vf = ValueFactoryImpl.getInstance();
+ValueFactory vf = SimpleValueFactory.getInstance();
TupleQueryResultHandler writer = new SPARQLResultsXMLWriter(System.out);
tupleQuery.evaluate(new TupleQueryResultHandler() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.manual/src/site/markdown/sm-addauth.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-addauth.md b/extras/rya.manual/src/site/markdown/sm-addauth.md
index eec0949..077fe45 100644
--- a/extras/rya.manual/src/site/markdown/sm-addauth.md
+++ b/extras/rya.manual/src/site/markdown/sm-addauth.md
@@ -89,9 +89,9 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statement
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createIRI(litdupsNS, "cpu");
-URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-URI uri1 = vf.createIRI(litdupsNS, "uri1");
+IRI cpu = vf.createIRI(litdupsNS, "cpu");
+IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+IRI uri1 = vf.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.manual/src/site/markdown/sm-infer.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-infer.md b/extras/rya.manual/src/site/markdown/sm-infer.md
index 8021297..206f4fc 100644
--- a/extras/rya.manual/src/site/markdown/sm-infer.md
+++ b/extras/rya.manual/src/site/markdown/sm-infer.md
@@ -81,11 +81,11 @@ We will go through some quick samples on loading inferred relationships, seeing
First the code, which will load the following subclassof relationship: `UndergraduateStudent subclassof Student subclassof Person`. Then we will load into the tables three triples defining `UgradA rdf:type UndergraduateStudent, StudentB rdf:type Student, PersonC rdf:type Person`
``` JAVA
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Student")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Student"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Person")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), RDF.TYPE, vf.createIRI(litdupsNS, "UndergraduateStudent")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "StudentB"), RDF.TYPE, vf.createIRI(litdupsNS, "Student")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "PersonC"), RDF.TYPE, vf.createIRI(litdupsNS, "Person")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Student")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "Student"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Person")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "UgradA"), RDF.TYPE, vf.createIRI(litdupsNS, "UndergraduateStudent")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "StudentB"), RDF.TYPE, vf.createIRI(litdupsNS, "Student")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "PersonC"), RDF.TYPE, vf.createIRI(litdupsNS, "Person")));
conn.commit();
```
@@ -140,13 +140,13 @@ Also, EquivalentProperty can be thought of as specialized SubPropertyOf relation
Sample Code:
``` JAVA
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "memberOf")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "associatedWith")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "undergradDegreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "gradDegreeFrom"), vf.createIRI(litdupsNS, "Yale")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "ProfessorC"), vf.createIRI(litdupsNS, "memberOf"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "memberOf")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "associatedWith")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "undergradDegreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "gradDegreeFrom"), vf.createIRI(litdupsNS, "Yale")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "ProfessorC"), vf.createIRI(litdupsNS, "memberOf"), vf.createIRI(litdupsNS, "Harvard")));
conn.commit();
```
@@ -197,10 +197,10 @@ InverseOf defines a property that is an inverse relation of another property. Fo
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, vf.createIRI(litdupsNS, "hasAlumnus")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Harvard"), vf.createIRI(litdupsNS, "hasAlumnus"), vf.createIRI(litdupsNS, "AlumC")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, vf.createIRI(litdupsNS, "hasAlumnus")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "Harvard"), vf.createIRI(litdupsNS, "hasAlumnus"), vf.createIRI(litdupsNS, "AlumC")));
conn.commit();
```
@@ -252,9 +252,9 @@ SymmetricProperty defines a relationship where, for example, if Bob is a friendO
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Bob"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "James"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "Bob"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "James"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
conn.commit();
```
@@ -302,12 +302,12 @@ TransitiveProperty provides a transitive relationship between resources. For exa
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Queens"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NYC")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NYC"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NY")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NY"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "US")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "US"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NorthAmerica")));
-conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NorthAmerica"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "World")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "Queens"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NYC")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "NYC"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NY")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "NY"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "US")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "US"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NorthAmerica")));
+conn.add(vf.createStatement(vf.createIRI(litdupsNS, "NorthAmerica"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "World")));
conn.commit();
```
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-simpleaqr.md b/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
index e6d03d4..6d0062e 100644
--- a/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
+++ b/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
@@ -53,9 +53,9 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statement
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createIRI(litdupsNS, "cpu");
-URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-URI uri1 = vf.createIRI(litdupsNS, "uri1");
+IRI cpu = vf.createIRI(litdupsNS, "cpu");
+IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+IRI uri1 = vf.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-sparqlquery.md b/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
index ffa537a..5afbfdf 100644
--- a/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
+++ b/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
@@ -53,11 +53,11 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statements
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createIRI(litdupsNS, "cpu");
-URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-URI uri1 = vf.createIRI(litdupsNS, "uri1");
-URI pred2 = vf.createIRI(litdupsNS, "pred2");
-URI uri2 = vf.createIRI(litdupsNS, "uri2");
+IRI cpu = vf.createIRI(litdupsNS, "cpu");
+IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+IRI uri1 = vf.createIRI(litdupsNS, "uri1");
+IRI pred2 = vf.createIRI(litdupsNS, "pred2");
+IRI uri2 = vf.createIRI(litdupsNS, "uri2");
conn.add(cpu, loadPerc, uri1);
conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml b/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
index 403b4eb..799a839 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
@@ -74,7 +74,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-turtle</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<!-- Log4j 2 bridge, api, and core. -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/rya.reasoning/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/pom.xml b/extras/rya.reasoning/pom.xml
index 44042bc..ec604b8 100644
--- a/extras/rya.reasoning/pom.xml
+++ b/extras/rya.reasoning/pom.xml
@@ -72,7 +72,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-turtle</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/extras/vagrantExample/src/main/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/extras/vagrantExample/src/main/vagrant/Vagrantfile b/extras/vagrantExample/src/main/vagrant/Vagrantfile
index 6b81abe..2330bd9 100644
--- a/extras/vagrantExample/src/main/vagrant/Vagrantfile
+++ b/extras/vagrantExample/src/main/vagrant/Vagrantfile
@@ -52,10 +52,12 @@ Vagrant.configure(2) do |config|
export ACCUMULO_VERSION=1.6.5
###export ACCUMULO_VERSION=1.7.1
export HADOOP_VERSION=2.7.2
- export RYA_EXAMPLE_VERSION=3.2.13-SNAPSHOT
+ export RYA_EXAMPLE_VERSION=4.0.0-incubating
export RDF4J_VERSION=2.3.1
export ZOOKEEPER_VERSION=3.4.5-cdh4.5.0
-
+
+ mavenRepoUrl=http://repo1.maven.org/maven2/
+
echo "Updating host file with permanent ip"
sudo sed -i 's/127.0.1.1/192.168.33.10/' /etc/hosts
cat >> /etc/hosts <<EOF
@@ -295,25 +297,25 @@ EOF
sudo ln --force -s /usr/share/tomcat7/.RDF4J/Server/logs /var/log/tomcat7/rdf4j-server
rdf4jwar=/var/lib/tomcat7/webapps/rdf4j-server.war
if [[ ! -s $rdf4jwar ]] ; then
- echo "Downloading"
- download --output $rdf4jwar http://repo1.maven.org/maven2/org/eclipse/rdf4j/rdf4j-http-server/${RDF4J_VERSION}/rdf4j-http-server-${RDF4J_VERSION}.war || exit 110
+ echo "Downloading RDF4J Server"
+ download --output $rdf4jwar ${mavenRepoUrl}org/eclipse/rdf4j/rdf4j-http-server/${RDF4J_VERSION}/rdf4j-http-server-${RDF4J_VERSION}.war || exit 110
fi
echo "RDF4J http server deployed at http://rya-example-box:8080/rdf4j-server"
echo "Installing RDF4J Workbench"
workbench=/var/lib/tomcat7/webapps/rdf4j-workbench.war
if [[ ! -s $workbench ]] ; then
- echo "Downloading"
- download --output $workbench http://repo1.maven.org/maven2/org/eclipse/rdf4j/rdf4j-http-workbench/${RDF4J_VERSION}/rdf4j-http-workbench-${RDF4J_VERSION}.war || exit 111
+ echo "Downloading RDF4J Workbench"
+ download --output $workbench ${mavenRepoUrl}org/eclipse/rdf4j/rdf4j-http-workbench/${RDF4J_VERSION}/rdf4j-http-workbench-${RDF4J_VERSION}.war || exit 111
fi
echo "RDF4J workbench deployed at http://rya-example-box:8080/rdf4j-workbench"
echo "Installing Rya"
ryaIndexing=rya.indexing.example-${RYA_EXAMPLE_VERSION}-distribution
if [[ ! -s ${ryaIndexing}.zip ]] ; then
- # Right now it's on dropbox, but eventually it'll be on maven...
- echo "Downloading quietly, this will take some minutes with no output..."
- download --output ${ryaIndexing}.zip https://dl.dropbox.com/s/7e74yiuq4jmu0od/${ryaIndexing}.zip?raw=1 || exit 112
+ # Eventually it'll be on maven...
+ echo "Downloading ${ryaIndexing} quietly, this will take some minutes with no output..."
+ download --output ${ryaIndexing}.zip ${mavenRepoUrl}org/apache/rya/rya.indexing.example/${RYA_EXAMPLE_VERSION}/${ryaIndexing}.zip?raw=1 || exit 112
fi
sudo mkdir --parents ${ryaIndexing}
sudo unzip -q -o ${ryaIndexing}.zip -d ${ryaIndexing}
@@ -338,8 +340,8 @@ EOF
echo "Downloading and installing new templates for RDF4J WorkBench"
ryaVagrant=rya.vagrant.example-${RYA_EXAMPLE_VERSION}
if [[ ! -s ${ryaVagrant}.jar ]] ; then
- echo "Downloading"
- download --output ${ryaVagrant}.jar https://dl.dropbox.com/s/dgw63m66nubyy4z/${ryaVagrant}.jar?raw=1 || exit 120
+ echo "Downloading ${ryaVagrant}"
+ download --output ${ryaVagrant}.jar ${mavenRepoUrl}org/apache/rya/rya.vagrant.example/${RYA_EXAMPLE_VERSION}/${ryaVagrant}.jar?raw=1 || exit 120
fi
sudo mkdir --parents ${ryaVagrant}
sudo unzip -q -o ${ryaVagrant}.jar -d ${ryaVagrant}
@@ -349,8 +351,8 @@ EOF
echo "Deploying Rya Web"
ryaWar=web.rya-${RYA_EXAMPLE_VERSION}.war
if [[ ! -s ${ryaWar} ]] ; then
- echo "Downloading"
- download https://dl.dropbox.com/s/332wr4b2f34dp6e/${ryaWar}?raw=1 --output ${ryaWar} || exit 121
+ echo "Downloading ${ryaWar}"
+ download ${mavenRepoUrl}org/apache/rya/web.rya/${RYA_EXAMPLE_VERSION}/${ryaWar}.jar?raw=1 --output ${ryaWar} || exit 121
fi
sudo cp ${ryaWar} /var/lib/tomcat7/webapps/web.rya.war
# Wait for the war to deploy
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
index 30c6a7a..ae15b65 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
@@ -150,19 +150,19 @@ public class AccumuloRdfCountToolTest {
}
// public void testMRObject() throws Exception {
-// URI pred1 = VF.createIRI(litdupsNS, "pred1");
+// IRI pred1 = VF.createIRI(litdupsNS, "pred1");
// Literal literal = VF.createLiteral(0);
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test0"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test1"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test2"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test3"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test4"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test5"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test6"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test7"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test8"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test9"), pred1, literal));
-// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test10"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test0"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test1"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test2"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test3"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test4"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test5"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test6"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test7"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test8"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test9"), pred1, literal));
+// dao.add(VF.createStatement(VF.createIRI(litdupsNS, "test10"), pred1, literal));
// dao.commit();
//
// AccumuloRdfCountTool.main(new String[]{
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f31873a..05a87f3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -577,6 +577,16 @@ under the License.
<artifactId>rdf4j-repository-api</artifactId>
<version>${org.eclipse.rdf4j.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-api</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-base</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
+ </dependency>
<dependency>
<groupId>com.google.guava</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/sail/pom.xml
----------------------------------------------------------------------
diff --git a/sail/pom.xml b/sail/pom.xml
index 5fc159c..96c69e7 100644
--- a/sail/pom.xml
+++ b/sail/pom.xml
@@ -38,7 +38,6 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-sail-api</artifactId>
- <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
index b1ba3fc..63d0ade 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
@@ -28,7 +28,7 @@
//import org.eclipse.rdf4j.model.Resource;
//import org.eclipse.rdf4j.model.IRI;
//import org.eclipse.rdf4j.model.Value;
-//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//
//import com.google.common.io.ByteStreams;
//
@@ -37,8 +37,8 @@
//public class RdfCloudTripleStoreUtilsTest extends TestCase {
//
// public void testWriteReadURI() throws Exception {
-// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
-// URI uri = vf.createIRI("http://www.example.org/test/rel");
+// final ValueFactory vf = SimpleValueFactory.getInstance();
+// IRI uri = vf.createIRI("http://www.example.org/test/rel");
// byte[] value = writeValue(uri);
//
// Value readValue = readValue(ByteStreams
@@ -47,7 +47,7 @@
// }
//
// public void testWriteReadBNode() throws Exception {
-// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
+// final ValueFactory vf = SimpleValueFactory.getInstance();
// Value val = vf.createBNode("bnodeid");
// byte[] value = writeValue(val);
//
@@ -57,7 +57,7 @@
// }
//
// public void testWriteReadLiteral() throws Exception {
-// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
+// final ValueFactory vf = SimpleValueFactory.getInstance();
// Value val = vf.createLiteral("myliteral");
// byte[] value = writeValue(val);
//
@@ -67,7 +67,7 @@
// }
//
// public void testContexts() throws Exception {
-// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
+// final ValueFactory vf = SimpleValueFactory.getInstance();
// BNode cont1 = vf.createBNode("cont1");
// BNode cont2 = vf.createBNode("cont2");
// BNode cont3 = vf.createBNode("cont3");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/b35a2f3d/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
index a60440d..3944432 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
@@ -23,7 +23,7 @@
//import RdfCloudTripleStoreConstants;
//import RdfCloudTripleStoreConstants;
//import org.eclipse.rdf4j.model.ValueFactory;
-//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//import org.eclipse.rdf4j.query.GraphQuery;
//import org.eclipse.rdf4j.query.QueryLanguage;
//import org.eclipse.rdf4j.query.TupleQuery;
[37/48] incubator-rya git commit: RYA-405 More PR Updates
Posted by pu...@apache.org.
RYA-405 More PR Updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/648a87ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/648a87ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/648a87ef
Branch: refs/heads/master
Commit: 648a87ef9b22695a234adbdfe413ca951ca718f8
Parents: b35a2f3
Author: eric.white <Er...@parsons.com>
Authored: Thu Apr 19 16:55:23 2018 -0400
Committer: Valiyil <Pu...@parsons.com>
Committed: Mon Apr 23 09:19:11 2018 -0400
----------------------------------------------------------------------
.../api/function/filter/FilterEvaluator.java | 2 +-
.../rya/api/RdfCloudTripleStoreUtils.java | 6 ++--
.../org/apache/rya/api/domain/RyaTypeUtils.java | 2 +-
.../org/apache/rya/api/domain/VarNameUtils.java | 16 +++++----
.../rya/api/functions/DateTimeWithinPeriod.java | 6 ++--
.../org/apache/rya/api/functions/OWLTime.java | 30 ++++++++---------
.../rya/api/resolver/RdfToRyaConversions.java | 2 +-
.../rya/api/resolver/RyaToRdfConversions.java | 2 +-
.../OspWholeRowTriplePatternStrategyTest.java | 11 ++++---
.../PoWholeRowTriplePatternStrategyTest.java | 10 +++---
.../SpoWholeRowTriplePatternStrategyTest.java | 10 +++---
.../rya/accumulo/AccumuloRdfQueryIterator.java | 4 +--
.../dao/SimpleMongoDBStorageStrategy.java | 2 +-
.../rya/indexing/FilterFunctionOptimizer.java | 2 +-
.../accumulo/AccumuloIndexingConfiguration.java | 8 ++---
.../entity/update/BaseEntityIndexer.java | 2 +-
.../mongodb/MongoIndexingConfiguration.java | 8 ++---
.../rya/indexing/smarturi/SmartUriAdapter.java | 34 ++++++++++----------
.../forwardchain/rule/SpinConstructRule.java | 4 +--
.../GeoEnabledFilterFunctionOptimizer.java | 2 +-
.../accumulo/BindingSetStringConverter.java | 2 +-
.../pcj/fluo/api/CreatePeriodicQuery.java | 2 +-
.../pcj/fluo/app/util/PeriodicQueryUtil.java | 4 +--
.../indexing/pcj/fluo/integration/BatchIT.java | 12 +++----
.../pcj/fluo/integration/StreamingTestIT.java | 6 ++--
extras/rya.reasoning/README.md | 6 ++--
.../java/org/apache/rya/reasoning/Schema.java | 8 ++---
.../org/apache/rya/reasoning/TypeReasoner.java | 8 ++---
.../rya/reasoning/mr/ConformanceTest.java | 12 +++----
.../rya/reasoning/mr/ResourceWritable.java | 2 +-
.../vagrantExample/src/main/vagrant/Vagrantfile | 8 ++---
.../rya/accumulo/mr/tools/Upgrade322Tool.java | 2 +-
.../inference/InferenceEngine.java | 4 +--
.../rya/RdfCloudTripleStoreConnectionTest.java | 18 +++++------
.../rya/RdfCloudTripleStoreUtilsTest.java | 4 +--
35 files changed, 135 insertions(+), 126 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
index a70fc53..ca462f6 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
@@ -109,7 +109,7 @@ public class FilterEvaluator {
} catch (final QueryEvaluationException e) {
//False returned because for whatever reason, the ValueExpr could not be evaluated.
//In the event that the ValueExpr is a FunctionCall, this Exception will be generated if
- //the Function URI is a valid URI that was found in the FunctionRegistry, but the arguments
+ //the Function IRI is a valid IRI that was found in the FunctionRegistry, but the arguments
//for that Function could not be parsed.
log.error("Could not evaluate a Filter.", e);
return false;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
index 91cb74e..8a7c007 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
@@ -335,9 +335,9 @@ public class RdfCloudTripleStoreUtils {
// if (s == null)
// return null;
//
-// for (String uri : s) {
-// if (predicate.stringValue().equals(uri)) {
-// return (Class<? extends TtlValueConverter>) RdfCloudTripleStoreUtils.class.getClassLoader().loadClass(conf.get(uri));
+// for (String iri : s) {
+// if (predicate.stringValue().equals(iri)) {
+// return (Class<? extends TtlValueConverter>) RdfCloudTripleStoreUtils.class.getClassLoader().loadClass(conf.get(iri));
// }
// }
// return null;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
index e7032e3..3136af3 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
@@ -181,7 +181,7 @@ public final class RyaTypeUtils {
/**
*
- * Creates a URI {@link RyaType} object.
+ * Creates a IRI {@link RyaType} object.
* @param value the {@link IRI} object.
* @return the {@link RyaType} with the data type set to
* {@link XMLSchema#ANYURI} and the data set to the specified {@code value}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
index 6f47e35..03c9e79 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
@@ -25,6 +25,8 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.algebra.Var;
import org.eclipse.rdf4j.query.algebra.helpers.TupleExprs;
+import edu.umd.cs.findbugs.annotations.Nullable;
+
/**
* Utility methods and constants for RDF {@link Var} names.
*/
@@ -54,7 +56,7 @@ public final class VarNameUtils {
* @param value the value to add the constant prefix to.
* @return the value with the constant prefix attached before it.
*/
- public static String prependConstant(final String value) {
+ public static @Nullable String prependConstant(@Nullable final String value) {
if (value != null) {
return CONSTANT_PREFIX + value;
}
@@ -67,7 +69,7 @@ public final class VarNameUtils {
* @return {@code true} if the name begins with the constant prefix.
* {@code false} otherwise.
*/
- public static boolean isConstant(final String name) {
+ public static boolean isConstant(@Nullable final String name) {
if (name != null) {
return name.startsWith(CONSTANT_PREFIX) || name.startsWith(LEGACY_CONSTANT_PREFIX);
}
@@ -80,7 +82,7 @@ public final class VarNameUtils {
* @return the string with the constant prefix removed. Otherwise returns
* the original string.
*/
- public static String removeConstant(final String name) {
+ public static @Nullable String removeConstant(@Nullable final String name) {
if (isConstant(name)) {
String removed = StringUtils.removeStart(name, CONSTANT_PREFIX);
if (name.equals(removed)) {
@@ -96,7 +98,7 @@ public final class VarNameUtils {
* @param value the value to add the anonymous prefix to.
* @return the value with the anonymous prefix attached before it.
*/
- public static String prependAnonymous(final String value) {
+ public static @Nullable String prependAnonymous(@Nullable final String value) {
if (value != null) {
return ANONYMOUS_PREFIX + value;
}
@@ -109,7 +111,7 @@ public final class VarNameUtils {
* @return {@code true} if the name begins with the anonymous prefix.
* {@code false} otherwise.
*/
- public static boolean isAnonymous(final String name) {
+ public static boolean isAnonymous(@Nullable final String name) {
if (name != null) {
return name.startsWith(ANONYMOUS_PREFIX) || name.startsWith(LEGACY_ANONYMOUS_PREFIX);
}
@@ -122,7 +124,7 @@ public final class VarNameUtils {
* @return the string with the anonymous prefix removed. Otherwise returns
* the original string.
*/
- public static String removeAnonymous(final String name) {
+ public static @Nullable String removeAnonymous(@Nullable final String name) {
if (isAnonymous(name)) {
String removed = StringUtils.removeStart(name, ANONYMOUS_PREFIX);
if (name.equals(removed)) {
@@ -176,7 +178,7 @@ public final class VarNameUtils {
* @param var the {@link Var}.
* @return the simple constant var name.
*/
- public static String createSimpleConstVarName(final Var var) {
+ public static @Nullable String createSimpleConstVarName(@Nullable final Var var) {
String varName = null;
if (var != null) {
if (var.getValue() != null && isConstant(var.getName())) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
index 655425d..62720e6 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
@@ -37,7 +37,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* This {@link Function} determines whether two {@link XMLSchema#DATETIME}s occur within a specified period of time of
* one another. The method {@link Function#evaluate(ValueFactory, Value...)} expects four values, where the first two
* values are the datetimes, the third value is an integer indicating the period, and the fourth value is a URI
- * indicating the time unit of the period. The URI must be of Type DurationDescription in the OWL-Time ontology (see
+ * indicating the time unit of the period. The IRI must be of Type DurationDescription in the OWL-Time ontology (see
* <a href ="https://www.w3.org/TR/owl-time/">https://www.w3.org/TR/owl-time/</a>). Examples of valid time unit URIs can
* be found in the class {@link OWLTime} and below
* <ul>
@@ -60,7 +60,7 @@ public class DateTimeWithinPeriod implements Function {
/**
* Determines whether two datetimes occur within a specified period of time of one another. This method expects four
* values, where the first two values are the datetimes, the third value is an integer indicating the period, and
- * the fourth value is a URI indicating the time unit of the period. The URI must be of Type DurationDescription in
+ * the fourth value is an IRI indicating the time unit of the period. The IRI must be of Type DurationDescription in
* the OWL-Time ontology (see <a href ="https://www.w3.org/TR/owl-time/">https://www.w3.org/TR/owl-time/</a>).
* Examples of valid time unit URIs can be found in the class {@link OWLTime} and below
* <ul>
@@ -118,7 +118,7 @@ public class DateTimeWithinPeriod implements Function {
* Converts the period duration to milliseconds.
*
* @param duration - duration of temporal period
- * @param unit - URI indicating the time unit (URI must be of type DurationDescription in the OWL-Time ontology
+ * @param unit - IRI indicating the time unit (URI must be of type DurationDescription in the OWL-Time ontology
* indicated by the namespace <http://www.w3.org/2006/time#>)
* @return - duration in milliseconds
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java b/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
index 48649d1..9e19e62 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
@@ -74,38 +74,38 @@ public class OWLTime {
}
/**
- * Verifies whether URI is a valid OWL-Time URI that is supported by this class.
- * @param durationURI - OWLTime URI indicating the time unit (not null)
- * @return - {@code true} if this URI indicates a supported OWLTime time unit
+ * Verifies whether IRI is a valid OWL-Time IRI that is supported by this class.
+ * @param durationIRI - OWLTime IRI indicating the time unit (not null)
+ * @return - {@code true} if this IRI indicates a supported OWLTime time unit
*/
- public static boolean isValidDurationType(IRI durationURI) {
- checkNotNull(durationURI);
- return DURATION_MAP.containsKey(durationURI);
+ public static boolean isValidDurationType(IRI durationIRI) {
+ checkNotNull(durationIRI);
+ return DURATION_MAP.containsKey(durationIRI);
}
/**
* Returns the duration in milliseconds
*
- * @param duration - amount of time in the units indicated by the provided {@link OWLTime} URI
- * @param uri - OWLTime URI indicating the time unit of duration (not null)
+ * @param duration - amount of time in the units indicated by the provided {@link OWLTime} IRI
+ * @param iri - OWLTime IRI indicating the time unit of duration (not null)
* @return - the amount of time in milliseconds
* @throws IllegalArgumentException if provided {@link IRI} is not a valid, supported OWL-Time time unit.
*/
- public static long getMillis(int duration, IRI uri) throws IllegalArgumentException {
- Optional<ChronoUnit> unit = getChronoUnitFromURI(uri);
+ public static long getMillis(int duration, IRI iri) throws IllegalArgumentException {
+ Optional<ChronoUnit> unit = getChronoUnitFromURI(iri);
checkArgument(unit.isPresent(),
- String.format("URI %s does not indicate a valid OWLTime time unit. URI must of be of type %s, %s, %s, %s, or %s .", uri,
+ String.format("IRI %s does not indicate a valid OWLTime time unit. IRI must of be of type %s, %s, %s, %s, or %s .", iri,
SECONDS_URI, MINUTES_URI, HOURS_URI, DAYS_URI, WEEKS_URI));
return duration * unit.get().getDuration().toMillis();
}
/**
- * Converts the {@link OWLTime} URI time unit to a {@link ChronoUnit} time unit
+ * Converts the {@link OWLTime} IRI time unit to a {@link ChronoUnit} time unit
*
- * @param durationURI - OWLTime time unit URI (not null)
+ * @param durationIRI - OWLTime time unit IRI (not null)
* @return - corresponding ChronoUnit time unit
*/
- public static Optional<ChronoUnit> getChronoUnitFromURI(IRI durationURI) {
- return Optional.ofNullable(DURATION_MAP.get(durationURI));
+ public static Optional<ChronoUnit> getChronoUnitFromURI(IRI durationIRI) {
+ return Optional.ofNullable(DURATION_MAP.get(durationIRI));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
index 6cd27b7..e89306e 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
@@ -60,7 +60,7 @@ public class RdfToRyaConversions {
public static RyaType convertValue(Value value) {
if (value == null) return null;
- //assuming either uri or Literal here
+ //assuming either IRI or Literal here
if(value instanceof Resource) {
return convertResource((Resource) value);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
index 102db46..e9e1e46 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
@@ -55,7 +55,7 @@ public class RyaToRdfConversions {
}
public static Value convertValue(RyaType value) {
- //assuming either uri or Literal here
+ //assuming either IRI or Literal here
return (value instanceof RyaURI || value.getDataType().equals(XMLSchema.ANYURI)) ? convertURI(value) : convertLiteral(value);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
index b9ef519..a3a467d 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
@@ -27,8 +27,9 @@
//import org.apache.rya.api.resolver.triple.TripleRow;
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//import org.apache.hadoop.io.Text;
-//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
@@ -37,14 +38,16 @@
// * Time: 11:46 AM
// */
//public class OspWholeRowTriplePatternStrategyTest extends TestCase {
+// private static final ValueFactory VF = SimpleValueFactory.getInstance();
+//
// RyaURI uri = new RyaURI("urn:test#1234");
// RyaURI uri2 = new RyaURI("urn:test#1235");
// RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
// RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
//
-// RyaType customType1 = new RyaType(new URIImpl("urn:custom#type"), "1234");
-// RyaType customType2 = new RyaType(new URIImpl("urn:custom#type"), "1235");
-// RyaType customType3 = new RyaType(new URIImpl("urn:custom#type"), "1236");
+// RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
+// RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
+// RyaType customType3 = new RyaType(VF.createIRI("urn:custom#type"), "1236");
// RyaTypeRange customTypeRange1 = new RyaTypeRange(customType1, customType2);
// RyaTypeRange customTypeRange2 = new RyaTypeRange(customType2, customType3);
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
index 12bfc1f..7060457 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
@@ -27,8 +27,9 @@
//import org.apache.rya.api.resolver.triple.TripleRow;
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//import org.apache.hadoop.io.Text;
-//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
@@ -37,6 +38,7 @@
// * Time: 11:46 AM
// */
//public class PoWholeRowTriplePatternStrategyTest extends TestCase {
+// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
// RyaURI uri = new RyaURI("urn:test#1234");
// RyaURI uri2 = new RyaURI("urn:test#1235");
@@ -45,9 +47,9 @@
// PoWholeRowTriplePatternStrategy strategy = new PoWholeRowTriplePatternStrategy();
// RyaContext ryaContext = RyaContext.getInstance();
//
-// RyaType customType1 = new RyaType(new URIImpl("urn:custom#type"), "1234");
-// RyaType customType2 = new RyaType(new URIImpl("urn:custom#type"), "1235");
-// RyaType customType3 = new RyaType(new URIImpl("urn:custom#type"), "1236");
+// RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
+// RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
+// RyaType customType3 = new RyaType(VF.createIRI("urn:custom#type"), "1236");
// RyaTypeRange customTypeRange1 = new RyaTypeRange(customType1, customType2);
// RyaTypeRange customTypeRange2 = new RyaTypeRange(customType2, customType3);
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
index 5e2ca7e..2c40053 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
@@ -27,8 +27,9 @@
//import org.apache.rya.api.resolver.triple.TripleRow;
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
//import org.apache.hadoop.io.Text;
-//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
@@ -37,6 +38,7 @@
// * Time: 7:47 AM
// */
//public class SpoWholeRowTriplePatternStrategyTest extends TestCase {
+// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
// RyaURI uri = new RyaURI("urn:test#1234");
// RyaURI uri2 = new RyaURI("urn:test#1235");
@@ -45,9 +47,9 @@
// SpoWholeRowTriplePatternStrategy strategy = new SpoWholeRowTriplePatternStrategy();
// RyaContext ryaContext = RyaContext.getInstance();
//
-// RyaType customType1 = new RyaType(new URIImpl("urn:custom#type"), "1234");
-// RyaType customType2 = new RyaType(new URIImpl("urn:custom#type"), "1235");
-// RyaType customType3 = new RyaType(new URIImpl("urn:custom#type"), "1236");
+// RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
+// RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
+// RyaType customType3 = new RyaType(VF.createIRI("urn:custom#type"), "1236");
// RyaTypeRange customTypeRange1 = new RyaTypeRange(customType1, customType2);
// RyaTypeRange customTypeRange2 = new RyaTypeRange(customType2, customType3);
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
index e99cfe1..843298c 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
@@ -93,7 +93,7 @@
// open = true;
// }
//
-// public AccumuloRdfQueryIterator(Resource subject, URI predicate, Value object, Connector connector,
+// public AccumuloRdfQueryIterator(Resource subject, IRI predicate, Value object, Connector connector,
// AccumuloRdfConfiguration conf, Resource[] contexts) throws RdfDAOException {
// this(Collections.<Entry<Statement, BindingSet>>singleton(new RdfCloudTripleStoreUtils.CustomEntry<Statement, BindingSet>(
// new NullableStatementImpl(subject, predicate, object, contexts),
@@ -114,7 +114,7 @@
// for (Entry<Statement, BindingSet> stmtbs : statements) {
// Statement stmt = stmtbs.getKey();
// Resource subject = stmt.getSubject();
-// URI predicate = stmt.getPredicate();
+// IRI predicate = stmt.getPredicate();
// Value object = stmt.getObject();
// context = stmt.getContext(); //TODO: assumes the same context for all statements
// logger.debug("Batch Scan, lookup subject[" + subject + "] predicate[" + predicate + "] object[" + object + "] combination");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
index a868e3d..b2490bc 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
@@ -65,7 +65,7 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
/**
* Generate the hash that will be used to index and retrieve a given value.
- * @param value A value to be stored or accessed (e.g. a URI or literal).
+ * @param value A value to be stored or accessed (e.g. a IRI or literal).
* @return the hash associated with that value in MongoDB.
*/
public static String hash(String value) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
index d5653a0..5ce6bfb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
@@ -132,7 +132,7 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
for (final StatementPattern matchStatement: matchStatements.matchStatements) {
final Var subject = matchStatement.getSubjectVar();
if (subject.hasValue() && !(subject.getValue() instanceof Resource)) {
- throw new IllegalArgumentException("Query error: Found " + subject.getValue() + ", expected an URI or BNode");
+ throw new IllegalArgumentException("Query error: Found " + subject.getValue() + ", expected an IRI or BNode");
}
Validate.isTrue(subject.hasValue() || subject.getName() != null);
Validate.isTrue(!matchStatement.getObjectVar().hasValue() && matchStatement.getObjectVar().getName() != null);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
index 9e6e92b..e6deab7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
@@ -255,7 +255,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
/**
* Sets the predicates used for freetext indexing
- * @param predicates - Array of predicate URI strings used for freetext indexing
+ * @param predicates - Array of predicate IRI strings used for freetext indexing
*/
public void setAccumuloFreeTextPredicates(final String[] predicates) {
Preconditions.checkNotNull(predicates, "Freetext predicates cannot be null.");
@@ -264,7 +264,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
/**
* Gets the predicates used for freetext indexing
- * @return Array of predicate URI strings used for freetext indexing
+ * @return Array of predicate IRI strings used for freetext indexing
*/
public String[] getAccumuloFreeTextPredicates() {
return getStrings(ConfigUtils.FREETEXT_PREDICATES_LIST);
@@ -272,7 +272,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
/**
* Sets the predicates used for temporal indexing
- * @param predicates - Array of predicate URI strings used for temporal indexing
+ * @param predicates - Array of predicate IRI strings used for temporal indexing
*/
public void setAccumuloTemporalPredicates(final String[] predicates) {
Preconditions.checkNotNull(predicates, "Freetext predicates cannot be null.");
@@ -281,7 +281,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
/**
* Gets the predicates used for temporal indexing
- * @return Array of predicate URI strings used for temporal indexing
+ * @return Array of predicate IRI strings used for temporal indexing
*/
public String[] getAccumuloTemporalPredicates() {
return getStrings(ConfigUtils.TEMPORAL_PREDICATES_LIST);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
index 52d6f4d..26247a6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
@@ -66,7 +66,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
private static final Logger log = Logger.getLogger(BaseEntityIndexer.class);
/**
- * When this URI is the Predicate of a Statement, it indicates a {@link Type} for an {@link Entity}.
+ * When this IRI is the Predicate of a Statement, it indicates a {@link Type} for an {@link Entity}.
*/
private static final RyaURI TYPE_URI = new RyaURI( RDF.TYPE.toString() );
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
index 3ccdc9a..25bb0b8 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
@@ -166,7 +166,7 @@ public class MongoIndexingConfiguration extends MongoDBRdfConfiguration {
/**
* Sets the predicates that the {@link MongoFreeTextIndexer} uses for indexing
- * @param predicates - predicate URI used for freetext indexing
+ * @param predicates - predicate IRI used for freetext indexing
*/
public void setMongoFreeTextPredicates(final String[] predicates) {
Preconditions.checkNotNull(predicates, "Freetext predicates cannot be null.");
@@ -174,7 +174,7 @@ public class MongoIndexingConfiguration extends MongoDBRdfConfiguration {
}
/**
- * @return Array of predicate URI Strings used for freetext indexing
+ * @return Array of predicate IRI Strings used for freetext indexing
*/
public String[] getMongoFreeTextPredicates() {
return getStrings(ConfigUtils.FREETEXT_PREDICATES_LIST);
@@ -182,7 +182,7 @@ public class MongoIndexingConfiguration extends MongoDBRdfConfiguration {
/**
* Sets the predicates that the {@link MongoTemporalIndexer} uses for indexing
- * @param predicates - predicate URI used for temporal indexing
+ * @param predicates - predicate IRI used for temporal indexing
*/
public void setMongoTemporalPredicates(final String[] predicates) {
Preconditions.checkNotNull(predicates, "Freetext predicates cannot be null.");
@@ -191,7 +191,7 @@ public class MongoIndexingConfiguration extends MongoDBRdfConfiguration {
/**
* Gets the predicates that the {@link MongoTemporalIndexer} uses for indexing
- * @return Array of predicate URI Strings used for temporal indexing
+ * @return Array of predicate IRI Strings used for temporal indexing
*/
public String[] getMongoTemporalPredicates() {
return getStrings(ConfigUtils.TEMPORAL_PREDICATES_LIST);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
index b6fe556..d46d310 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
@@ -295,8 +295,8 @@ public class SmartUriAdapter {
if (StringUtils.isNotBlank(typeShortName)) {
formattedKey = addTypePrefixToUri(formattedKey, typeShortName);
}
- final IRI uri = VF.createIRI(formattedKey);
- objectMap.put(uri, value);
+ final IRI iri = VF.createIRI(formattedKey);
+ objectMap.put(iri, value);
}
}
@@ -341,7 +341,7 @@ public class SmartUriAdapter {
uriBuilder.setParameters(nameValuePairs);
- IRI uri = null;
+ IRI iri = null;
try {
if (fragmentPosition > -1) {
final java.net.URI partialUri = uriBuilder.build();
@@ -349,26 +349,26 @@ public class SmartUriAdapter {
final URIBuilder fragmentUriBuilder = new URIBuilder(new java.net.URI(prefix));
fragmentUriBuilder.setFragment(uriString);
final String fragmentUriString = fragmentUriBuilder.build().toString();
- uri = VF.createIRI(fragmentUriString);
+ iri = VF.createIRI(fragmentUriString);
} else {
final String uriString = uriBuilder.build().toString();
- uri = VF.createIRI(uriString);
+ iri = VF.createIRI(uriString);
}
} catch (final URISyntaxException e) {
throw new SmartUriException("Smart URI could not serialize the property map.", e);
}
- return uri;
+ return iri;
}
/**
- * Deserializes a URI into a map of URI's to values.
- * @param uri the {@link IRI}.
+ * Deserializes an IRI into a map of URI's to values.
+ * @param iri the {@link IRI}.
* @return the {@link Map} of {@link IRI}s to {@link Value}s.
* @throws SmartUriException
*/
- public static Map<IRI, Value> deserializeUri(final IRI uri) throws SmartUriException {
- final String uriString = uri.stringValue();
+ public static Map<IRI, Value> deserializeUri(final IRI iri) throws SmartUriException {
+ final String uriString = iri.stringValue();
final int fragmentPosition = uriString.indexOf("#");
String prefix = uriString.substring(0, fragmentPosition + 1);
if (fragmentPosition == -1) {
@@ -389,7 +389,7 @@ public class SmartUriAdapter {
throw new SmartUriException("Unable to deserialize Smart URI", e);
}
final Map<IRI, Value> map = new HashMap<>();
- final RyaURI subject = findSubject(uri.stringValue());
+ final RyaURI subject = findSubject(iri.stringValue());
final List<NameValuePair> parameters = uriBuilder.getQueryParams();
Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>();
@@ -580,10 +580,10 @@ public class SmartUriAdapter {
for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity.getProperties().entrySet()) {
for (final Entry<RyaURI, Property> property : entry.getValue().entrySet()) {
final RyaURI propertyKey = property.getKey();
- final IRI uri = VF.createIRI(propertyKey.getData());
+ final IRI iri = VF.createIRI(propertyKey.getData());
final Property propertyValue = property.getValue();
final Value value = RyaToRdfConversions.convertValue(propertyValue.getValue());
- map.put(uri, value);
+ map.put(iri, value);
}
}
return map;
@@ -598,10 +598,10 @@ public class SmartUriAdapter {
public static Set<Property> mapToProperties(final Map<IRI, Value> map) {
final Set<Property> properties = new LinkedHashSet<>();
for (final Entry<IRI, Value> entry : map.entrySet()) {
- final IRI uri = entry.getKey();
+ final IRI iri = entry.getKey();
final Value value = entry.getValue();
- final RyaURI ryaUri = new RyaURI(uri.stringValue());
+ final RyaURI ryaUri = new RyaURI(iri.stringValue());
final RyaType ryaType = RdfToRyaConversions.convertValue(value);
final Property property = new Property(ryaUri, ryaType);
@@ -613,9 +613,9 @@ public class SmartUriAdapter {
public static Map<IRI, Value> propertiesToMap(final Set<Property> properties) {
final Map<IRI, Value> map = new LinkedHashMap<>();
for (final Property property : properties) {
- final IRI uri = VF.createIRI(property.getName().getData());
+ final IRI iri = VF.createIRI(property.getName().getData());
final Value value = RyaToRdfConversions.convertValue(property.getValue());
- map.put(uri, value);
+ map.put(iri, value);
}
return map;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
index 114d88e..c505e2a 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
@@ -80,7 +80,7 @@ public class SpinConstructRule extends AbstractConstructRule {
private Set<StatementPattern> consequentStatementPatterns = null;
/**
- * Instantiate a SPIN construct rule given its associated type, URI or bnode
+ * Instantiate a SPIN construct rule given its associated type, IRI or bnode
* identifier, and construct query tree. Modifies the query tree to
* incorporate the fact that ?this must belong to the associated type, and
* traverses the modified tree to find antecedent and consequent triple
@@ -116,7 +116,7 @@ public class SpinConstructRule extends AbstractConstructRule {
}
/**
- * Get the URI or bnode associated with this rule in the data.
+ * Get the IRI or bnode associated with this rule in the data.
* @return The rule's identifier.
*/
public Resource getId() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
index bd82c21..a82656a 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
@@ -159,7 +159,7 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
for (final StatementPattern matchStatement: matchStatements.matchStatements) {
final Var subject = matchStatement.getSubjectVar();
if (subject.hasValue() && !(subject.getValue() instanceof Resource)) {
- throw new IllegalArgumentException("Query error: Found " + subject.getValue() + ", expected an URI or BNode");
+ throw new IllegalArgumentException("Query error: Found " + subject.getValue() + ", expected an IRI or BNode");
}
Validate.isTrue(subject.hasValue() || subject.getName() != null);
Validate.isTrue(!matchStatement.getObjectVar().hasValue() && matchStatement.getObjectVar().getName() != null);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
index 45a1f61..4cf54dc 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
@@ -122,7 +122,7 @@ public class BindingSetStringConverter implements BindingSetConverter<String> {
final String dataString = valueAndType[0];
final String typeString = valueAndType[1];
- // Convert the String Type into a URI that describes the type.
+ // Convert the String Type into a IRI that describes the type.
final IRI typeURI = VF.createIRI(typeString);
// Convert the String Value into a Value.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
index 0e7c7cf..85db252 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
@@ -43,7 +43,7 @@ import com.google.common.collect.Sets;
* requesting periodic updates about events that occurred within a given
* window of time of this instant. This is also known as a rolling window
* query. Period Queries can be expressed using SPARQL by including the
- * {@link Function} indicated by the URI {@link PeriodicQueryUtil#PeriodicQueryURI}
+ * {@link Function} indicated by the IRI {@link PeriodicQueryUtil#PeriodicQueryURI}
* in the query. The user must provide this Function with the following arguments:
* the temporal variable in the query that will be filtered on, the window of time
* that events must occur within, the period at which the user wants to receive updates,
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
index 17fedf7..c1bdef2 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
@@ -55,7 +55,7 @@ import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
/**
- * Utility class for creating and executing Perioid Queries.
+ * Utility class for creating and executing Periodic Queries.
*
*/
public class PeriodicQueryUtil {
@@ -70,7 +70,7 @@ public class PeriodicQueryUtil {
/**
* Returns a PeriodicQueryNode for all {@link FunctionCall}s that represent PeriodicQueryNodes, otherwise
* an empty Optional is returned.
- * @param functionCall - FunctionCall taken from a {@lin TupleExpr}
+ * @param functionCall - FunctionCall taken from a {@link TupleExpr}
* @param arg - TupleExpr that will be the argument of the PeriodicQueryNode if it is created
* @return - Optional containing a PeriodicQueryNode if FunctionCall represents PeriodicQueryNode and empty Optional otherwise
* @throws Exception
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
index 555e002..8ebc9fc 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
@@ -145,8 +145,8 @@ public class BatchIT extends RyaExportITBase {
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
//create sharded span for deletion
- IRI uri = VF.createIRI("urn:subject_1");
- Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, uri);
+ IRI iri = VF.createIRI("urn:subject_1");
+ Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, iri);
Span span = Span.prefix(prefixBytes);
// Stream the data into Fluo.
@@ -194,8 +194,8 @@ public class BatchIT extends RyaExportITBase {
bs.addBinding("object1", VF.createIRI("urn:object_0"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
- IRI uri = VF.createIRI("urn:subject_1");
- Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, uri);
+ IRI iri = VF.createIRI("urn:subject_1");
+ Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, iri);
Span span = Span.prefix(prefixBytes);
// Stream the data into Fluo.
@@ -368,8 +368,8 @@ public class BatchIT extends RyaExportITBase {
for (int i = 0; i < ids.size(); i++) {
String id = ids.get(i);
String bsPrefix = prefixes.get(i);
- IRI uri = VF.createIRI(bsPrefix);
- Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(id, uri);
+ IRI iri = VF.createIRI(bsPrefix);
+ Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(id, iri);
NodeType type = NodeType.fromNodeId(id).get();
Column bsCol = type.getResultColumn();
SpanBatchDeleteInformation.Builder builder = SpanBatchDeleteInformation.builder().setBatchSize(batchSize)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
index 776b69f..b387e10 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
@@ -83,10 +83,10 @@ public class StreamingTestIT extends RyaExportITBase {
private void addRandomQueryStatementPairs(final int numPairs) throws Exception {
final Set<Statement> statementPairs = new HashSet<>();
for (int i = 0; i < numPairs; i++) {
- final String uri = "http://uuid_" + UUID.randomUUID().toString();
- final Statement statement1 = VF.createStatement(VF.createIRI(uri), VF.createIRI("http://pred1"),
+ final String iri = "http://uuid_" + UUID.randomUUID().toString();
+ final Statement statement1 = VF.createStatement(VF.createIRI(iri), VF.createIRI("http://pred1"),
VF.createLiteral("number_" + (i + 1)));
- final Statement statement2 = VF.createStatement(VF.createIRI(uri), VF.createIRI("http://pred2"), VF.createLiteral("literal"));
+ final Statement statement2 = VF.createStatement(VF.createIRI(iri), VF.createIRI("http://pred2"), VF.createLiteral("literal"));
statementPairs.add(statement1);
statementPairs.add(statement2);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.reasoning/README.md
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/README.md b/extras/rya.reasoning/README.md
index 812542d..6401285 100644
--- a/extras/rya.reasoning/README.md
+++ b/extras/rya.reasoning/README.md
@@ -333,7 +333,7 @@ triples or inconsistencies generated.
Reasoning is distributed according to URI: Mappers read in triples from Accumulo
and from previous iterations, and partition triples according to their subject
-and object. Reducers perform reasoning around one URI at a time, receiving as
+and object. Reducers perform reasoning around one IRI at a time, receiving as
input only triples involving that URI. This enables us to use MapReduce, but
requires making several passes through the data in cases where information
needs to be propagated several steps through the graph (for example, with
@@ -710,8 +710,8 @@ tools and utilities for interacting with Accumulo are located in
- An **OwlProperty** or **OwlClass** represents a property or a class, respectively.
Each object holds a reference to the RDF entity that identifies it (using to
- the RDF4J api): a URI for each OwlProperty, and a Resource for each class
- (because a class is more general; it can be a URI or a bnode).
+ the RDF4J api): an IRI for each OwlProperty, and a Resource for each class
+ (because a class is more general; it can be an IRI or a bnode).
Both maintain connections to other schema constructs, according to the
relevant schema connections that can be made for each type. In general,
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
index fabc074..0453a30 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
@@ -89,11 +89,11 @@ public class Schema {
};
static {
- for (IRI uri : schemaPredicateURIs) {
- schemaPredicates.add(uri);
+ for (IRI iri : schemaPredicateURIs) {
+ schemaPredicates.add(iri);
}
- for (Resource uri : schemaTypeURIs) {
- schemaTypes.add(uri);
+ for (Resource iri : schemaTypeURIs) {
+ schemaTypes.add(iri);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
index 8ccc774..67f9164 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
@@ -199,11 +199,11 @@ public class TypeReasoner extends AbstractReasoner {
public String getDiagnostics() {
int total = 0;
int incTotal = 0;
- for (Resource uri : possibleInferences.keySet()) {
- total += possibleInferences.get(uri).size();
+ for (Resource iri : possibleInferences.keySet()) {
+ total += possibleInferences.get(iri).size();
}
- for (Resource uri : possibleInconsistencies.keySet()) {
- incTotal += possibleInconsistencies.get(uri).size();
+ for (Resource iri : possibleInconsistencies.keySet()) {
+ incTotal += possibleInconsistencies.get(iri).size();
}
StringBuilder sb = new StringBuilder();
sb.append(knownTypes.size()).append(" total types known\n");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
index 34c8c44..87f1c8b 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
@@ -378,15 +378,15 @@ public class ConformanceTest extends Configured implements Tool {
final TupleQueryResult queryResult = query.evaluate();
while (queryResult.hasNext()) {
final BindingSet bindings = queryResult.next();
- final Value uri = bindings.getValue("test");
- if (testURIs.contains(uri)) {
+ final Value iri = bindings.getValue("test");
+ if (testURIs.contains(iri)) {
OwlTest test;
- if (tests.containsKey(uri)) {
- test = tests.get(uri);
+ if (tests.containsKey(iri)) {
+ test = tests.get(iri);
}
else {
test = new OwlTest();
- test.uri = uri;
+ test.uri = iri;
test.name = bindings.getValue("name").stringValue();
test.description = bindings.getValue("description").stringValue();
test.premise = bindings.getValue("graph").stringValue();
@@ -396,7 +396,7 @@ public class ConformanceTest extends Configured implements Tool {
if (bindings.hasBinding("nonentailed")) {
test.compareTo = bindings.getValue("nonentailed").stringValue();
}
- tests.put(uri, test);
+ tests.put(iri, test);
}
test.types.add(bindings.getValue("testType").stringValue());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
index 06f0d20..4305adb 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
@@ -29,7 +29,7 @@ import org.eclipse.rdf4j.model.Resource;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
- * Allows us to use a URI or bnode for a key.
+ * Allows us to use an IRI or bnode for a key.
*/
public class ResourceWritable implements WritableComparable<ResourceWritable> {
private Resource val;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/extras/vagrantExample/src/main/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/extras/vagrantExample/src/main/vagrant/Vagrantfile b/extras/vagrantExample/src/main/vagrant/Vagrantfile
index 2330bd9..bfa882f 100644
--- a/extras/vagrantExample/src/main/vagrant/Vagrantfile
+++ b/extras/vagrantExample/src/main/vagrant/Vagrantfile
@@ -314,7 +314,7 @@ EOF
ryaIndexing=rya.indexing.example-${RYA_EXAMPLE_VERSION}-distribution
if [[ ! -s ${ryaIndexing}.zip ]] ; then
# Eventually it'll be on maven...
- echo "Downloading ${ryaIndexing} quietly, this will take some minutes with no output..."
+ echo "Downloading ${ryaIndexing}.zip quietly, this will take some minutes with no output..."
download --output ${ryaIndexing}.zip ${mavenRepoUrl}org/apache/rya/rya.indexing.example/${RYA_EXAMPLE_VERSION}/${ryaIndexing}.zip?raw=1 || exit 112
fi
sudo mkdir --parents ${ryaIndexing}
@@ -340,8 +340,8 @@ EOF
echo "Downloading and installing new templates for RDF4J WorkBench"
ryaVagrant=rya.vagrant.example-${RYA_EXAMPLE_VERSION}
if [[ ! -s ${ryaVagrant}.jar ]] ; then
- echo "Downloading ${ryaVagrant}"
- download --output ${ryaVagrant}.jar ${mavenRepoUrl}org/apache/rya/rya.vagrant.example/${RYA_EXAMPLE_VERSION}/${ryaVagrant}.jar?raw=1 || exit 120
+ echo "Downloading ${ryaVagrant}.jar"
+ download --output ${ryaVagrant}.jar ${mavenRepoUrl}org/apache/rya/rya.vagrant.example/${RYA_EXAMPLE_VERSION}/${ryaVagrant}.jar?raw=1 || exit 120
fi
sudo mkdir --parents ${ryaVagrant}
sudo unzip -q -o ${ryaVagrant}.jar -d ${ryaVagrant}
@@ -352,7 +352,7 @@ EOF
ryaWar=web.rya-${RYA_EXAMPLE_VERSION}.war
if [[ ! -s ${ryaWar} ]] ; then
echo "Downloading ${ryaWar}"
- download ${mavenRepoUrl}org/apache/rya/web.rya/${RYA_EXAMPLE_VERSION}/${ryaWar}.jar?raw=1 --output ${ryaWar} || exit 121
+ download ${mavenRepoUrl}org/apache/rya/web.rya/${RYA_EXAMPLE_VERSION}/${ryaWar}?raw=1 --output ${ryaWar} || exit 121
fi
sudo cp ${ryaWar} /var/lib/tomcat7/webapps/web.rya.war
# Wait for the war to deploy
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
index e271e27..adc2de2 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
@@ -61,7 +61,7 @@ public class Upgrade322Tool extends AbstractAccumuloMRTool implements Tool {
setupAccumuloInput(job);
AccumuloInputFormat.setInputTableName(job, MRUtils.getTablePrefix(conf) + TBL_OSP_SUFFIX);
- //we do not need to change any row that is a string, custom, or uri type
+ //we do not need to change any row that is a string, custom, or iri type
IteratorSetting regex = new IteratorSetting(30, "regex",
RegExFilter.class);
RegExFilter.setRegexs(regex, "\\w*" + TYPE_DELIM + "[\u0003|\u0008|\u0002]", null, null, null, false);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
index 8d6feb6..ada151a 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
@@ -1223,8 +1223,8 @@ public class InferenceEngine {
/**
* Return whether a given property is known to be reflexive.
- * @param prop A URI
- * @return True if the given URI corresponds to an owl:ReflexiveProperty
+ * @param prop A IRI
+ * @return True if the given IRI corresponds to an owl:ReflexiveProperty
*/
public boolean isReflexiveProperty(final IRI prop) {
return (reflexivePropertySet != null) && reflexivePropertySet.contains(prop);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
index d40972c..5eab6c4 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
@@ -126,14 +126,14 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
// public void testAddAuth() throws Exception {
// RepositoryConnection conn = repository.getConnection();
-// URI cpu = vf.createIRI(litdupsNS, "cpu");
-// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
-// URI uri1 = vf.createIRI(litdupsNS, "uri1");
-// URI uri2 = vf.createIRI(litdupsNS, "uri2");
-// URI uri3 = vf.createIRI(litdupsNS, "uri3");
-// URI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
-// URI auth2 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "2");
-// URI auth3 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "3");
+// IRI cpu = vf.createIRI(litdupsNS, "cpu");
+// IRI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// IRI uri1 = vf.createIRI(litdupsNS, "uri1");
+// IRI uri2 = vf.createIRI(litdupsNS, "uri2");
+// IRI uri3 = vf.createIRI(litdupsNS, "uri3");
+// IRI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
+// IRI auth2 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "2");
+// IRI auth3 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "3");
// conn.add(cpu, loadPerc, uri1, auth1, auth2, auth3);
// conn.add(cpu, loadPerc, uri2, auth2, auth3);
// conn.add(cpu, loadPerc, uri3, auth3);
@@ -975,7 +975,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
// public void testNamedGraphLoadWInlineAuth() throws Exception {
// InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("namedgraphs.trig");
// assertNotNull(stream);
-// URI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
+// IRI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
// RepositoryConnection conn = repository.getConnection();
// conn.add(stream, "", RDFFormat.TRIG, auth1);
// conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/648a87ef/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
index 63d0ade..f2d3f76 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
@@ -38,8 +38,8 @@
//
// public void testWriteReadURI() throws Exception {
// final ValueFactory vf = SimpleValueFactory.getInstance();
-// IRI uri = vf.createIRI("http://www.example.org/test/rel");
-// byte[] value = writeValue(uri);
+// IRI iri = vf.createIRI("http://www.example.org/test/rel");
+// byte[] value = writeValue(iri);
//
// Value readValue = readValue(ByteStreams
// .newDataInput(value), vf);
[40/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectStatisticsTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectStatisticsTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectStatisticsTest.java
index 9bbe518..15cd0d4 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectStatisticsTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectStatisticsTest.java
@@ -42,7 +42,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.joinselect.mr.JoinSelectAggregate.JoinReducer;
@@ -99,7 +99,7 @@ public class JoinSelectStatisticsTest {
private static final String PREFIX = JoinSelectStatisticsTest.class.getSimpleName();
private static final String DELIM = "\u0000";
- private static final String uri = "uri:";
+ private static final String iri = "uri:";
private List<String> cardList = Arrays.asList("subject", "predicate", "object");
private List<String> aggCardList = Arrays.asList("subjectobject", "subjectpredicate", "subjectsubject", "predicateobject", "predicatepredicate", "predicatesubject");
private static File SPOOUT;
@@ -417,7 +417,7 @@ public class JoinSelectStatisticsTest {
BatchWriter bw_table1 = c.createBatchWriter("rya_spo", new BatchWriterConfig());
for (int i = 1; i < 3; i++) {
- RyaStatement rs = new RyaStatement(new RyaURI(uri + i), new RyaURI(uri + 5), new RyaType(uri + (i + 2)));
+ RyaStatement rs = new RyaStatement(new RyaIRI(iri + i), new RyaIRI(iri + 5), new RyaType(iri + (i + 2)));
Map<TABLE_LAYOUT, TripleRow> tripleRowMap = ryaContext.serializeTriple(rs);
TripleRow tripleRow = tripleRowMap.get(TABLE_LAYOUT.SPO);
Mutation m = JoinSelectStatsUtil.createMutation(tripleRow);
@@ -433,7 +433,7 @@ public class JoinSelectStatisticsTest {
int j = 1;
for (String s : cardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + j).toString().getBytes()));
bw_table2.addMutation(m);
j++;
@@ -457,7 +457,7 @@ public class JoinSelectStatisticsTest {
}
Scanner scan1 = c.createScanner("rya_selectivity" , new Authorizations());
- scan1.setRange(Range.prefix("predicate" +DELIM + uri + 5));
+ scan1.setRange(Range.prefix("predicate" +DELIM + iri + 5));
int i = 5;
for (Map.Entry<Key, Value> entry : scan1) {
@@ -479,7 +479,7 @@ public class JoinSelectStatisticsTest {
Scanner scan2 = c.createScanner("rya_selectivity" , new Authorizations());
- scan2.setRange(Range.prefix("object" +DELIM + uri + 3));
+ scan2.setRange(Range.prefix("object" +DELIM + iri + 3));
int j = 5;
for (Map.Entry<Key, Value> entry : scan2) {
@@ -502,7 +502,7 @@ public class JoinSelectStatisticsTest {
Scanner scan3 = c.createScanner("rya_selectivity", new Authorizations());
- scan3.setRange(Range.prefix("objectsubject" + DELIM + uri + 3 +DELIM +uri +1 ));
+ scan3.setRange(Range.prefix("objectsubject" + DELIM + iri + 3 +DELIM +iri +1 ));
int k = 8;
for (Map.Entry<Key, Value> entry : scan3) {
@@ -536,7 +536,7 @@ public class JoinSelectStatisticsTest {
BatchWriter bw_table1 = c.createBatchWriter("rya_spo", new BatchWriterConfig());
for (int i = 1; i < 4; i++) {
- RyaStatement rs = new RyaStatement(new RyaURI(uri + 1), new RyaURI(uri + 2), new RyaType(uri + i));
+ RyaStatement rs = new RyaStatement(new RyaIRI(iri + 1), new RyaIRI(iri + 2), new RyaType(iri + i));
Map<TABLE_LAYOUT, TripleRow> tripleRowMap = ryaContext.serializeTriple(rs);
TripleRow tripleRow = tripleRowMap.get(TABLE_LAYOUT.SPO);
Mutation m = JoinSelectStatsUtil.createMutation(tripleRow);
@@ -549,7 +549,7 @@ public class JoinSelectStatisticsTest {
for (int i = 1; i < 4; i++) {
for (String s : cardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + 2).toString().getBytes()));
bw_table2.addMutation(m);
}
@@ -559,7 +559,7 @@ public class JoinSelectStatisticsTest {
Assert.assertEquals(0, ToolRunner.run(new JoinSelectTestDriver(), new String[]{""}));
Scanner scan1 = c.createScanner("rya_selectivity" , new Authorizations());
- scan1.setRange(Range.prefix("subject" +DELIM + uri + 1));
+ scan1.setRange(Range.prefix("subject" +DELIM + iri + 1));
int i = 0;
for (Map.Entry<Key, Value> entry : scan1) {
@@ -570,7 +570,7 @@ public class JoinSelectStatisticsTest {
Assert.assertTrue(i == 6);
Scanner scan2 = c.createScanner("rya_selectivity" , new Authorizations());
- scan2.setRange(Range.prefix("predicate" +DELIM + uri + 2));
+ scan2.setRange(Range.prefix("predicate" +DELIM + iri + 2));
int j = 0;
for (Map.Entry<Key, Value> entry : scan2) {
@@ -586,7 +586,7 @@ public class JoinSelectStatisticsTest {
Assert.assertTrue(j == 6);
Scanner scan3 = c.createScanner("rya_selectivity" , new Authorizations());
- scan3.setRange(Range.prefix("predicateobject" +DELIM + uri + 2 +DELIM + uri + 2));
+ scan3.setRange(Range.prefix("predicateobject" +DELIM + iri + 2 +DELIM + iri + 2));
int k = 0;
for (Map.Entry<Key, Value> entry : scan3) {
@@ -612,7 +612,7 @@ public class JoinSelectStatisticsTest {
for (int j = 1; j < 3; j++) {
for (int k = 1; k < 3; k++) {
- RyaStatement rs = new RyaStatement(new RyaURI(uri + i), new RyaURI(uri + (j)), new RyaType(uri + k));
+ RyaStatement rs = new RyaStatement(new RyaIRI(iri + i), new RyaIRI(iri + (j)), new RyaType(iri + k));
Map<TABLE_LAYOUT, TripleRow> tripleRowMap = ryaContext.serializeTriple(rs);
TripleRow tripleRow = tripleRowMap.get(TABLE_LAYOUT.SPO);
Mutation m = JoinSelectStatsUtil.createMutation(tripleRow);
@@ -629,7 +629,7 @@ public class JoinSelectStatisticsTest {
int k = 1;
for (String s : cardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + k).toString().getBytes()));
bw_table2.addMutation(m);
k++;
@@ -638,7 +638,7 @@ public class JoinSelectStatisticsTest {
for (int j = 1; j < 3; j++) {
k = 1;
for (String s : aggCardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + uri + j + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + iri + j + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + k +j).toString().getBytes()));
bw_table2.addMutation(m);
k++;
@@ -665,7 +665,7 @@ public class JoinSelectStatisticsTest {
Scanner scan1 = c.createScanner("rya_selectivity" , new Authorizations());
- scan1.setRange(Range.prefix("subject" +DELIM + uri + 1));
+ scan1.setRange(Range.prefix("subject" +DELIM + iri + 1));
int i = 0;
for (Map.Entry<Key, Value> entry : scan1) {
@@ -722,7 +722,7 @@ public class JoinSelectStatisticsTest {
break;
}
- RyaStatement rs = new RyaStatement(new RyaURI(uri + i), new RyaURI(uri + (j)), new RyaType(uri + k));
+ RyaStatement rs = new RyaStatement(new RyaIRI(iri + i), new RyaIRI(iri + (j)), new RyaType(iri + k));
Map<TABLE_LAYOUT, TripleRow> tripleRowMap = ryaContext.serializeTriple(rs);
TripleRow tripleRow = tripleRowMap.get(TABLE_LAYOUT.SPO);
Mutation m = JoinSelectStatsUtil.createMutation(tripleRow);
@@ -739,7 +739,7 @@ public class JoinSelectStatisticsTest {
int k = 1;
for (String s : cardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + k).toString().getBytes()));
bw_table2.addMutation(m);
k++;
@@ -748,7 +748,7 @@ public class JoinSelectStatisticsTest {
for (int j = 1; j < 3; j++) {
k = 1;
for (String s : aggCardList) {
- Mutation m = new Mutation(new Text(s + DELIM + uri + i + DELIM + uri + j + DELIM + i));
+ Mutation m = new Mutation(new Text(s + DELIM + iri + i + DELIM + iri + j + DELIM + i));
m.put(new Text(), new Text(), new Value(new IntWritable(i + k + 2*j).toString().getBytes()));
bw_table2.addMutation(m);
k++;
@@ -775,7 +775,7 @@ public class JoinSelectStatisticsTest {
Scanner scan1 = c.createScanner("rya_selectivity" , new Authorizations());
- scan1.setRange(Range.prefix("subject" +DELIM + uri + 1));
+ scan1.setRange(Range.prefix("subject" +DELIM + iri + 1));
int i = 0;
for (Map.Entry<Key, Value> entry : scan1) {
@@ -810,7 +810,7 @@ public class JoinSelectStatisticsTest {
Scanner scan2 = c.createScanner("rya_selectivity" , new Authorizations());
- scan2.setRange(Range.prefix("predicate" +DELIM + uri + 1));
+ scan2.setRange(Range.prefix("predicate" +DELIM + iri + 1));
int j = 0;
for (Map.Entry<Key, Value> entry : scan2) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
index 96f2685..06e5005 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
@@ -40,7 +40,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.prospector.domain.IndexEntry;
import org.apache.rya.prospector.domain.TripleValueType;
import org.apache.rya.prospector.service.ProspectorService;
@@ -73,11 +73,11 @@ public class ProspectorTest {
ryaDAO.setConnector(connector);
ryaDAO.init();
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata1")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata2")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred1"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata2")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred1"), new RyaType("12")));
final String confFile = "stats_cluster_config.xml";
final Path confPath = new Path(getClass().getClassLoader().getResource(confFile).toString());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
index b94ed8d..21e3e8f 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
@@ -39,7 +39,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.api.persist.RdfEvalStatsDAO.CARDINALITY_OF;
import org.apache.rya.prospector.mr.Prospector;
@@ -73,11 +73,11 @@ public class ProspectorServiceEvalStatsDAOTest {
ryaDAO.setConnector(connector);
ryaDAO.init();
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata1")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata2")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred1"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata2")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred1"), new RyaType("12")));
final String confFile = "stats_cluster_config.xml";
final Path confPath = new Path(getClass().getClassLoader().getResource(confFile).toString());
@@ -130,11 +130,11 @@ public class ProspectorServiceEvalStatsDAOTest {
ryaDAO.setConnector(connector);
ryaDAO.init();
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata1")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata2")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:gem:etype#1235"), new RyaURI("urn:gem#pred1"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata2")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred"), new RyaType(XMLSchema.INTEGER, "12")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:gem:etype#1235"), new RyaIRI("urn:gem#pred1"), new RyaType("12")));
final String confFile = "stats_cluster_config.xml";
final Path confPath = new Path(getClass().getClassLoader().getResource(confFile).toString());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
index 921d0cf..67157cf 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
@@ -112,7 +112,7 @@ public class LocalReasoner extends AbstractReasoner {
}
// Otherwise, consider the semantics of the statement:
Resource subject = fact.getSubject();
- IRI predURI = fact.getPredicate();
+ IRI predIRI = fact.getPredicate();
Value object = fact.getObject();
boolean relevantToSubject = false;
boolean relevantToObject = false;
@@ -121,18 +121,18 @@ public class LocalReasoner extends AbstractReasoner {
// Type statements could be relevant to the subject, if the schema gives
// them any meaning:
- if (predURI.equals(RDF.TYPE)) {
+ if (predIRI.equals(RDF.TYPE)) {
// Assume the object is a valid URI
- Resource typeURI = (Resource) fact.getObject();
- if (typeURI.equals(OWL.NOTHING)
- || schema.hasClass(typeURI)) {
+ Resource typeIRI = (Resource) fact.getObject();
+ if (typeIRI.equals(OWL.NOTHING)
+ || schema.hasClass(typeIRI)) {
relevantToSubject = true;
}
}
// If the schema knows about the property:
- if (schema.hasProperty(predURI)) {
- OwlProperty prop = schema.getProperty(predURI);
+ if (schema.hasProperty(predIRI)) {
+ OwlProperty prop = schema.getProperty(predIRI);
// Relevant to both:
// Any statement with an asymmetric property
@@ -185,7 +185,7 @@ public class LocalReasoner extends AbstractReasoner {
return Relevance.NONE;
}
// Otherwise, consider the semantics of the statement:
- IRI predURI = fact.getPredicate();
+ IRI predIRI = fact.getPredicate();
Value object = fact.getObject();
boolean relevantToSubject = false;
boolean relevantToObject = false;
@@ -193,10 +193,10 @@ public class LocalReasoner extends AbstractReasoner {
boolean literalObject = object instanceof Literal;
// Type statements can be joined if...
- if (predURI.equals(RDF.TYPE)) {
- Resource typeURI = (Resource) fact.getObject();
- if (schema.hasClass(typeURI)) {
- OwlClass c = schema.getClass(typeURI);
+ if (predIRI.equals(RDF.TYPE)) {
+ Resource typeIRI = (Resource) fact.getObject();
+ if (schema.hasClass(typeIRI)) {
+ OwlClass c = schema.getClass(typeIRI);
// 1. the type is a property restriction
if (!c.getOnProperty().isEmpty()
// 2. the type is relevant to a property restriction
@@ -212,8 +212,8 @@ public class LocalReasoner extends AbstractReasoner {
}
// If the schema knows about the property:
- if (schema.hasProperty(predURI)) {
- OwlProperty prop = schema.getProperty(predURI);
+ if (schema.hasProperty(predIRI)) {
+ OwlProperty prop = schema.getProperty(predIRI);
// transitivity: relevant to both
if (prop.isTransitive()) {
relevantToSubject = true;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
index c3c60a8..364be52 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
@@ -56,7 +56,7 @@ import org.eclipse.rdf4j.model.vocabulary.OWL;
*/
public class OwlClass implements Serializable {
private static final long serialVersionUID = 1L;
- private Resource uri;
+ private Resource iri;
// Relations to other classes:
private Set<OwlClass> superClasses = new HashSet<>();
@@ -78,12 +78,12 @@ public class OwlClass implements Serializable {
int maxCardinality = -1;
int maxQualifiedCardinality = -1;
- OwlClass(Resource uri) {
- this.uri = uri;
+ OwlClass(Resource iri) {
+ this.iri = iri;
}
- public Resource getURI() { return uri; }
- public void setURI(Resource uri) { this.uri = uri; }
+ public Resource getURI() { return iri; }
+ public void setURI(Resource iri) { this.iri = iri; }
/**
* Add a superclass
@@ -235,10 +235,10 @@ public class OwlClass implements Serializable {
public Set<Resource> getSuperClasses() {
Set<Resource> ancestors = new HashSet<>();
for (OwlClass ancestor : superClasses) {
- ancestors.add(ancestor.uri);
+ ancestors.add(ancestor.iri);
}
// RL rule scm-cls: Every class is a subclass of itself and owl:Thing
- ancestors.add(this.uri);
+ ancestors.add(this.iri);
ancestors.add(OWL.THING);
return ancestors;
}
@@ -252,11 +252,11 @@ public class OwlClass implements Serializable {
Set<Resource> equivalents = new HashSet<>();
for (OwlClass other : superClasses) {
if (other.superClasses.contains(this)) {
- equivalents.add(other.uri);
+ equivalents.add(other.iri);
}
}
// RL rule scm-cls: Every class is its own equivalent
- equivalents.add(this.uri);
+ equivalents.add(this.iri);
return equivalents;
}
@@ -266,7 +266,7 @@ public class OwlClass implements Serializable {
public Set<Resource> getDisjointClasses() {
Set<Resource> disjoint = new HashSet<>();
for (OwlClass other : disjointClasses) {
- disjoint.add(other.uri);
+ disjoint.add(other.iri);
}
return disjoint;
}
@@ -277,7 +277,7 @@ public class OwlClass implements Serializable {
public Set<Resource> getComplementaryClasses() {
Set<Resource> complements = new HashSet<>();
for (OwlClass other : complementaryClasses) {
- complements.add(other.uri);
+ complements.add(other.iri);
}
return complements;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
index e745532..426a228 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
@@ -65,7 +65,7 @@ import org.eclipse.rdf4j.model.Resource;
public class OwlProperty implements Serializable {
private static final long serialVersionUID = 1L;
- private IRI uri;
+ private IRI iri;
// Boolean qualities the property might have
private boolean transitive = false;
@@ -87,8 +87,8 @@ public class OwlProperty implements Serializable {
// Restrictions on this property
private Set<OwlClass> restrictions = new HashSet<OwlClass>();
- OwlProperty(IRI uri) {
- this.uri = uri;
+ OwlProperty(IRI iri) {
+ this.iri = iri;
}
boolean addSuperProperty(OwlProperty p) {
@@ -115,7 +115,7 @@ public class OwlProperty implements Serializable {
}
boolean addRestriction(OwlClass r) { return restrictions.add(r); }
- public void setURI(IRI uri) { this.uri = uri; }
+ public void setURI(IRI iri) { this.iri = iri; }
void setTransitive() { transitive = true; }
void setSymmetric() { symmetric = true; }
void setAsymmetric() { asymmetric = true; }
@@ -123,7 +123,7 @@ public class OwlProperty implements Serializable {
void setInverseFunctional() { inverseFunctional = true; }
void setIrreflexive() { irreflexive = true; }
- public IRI getURI() { return uri; }
+ public IRI getURI() { return iri; }
public boolean isTransitive() { return transitive; }
public boolean isSymmetric() { return symmetric; }
public boolean isAsymmetric() { return asymmetric; }
@@ -188,10 +188,10 @@ public class OwlProperty implements Serializable {
public Set<IRI> getSuperProperties() {
Set<IRI> ancestors = new HashSet<>();
for (OwlProperty ancestor : superProperties) {
- ancestors.add(ancestor.uri);
+ ancestors.add(ancestor.iri);
}
// RL rules scm-op & scm-dp: Every property is a subproperty of itself
- ancestors.add(this.uri);
+ ancestors.add(this.iri);
return ancestors;
}
@@ -203,11 +203,11 @@ public class OwlProperty implements Serializable {
Set<IRI> equivalents = new HashSet<>();
for (OwlProperty other : superProperties) {
if (other.superProperties.contains(this)) {
- equivalents.add(other.uri);
+ equivalents.add(other.iri);
}
}
// RL rules scm-op & scm-dp: Every property is equivalent to itself
- equivalents.add(this.uri);
+ equivalents.add(this.iri);
return equivalents;
}
@@ -217,7 +217,7 @@ public class OwlProperty implements Serializable {
public Set<IRI> getDisjointProperties() {
Set<IRI> disjoint = new HashSet<>();
for (OwlProperty other : disjointProperties) {
- disjoint.add(other.uri);
+ disjoint.add(other.iri);
}
return disjoint;
}
@@ -228,13 +228,13 @@ public class OwlProperty implements Serializable {
public Set<IRI> getInverseProperties() {
Set<IRI> inverse = new HashSet<>();
for (OwlProperty other : inverseProperties) {
- inverse.add(other.uri);
+ inverse.add(other.iri);
}
return inverse;
}
/**
- * Get the domain (set of class URIs/Resources).
+ * Get the domain (set of class IRIs/Resources).
*/
public Set<Resource> getDomain() {
Set<Resource> domain = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
index 87f1c8b..d3c6bcb 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
@@ -87,7 +87,7 @@ public class ConformanceTest extends Configured implements Tool {
static String TEST_RDFBASED = TEST + "RDF-BASED";
private static class OwlTest extends AbstractRDFHandler {
- Value uri;
+ Value iri;
String name;
String description;
String premise;
@@ -211,7 +211,7 @@ public class ConformanceTest extends Configured implements Tool {
// Run the conformance tests
int result;
for (final OwlTest test : conformanceTests) {
- System.out.println(test.uri);
+ System.out.println(test.iri);
result = runTest(conf, args, test);
if (result != 0) {
return result;
@@ -386,7 +386,7 @@ public class ConformanceTest extends Configured implements Tool {
}
else {
test = new OwlTest();
- test.uri = iri;
+ test.iri = iri;
test.name = bindings.getValue("name").stringValue();
test.description = bindings.getValue("description").stringValue();
test.premise = bindings.getValue("graph").stringValue();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
index bec124b..2a2c90f 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
@@ -20,7 +20,7 @@ package org.apache.rya.reasoning;
*/
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.BNode;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Literal;
@@ -72,7 +72,7 @@ public class TestUtils {
}
public static RyaStatement ryaStatement(String s, String p, String o) {
- return new RyaStatement(new RyaURI(TEST_PREFIX + "#" + s),
- new RyaURI(TEST_PREFIX + "#" + p), new RyaURI(TEST_PREFIX + "#" + o));
+ return new RyaStatement(new RyaIRI(TEST_PREFIX + "#" + s),
+ new RyaIRI(TEST_PREFIX + "#" + p), new RyaIRI(TEST_PREFIX + "#" + o));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
index 15c33ee..680c095 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
@@ -30,7 +30,7 @@ import java.util.UUID;
import org.apache.kafka.streams.processor.TopologyBuilder;
import org.apache.rya.api.function.projection.RandomUUIDFactory;
-import org.apache.rya.api.function.temporal.TemporalURIs;
+import org.apache.rya.api.function.temporal.TemporalIRIs;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.VisibilityStatement;
import org.apache.rya.streams.kafka.KafkaTopics;
@@ -89,7 +89,7 @@ public class TemporalFilterIT {
// Get the RDF model objects that will be used to build the query.
final String sparql =
"PREFIX time: <http://www.w3.org/2006/time/> \n"
- + "PREFIX tempf: <" + TemporalURIs.NAMESPACE + ">\n"
+ + "PREFIX tempf: <" + TemporalIRIs.NAMESPACE + ">\n"
+ "SELECT * \n"
+ "WHERE { \n"
+ " <urn:time> time:atTime ?date .\n"
@@ -122,7 +122,7 @@ public class TemporalFilterIT {
// Get the RDF model objects that will be used to build the query.
final String sparql =
"PREFIX time: <http://www.w3.org/2006/time/> \n"
- + "PREFIX tempf: <" + TemporalURIs.NAMESPACE + ">\n"
+ + "PREFIX tempf: <" + TemporalIRIs.NAMESPACE + ">\n"
+ "SELECT * \n"
+ "WHERE { \n"
+ " <urn:time> time:atTime ?date .\n"
@@ -155,7 +155,7 @@ public class TemporalFilterIT {
// Get the RDF model objects that will be used to build the query.
final String sparql =
"PREFIX time: <http://www.w3.org/2006/time/> \n"
- + "PREFIX tempf: <" + TemporalURIs.NAMESPACE + ">\n"
+ + "PREFIX tempf: <" + TemporalIRIs.NAMESPACE + ">\n"
+ "SELECT * \n"
+ "WHERE { \n"
+ " <urn:time> time:atTime ?date .\n"
@@ -188,7 +188,7 @@ public class TemporalFilterIT {
// Get the RDF model objects that will be used to build the query.
final String sparql =
"PREFIX time: <http://www.w3.org/2006/time/> \n"
- + "PREFIX tempf: <" + TemporalURIs.NAMESPACE + ">\n"
+ + "PREFIX tempf: <" + TemporalIRIs.NAMESPACE + ">\n"
+ "SELECT * \n"
+ "WHERE { \n"
+ " <urn:time> time:atTime ?date .\n"
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/main/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormat.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormat.java
index eac06c6..1670e23 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormat.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormat.java
@@ -186,9 +186,9 @@ public class GraphXEdgeInputFormat extends InputFormatBase<Object, Edge> {
}
public static long getVertexId(final RyaType resource) throws IOException {
- String uri = "";
+ String iri = "";
if (resource != null) {
- uri = resource.getData().toString();
+ iri = resource.getData().toString();
}
try {
// SHA-256 the string value and then generate a hashcode from
@@ -197,7 +197,7 @@ public class GraphXEdgeInputFormat extends InputFormatBase<Object, Edge> {
// collision ratio
final MessageDigest messageDigest = MessageDigest
.getInstance("SHA-256");
- messageDigest.update(uri.getBytes(StandardCharsets.UTF_8));
+ messageDigest.update(iri.getBytes(StandardCharsets.UTF_8));
final String encryptedString = new String(messageDigest.digest(), StandardCharsets.UTF_8);
return hash(encryptedString);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
index 0dd08b1..6d964ea 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
@@ -52,7 +52,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
@@ -301,7 +301,7 @@ public class RyaOutputFormat extends OutputFormat<Writable, RyaStatementWritable
private final RyaTripleContext tripleContext;
private MultiTableBatchWriter writer;
private byte[] cv = AccumuloRdfConstants.EMPTY_CV.getExpression();
- private RyaURI defaultContext = null;
+ private RyaIRI defaultContext = null;
private static final long ONE_MEGABYTE = 1024L * 1024L;
private static final long AVE_STATEMENT_SIZE = 100L;
@@ -336,7 +336,7 @@ public class RyaOutputFormat extends OutputFormat<Writable, RyaStatementWritable
// set the default context
final String context = conf.get(CONTEXT_PROPERTY, "");
if (context != null && !context.isEmpty()) {
- defaultContext = new RyaURI(context);
+ defaultContext = new RyaIRI(context);
}
// set up the buffer
@@ -485,10 +485,10 @@ public class RyaOutputFormat extends OutputFormat<Writable, RyaStatementWritable
}
private int statementSize(final RyaStatement ryaStatement) {
- final RyaURI subject = ryaStatement.getSubject();
- final RyaURI predicate = ryaStatement.getPredicate();
+ final RyaIRI subject = ryaStatement.getSubject();
+ final RyaIRI predicate = ryaStatement.getPredicate();
final RyaType object = ryaStatement.getObject();
- final RyaURI context = ryaStatement.getContext();
+ final RyaIRI context = ryaStatement.getContext();
int size = 3 + subject.getData().length() + predicate.getData().length() + object.getData().length();
if (!XMLSchema.ANYURI.equals(object.getDataType())) {
size += 2 + object.getDataType().toString().length();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaStatementWritable.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaStatementWritable.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaStatementWritable.java
index 0e8f43d..37e8d95 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaStatementWritable.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaStatementWritable.java
@@ -38,7 +38,7 @@ import org.apache.rya.api.resolver.triple.TripleRowResolverException;
/**
* Basic {@link WritableComparable} for using Rya data with Hadoop.
* RyaStatementWritable wraps a {@link RyaStatement}, which in turn represents a
- * statement as a collection of {@link org.apache.rya.api.domain.RyaURI} and
+ * statement as a collection of {@link org.apache.rya.api.domain.RyaIRI} and
* {@link org.apache.rya.api.domain.RyaType} objects.
* <p>
* This class is mutable, like all {@link org.apache.hadoop.io.Writable}s. When
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
index 593e568..fa10237 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
@@ -46,7 +46,7 @@ import org.apache.rya.accumulo.mr.AbstractAccumuloMRTool;
import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.accumulo.mr.RyaStatementWritable;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.eclipse.rdf4j.model.Statement;
@@ -85,12 +85,12 @@ public class TextOutputExample extends AbstractAccumuloMRTool {
dao.setConf(conf);
dao.init();
String ns = "http://example.com/";
- dao.add(new RyaStatement(new RyaURI(ns+"s1"), new RyaURI(ns+"p1"), new RyaURI(ns+"o1")));
- dao.add(new RyaStatement(new RyaURI(ns+"s1"), new RyaURI(ns+"p2"), new RyaURI(ns+"o2")));
- dao.add(new RyaStatement(new RyaURI(ns+"s2"), new RyaURI(ns+"p1"), new RyaURI(ns+"o3"),
- new RyaURI(ns+"g1")));
- dao.add(new RyaStatement(new RyaURI(ns+"s3"), new RyaURI(ns+"p3"), new RyaURI(ns+"o3"),
- new RyaURI(ns+"g2")));
+ dao.add(new RyaStatement(new RyaIRI(ns+"s1"), new RyaIRI(ns+"p1"), new RyaIRI(ns+"o1")));
+ dao.add(new RyaStatement(new RyaIRI(ns+"s1"), new RyaIRI(ns+"p2"), new RyaIRI(ns+"o2")));
+ dao.add(new RyaStatement(new RyaIRI(ns+"s2"), new RyaIRI(ns+"p1"), new RyaIRI(ns+"o3"),
+ new RyaIRI(ns+"g1")));
+ dao.add(new RyaStatement(new RyaIRI(ns+"s3"), new RyaIRI(ns+"p3"), new RyaIRI(ns+"o3"),
+ new RyaIRI(ns+"g2")));
dao.destroy();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
index c2ad57a..5c68291 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
@@ -43,7 +43,7 @@ import org.apache.rya.accumulo.mr.AbstractAccumuloMRTool;
import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
@@ -152,7 +152,7 @@ public class AccumuloRdfCountTool extends AbstractAccumuloMRTool implements Tool
final String subj = statement.getSubject().getData();
final String pred = statement.getPredicate().getData();
// byte[] objBytes = tripleFormat.getValueFormat().serialize(statement.getObject());
- final RyaURI scontext = statement.getContext();
+ final RyaIRI scontext = statement.getContext();
final boolean includesContext = scontext != null;
final String scontext_str = (includesContext) ? scontext.getData() : null;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormatTest.java
index 6686c8f..0c9c06c 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXEdgeInputFormatTest.java
@@ -24,7 +24,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
@@ -78,9 +78,9 @@ public class GraphXEdgeInputFormatTest {
@Test
public void testInputFormat() throws Exception {
RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setColumnVisibility(new byte[0])
.setValue(new byte[0])
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXInputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXInputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXInputFormatTest.java
index b2a663c..93df522 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXInputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/GraphXInputFormatTest.java
@@ -25,7 +25,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.accumulo.mr.GraphXInputFormat.RyaStatementRecordReader;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
@@ -78,9 +78,9 @@ public class GraphXInputFormatTest {
@Test
public void testInputFormat() throws Exception {
RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setColumnVisibility(new byte[0])
.setValue(new byte[0])
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaInputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaInputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaInputFormatTest.java
index f571682..0c9763c 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaInputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaInputFormatTest.java
@@ -40,7 +40,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.accumulo.mr.RyaInputFormat.RyaStatementRecordReader;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -85,9 +85,9 @@ public class RyaInputFormatTest {
RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setColumnVisibility(new byte[0])
.setValue(new byte[0])
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
index e0a7ac0..a2691d6 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
@@ -23,7 +23,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
@@ -117,12 +117,12 @@ public class RyaOutputFormatTest {
@Test
public void testOutputFormat() throws Exception {
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setColumnVisibility(CV.getBytes())
.setValue(new byte[0])
- .setContext(new RyaURI(GRAPH))
+ .setContext(new RyaIRI(GRAPH))
.build();
RyaOutputFormat.setCoreTablesEnabled(job, true);
RyaOutputFormat.setFreeTextEnabled(job, false);
@@ -135,18 +135,18 @@ public class RyaOutputFormatTest {
@Test
public void testDefaultCV() throws Exception {
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setValue(new byte[0])
- .setContext(new RyaURI(GRAPH))
+ .setContext(new RyaIRI(GRAPH))
.build();
final RyaStatement expected = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setValue(new byte[0])
- .setContext(new RyaURI(GRAPH))
+ .setContext(new RyaIRI(GRAPH))
.setColumnVisibility(CV.getBytes())
.build();
RyaOutputFormat.setCoreTablesEnabled(job, true);
@@ -161,19 +161,19 @@ public class RyaOutputFormatTest {
@Test
public void testDefaultGraph() throws Exception {
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setValue(new byte[0])
.setColumnVisibility(CV.getBytes())
.build();
final RyaStatement expected = RyaStatement.builder()
- .setSubject(new RyaURI("http://www.google.com"))
- .setPredicate(new RyaURI("http://some_other_uri"))
- .setObject(new RyaURI("http://www.yahoo.com"))
+ .setSubject(new RyaIRI("http://www.google.com"))
+ .setPredicate(new RyaIRI("http://some_other_uri"))
+ .setObject(new RyaIRI("http://www.yahoo.com"))
.setValue(new byte[0])
.setColumnVisibility(CV.getBytes())
- .setContext(new RyaURI(GRAPH))
+ .setContext(new RyaIRI(GRAPH))
.build();
RyaOutputFormat.setCoreTablesEnabled(job, true);
RyaOutputFormat.setFreeTextEnabled(job, false);
@@ -189,8 +189,8 @@ public class RyaOutputFormatTest {
final AccumuloFreeTextIndexer ft = new AccumuloFreeTextIndexer();
ft.setConf(conf);
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI(GRAPH + ":s"))
- .setPredicate(new RyaURI(GRAPH + ":p"))
+ .setSubject(new RyaIRI(GRAPH + ":s"))
+ .setPredicate(new RyaIRI(GRAPH + ":p"))
.setObject(new RyaType(XMLSchema.STRING, "one two three four five"))
.build();
RyaOutputFormat.setCoreTablesEnabled(job, false);
@@ -227,8 +227,8 @@ public class RyaOutputFormatTest {
for (int i = 0; i < instants.length; i++) {
final RyaType time = RdfToRyaConversions.convertLiteral(vf.createLiteral(instants[i].toString()));
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI(GRAPH + ":s"))
- .setPredicate(new RyaURI(GRAPH + ":p"))
+ .setSubject(new RyaIRI(GRAPH + ":s"))
+ .setPredicate(new RyaIRI(GRAPH + ":p"))
.setObject(time)
.build();
write(input);
@@ -260,9 +260,9 @@ public class RyaOutputFormatTest {
final EntityCentricIndex entity = new EntityCentricIndex();
entity.setConf(conf);
final RyaStatement input = RyaStatement.builder()
- .setSubject(new RyaURI(GRAPH + ":s"))
- .setPredicate(new RyaURI(GRAPH + ":p"))
- .setObject(new RyaURI(GRAPH + ":o"))
+ .setSubject(new RyaIRI(GRAPH + ":s"))
+ .setPredicate(new RyaIRI(GRAPH + ":p"))
+ .setObject(new RyaIRI(GRAPH + ":o"))
.build();
RyaOutputFormat.setCoreTablesEnabled(job, false);
RyaOutputFormat.setFreeTextEnabled(job, false);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
index 98d36c9..fc0ee4d 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
@@ -8,7 +8,7 @@ import java.io.DataOutputStream;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Assert;
@@ -36,14 +36,14 @@ import org.junit.rules.ExpectedException;
*/
public class RyaStatementWritableTest {
- private static final RyaURI s1 = new RyaURI(":s");
- private static final RyaURI p1 = new RyaURI(":p");
+ private static final RyaIRI s1 = new RyaIRI(":s");
+ private static final RyaIRI p1 = new RyaIRI(":p");
private static final RyaType o1 = new RyaType(XMLSchema.INTEGER, "123");
- private static final RyaURI s2 = new RyaURI(":s2");
- private static final RyaURI p2 = new RyaURI(":p2");
+ private static final RyaIRI s2 = new RyaIRI(":s2");
+ private static final RyaIRI p2 = new RyaIRI(":p2");
private static final RyaType o2 = new RyaType(XMLSchema.STRING, "123");
- private static final RyaURI graph1 = new RyaURI("http://example.org/graph1");
- private static final RyaURI graph2 = new RyaURI("http://example.org/graph2");
+ private static final RyaIRI graph1 = new RyaIRI("http://example.org/graph1");
+ private static final RyaIRI graph2 = new RyaIRI("http://example.org/graph2");
private static final byte[] cv1 = "test_visibility".getBytes();
private static final long t1 = 1000;
private static final long t2 = 1001;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
index ae15b65..7f49ac5 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
@@ -40,7 +40,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
@@ -105,8 +105,8 @@ public class AccumuloRdfCountToolTest {
@Test
public void testMR() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
+ RyaIRI test1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "test1"));
+ RyaIRI pred1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "pred1"));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0))));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1))));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2))));
@@ -197,8 +197,8 @@ public class AccumuloRdfCountToolTest {
@Test
public void testTTL() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
+ RyaIRI test1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "test1"));
+ RyaIRI pred1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "pred1"));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0))));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1))));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2))));
@@ -231,9 +231,9 @@ public class AccumuloRdfCountToolTest {
@Test
public void testContext() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
- RyaURI cntxt = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cntxt"));
+ RyaIRI test1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "test1"));
+ RyaIRI pred1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "pred1"));
+ RyaIRI cntxt = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "cntxt"));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0)), cntxt));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1)), cntxt));
dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2)), cntxt));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
index b8b2384..8f92cf1 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
@@ -31,7 +31,7 @@ import org.apache.rya.accumulo.mr.TestUtils;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Test;
@@ -93,9 +93,9 @@ public class RdfFileInputToolTest extends TestCase {
"-Drdf.format=" + RDFFormat.NTRIPLES.getName(),
"src/test/resources/test.ntriples",
});
- RyaStatement rs = new RyaStatement(new RyaURI("urn:lubm:rdfts#GraduateStudent01"),
- new RyaURI("urn:lubm:rdfts#hasFriend"),
- new RyaURI("urn:lubm:rdfts#GraduateStudent02"));
+ RyaStatement rs = new RyaStatement(new RyaIRI("urn:lubm:rdfts#GraduateStudent01"),
+ new RyaIRI("urn:lubm:rdfts#hasFriend"),
+ new RyaIRI("urn:lubm:rdfts#GraduateStudent02"));
rs.setColumnVisibility(auths.toString().getBytes());
AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix(tablePrefix);
@@ -116,10 +116,10 @@ public class RdfFileInputToolTest extends TestCase {
"-Drdf.format=" + RDFFormat.TRIG.getName(),
"src/test/resources/namedgraphs.trig",
});
- RyaStatement rs = new RyaStatement(new RyaURI("http://www.example.org/exampleDocument#Monica"),
- new RyaURI("http://www.example.org/vocabulary#name"),
+ RyaStatement rs = new RyaStatement(new RyaIRI("http://www.example.org/exampleDocument#Monica"),
+ new RyaIRI("http://www.example.org/vocabulary#name"),
new RyaType("Monica Murphy"),
- new RyaURI("http://www.example.org/exampleDocument#G1"));
+ new RyaIRI("http://www.example.org/exampleDocument#G1"));
rs.setColumnVisibility(auths.toString().getBytes());
AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
conf.setTablePrefix(tablePrefix);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
index cfdbeb7..eed87af 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
@@ -41,7 +41,7 @@ import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import junit.framework.TestCase;
@@ -219,41 +219,41 @@ public class Upgrade322ToolTest extends TestCase {
final AccumuloRyaQueryEngine queryEngine = ryaDAO.getQueryEngine();
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#booleanLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#booleanLit"),
new RyaType(XMLSchema.BOOLEAN, "true")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#longLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#longLit"),
new RyaType(XMLSchema.LONG, "10")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#intLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#intLit"),
new RyaType(XMLSchema.INTEGER, "10")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#byteLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#byteLit"),
new RyaType(XMLSchema.BYTE, "10")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#doubleLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#doubleLit"),
new RyaType(XMLSchema.DOUBLE, "10.0")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#dateLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#dateLit"),
new RyaType(XMLSchema.DATETIME, "2011-07-12T06:00:00.000Z")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#stringLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#stringLit"),
new RyaType("stringLit")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uuid10"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns#uriLit"),
- new RyaURI("http://here/2010/tracked-data-provenance/ns" +
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uuid10"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns#uriLit"),
+ new RyaIRI("http://here/2010/tracked-data-provenance/ns" +
"#objectuuid1")), queryEngine);
TestUtils.verify(new RyaStatement(
- new RyaURI("urn:org.apache.rya/2012/05#rts"),
- new RyaURI("urn:org.apache.rya/2012/05#version"),
+ new RyaIRI("urn:org.apache.rya/2012/05#rts"),
+ new RyaIRI("urn:org.apache.rya/2012/05#version"),
new RyaType("3.0.0")), queryEngine);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
index 0837e5c..7c87de7 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
@@ -41,7 +41,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.query.strategy.TriplePatternStrategy;
@@ -190,8 +190,8 @@ public class StatementPatternStorage extends AccumuloStorage {
}
protected Map.Entry<TABLE_LAYOUT, Range> createRange(Value s_v, Value p_v, Value o_v) throws IOException {
- RyaURI subject_rya = RdfToRyaConversions.convertResource((Resource) s_v);
- RyaURI predicate_rya = RdfToRyaConversions.convertURI((IRI) p_v);
+ RyaIRI subject_rya = RdfToRyaConversions.convertResource((Resource) s_v);
+ RyaIRI predicate_rya = RdfToRyaConversions.convertIRI((IRI) p_v);
RyaType object_rya = RdfToRyaConversions.convertValue(o_v);
TriplePatternStrategy strategy = ryaContext.retrieveStrategy(subject_rya, predicate_rya, object_rya, null);
if (strategy == null) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
index eb40df9..942510b 100644
--- a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
+++ b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
@@ -43,7 +43,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import junit.framework.TestCase;
@@ -98,9 +98,9 @@ public class StatementPatternStorageTest extends TestCase {
}
public void testSimplePredicateRange() throws Exception {
- ryaDAO.add(new RyaStatement(new RyaURI(namespace, "a"),new RyaURI(namespace,"p"), new RyaType("l")));
- ryaDAO.add(new RyaStatement(new RyaURI(namespace, "b"), new RyaURI(namespace, "p"), new RyaType("l")));
- ryaDAO.add(new RyaStatement(new RyaURI(namespace, "c"), new RyaURI(namespace, "n"), new RyaType("l")));
+ ryaDAO.add(new RyaStatement(new RyaIRI(namespace, "a"),new RyaIRI(namespace,"p"), new RyaType("l")));
+ ryaDAO.add(new RyaStatement(new RyaIRI(namespace, "b"), new RyaIRI(namespace, "p"), new RyaType("l")));
+ ryaDAO.add(new RyaStatement(new RyaIRI(namespace, "c"), new RyaIRI(namespace, "n"), new RyaType("l")));
int count = 0;
@@ -119,8 +119,8 @@ public class StatementPatternStorageTest extends TestCase {
}
public void testContext() throws Exception {
- ryaDAO.add(new RyaStatement(new RyaURI(namespace, "a"), new RyaURI(namespace, "p"), new RyaType("l1")));
- ryaDAO.add(new RyaStatement(new RyaURI(namespace, "a"), new RyaURI(namespace, "p"), new RyaType("l2"), new RyaURI(namespace, "g1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI(namespace, "a"), new RyaIRI(namespace, "p"), new RyaType("l1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI(namespace, "a"), new RyaIRI(namespace, "p"), new RyaType("l2"), new RyaIRI(namespace, "g1")));
int count = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
index e582321..ae97fd8 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
@@ -34,7 +34,7 @@ import org.apache.hadoop.conf.Configurable;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.api.persist.RyaDAO;
@@ -158,7 +158,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
for (final Resource context : contexts) {
final RyaStatement statement = new RyaStatement(
RdfToRyaConversions.convertResource(subject),
- RdfToRyaConversions.convertURI(predicate),
+ RdfToRyaConversions.convertIRI(predicate),
RdfToRyaConversions.convertValue(object),
RdfToRyaConversions.convertResource(context),
null, new StatementMetadata(), cv);
@@ -168,7 +168,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
} else {
final RyaStatement statement = new RyaStatement(
RdfToRyaConversions.convertResource(subject),
- RdfToRyaConversions.convertURI(predicate),
+ RdfToRyaConversions.convertIRI(predicate),
RdfToRyaConversions.convertValue(object),
null, null, new StatementMetadata(), cv);
@@ -186,7 +186,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
@Override
protected void clearInternal(final Resource... aresource) throws SailException {
try {
- final RyaURI[] graphs = new RyaURI[aresource.length];
+ final RyaIRI[] graphs = new RyaIRI[aresource.length];
for (int i = 0 ; i < graphs.length ; i++){
graphs[i] = RdfToRyaConversions.convertResource(aresource[i]);
}
@@ -565,7 +565,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
}
final RyaStatement statement = new RyaStatement(
RdfToRyaConversions.convertResource(subject),
- RdfToRyaConversions.convertURI(predicate),
+ RdfToRyaConversions.convertIRI(predicate),
RdfToRyaConversions.convertValue(object),
RdfToRyaConversions.convertResource(context));
@@ -574,7 +574,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
} else {
final RyaStatement statement = new RyaStatement(
RdfToRyaConversions.convertResource(subject),
- RdfToRyaConversions.convertURI(predicate),
+ RdfToRyaConversions.convertIRI(predicate),
RdfToRyaConversions.convertValue(object),
null);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
index 6b049b9..e6abb09 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
@@ -25,7 +25,7 @@ import java.util.List;
import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.RangeURI;
+import org.apache.rya.api.domain.RangeIRI;
import org.apache.rya.api.domain.RangeValue;
import org.eclipse.rdf4j.model.Value;
import org.eclipse.rdf4j.model.impl.BooleanLiteral;
@@ -87,10 +87,10 @@ public class FilterRangeVisitor extends AbstractQueryModelVisitor<Exception> {
final Var objVar = node.getObjectVar();
final RangeValue objRange = rangeValues.get(objVar);
if(subjRange != null) {
- subjectVar.setValue(new RangeURI(subjRange));//Assumes no blank nodes can be ranges
+ subjectVar.setValue(new RangeIRI(subjRange));//Assumes no blank nodes can be ranges
}
if(predRange != null) {
- predVar.setValue(new RangeURI(predRange));
+ predVar.setValue(new RangeIRI(predRange));
}
if(objRange != null) {
objVar.setValue(objRange);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
index 0bcbc6b..974f4df 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
@@ -94,8 +94,8 @@ public class HasValueVisitor extends AbstractInferVisitor {
// { ?var rdf:type :Restriction } and { ?var :property ?value }
// Both require defined predicate
if (predVar != null && predVar.getValue() != null) {
- final IRI predURI = (IRI) predVar.getValue();
- if (RDF.TYPE.equals(predURI) && objVar != null && objVar.getValue() != null
+ final IRI predIRI = (IRI) predVar.getValue();
+ if (RDF.TYPE.equals(predIRI) && objVar != null && objVar.getValue() != null
&& objVar.getValue() instanceof Resource) {
// If the predicate is rdf:type and the type is specified, check whether it can be
// inferred using any hasValue restriction(s)
@@ -119,7 +119,7 @@ public class HasValueVisitor extends AbstractInferVisitor {
else {
// If the predicate has some hasValue restriction associated with it, then finding
// that the object belongs to the appropriate type implies a value.
- final Map<Resource, Set<Value>> impliedValues = inferenceEngine.getHasValueByProperty(predURI);
+ final Map<Resource, Set<Value>> impliedValues = inferenceEngine.getHasValueByProperty(predIRI);
if (impliedValues.size() > 0) {
final Var rdfTypeVar = new Var(RDF.TYPE.stringValue(), RDF.TYPE);
final Var typeVar = new Var("t-" + UUID.randomUUID());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
index ada151a..9da1c4a 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
@@ -358,7 +358,7 @@ public class InferenceEngine {
null, conf);
String integerValue = "";
Value anonPropNode = null;
- Value propURI = null;
+ Value propIRI = null;
if (iter2 != null){
while (iter2.hasNext()){
final Statement iter2Statement = iter2.next();
@@ -381,17 +381,17 @@ public class InferenceEngine {
null, conf);
while (iter2.hasNext()){
final Statement iter2Statement = iter2.next();
- propURI = iter2Statement.getObject();
+ propIRI = iter2Statement.getObject();
break;
}
iter2.close();
}
}
- if (!integerValue.isEmpty() && propURI!=null) {
+ if (!integerValue.isEmpty() && propIRI!=null) {
try {
final int indexValue = Integer.parseInt(integerValue);
- final IRI chainPropURI = VF.createIRI(propURI.stringValue());
- orderedProperties.put(indexValue, chainPropURI);
+ final IRI chainPropIRI = VF.createIRI(propIRI.stringValue());
+ orderedProperties.put(indexValue, chainPropIRI);
}
catch (final Exception e){
log.error("Error adding chain property to ordered properties", e);
@@ -440,7 +440,7 @@ public class InferenceEngine {
if (iter2.hasNext()){
iter2Statement = iter2.next();
if (iter2Statement.getObject() instanceof IRI){
- properties.add(new InverseURI((IRI)iter2Statement.getObject()));
+ properties.add(new InverseIRI((IRI)iter2Statement.getObject()));
}
}
}
@@ -918,7 +918,7 @@ public class InferenceEngine {
* have this property are also assumed to have the property.
*
* @param type
- * The type (URI or bnode) to check against the known
+ * The type (IRI or bnode) to check against the known
* restrictions
* @return For each relevant property, a set of values such that whenever a
* resource has that value for that property, it is implied to
@@ -1407,7 +1407,7 @@ public class InferenceEngine {
* one is considered individually sufficient: if a resource has the property and the value, then
* it belongs to the provided type. Takes type hierarchy into account, so the value may imply a
* subtype which in turn implies the provided type.
- * @param type The type (URI or bnode) to check against the known restrictions
+ * @param type The type (IRI or bnode) to check against the known restrictions
* @return For each relevant property, a set of values such that whenever a resource has that
* value for that property, it is implied to belong to the type.
*/
@@ -1597,7 +1597,7 @@ public class InferenceEngine {
* restrictions on those properties could imply this type. A type can have
* multiple intersections and each intersection is a set of types so a list
* of all the type sets is returned.
- * @param type The type (URI or bnode) to check against the known
+ * @param type The type (IRI or bnode) to check against the known
* intersections.
* @return A {@link List} of {@link Resource} type {@link Set}s that
* represents all the known intersections that imply the specified type.
@@ -1616,7 +1616,7 @@ public class InferenceEngine {
* For a given type, return all sets of types such that owl:oneOf
* restrictions on those properties could imply this type. A enumeration
* of all the types that are part of the specified class type.
- * @param type The type (URI or bnode) to check against the known oneOf
+ * @param type The type (IRI or bnode) to check against the known oneOf
* sets.
* @return A {@link Set} of {@link Resource} types that represents the
* enumeration of resources that belong to the class type.
@@ -1636,7 +1636,7 @@ public class InferenceEngine {
/**
* Checks if the specified type is an enumerated type.
- * @param type The type (URI or bnode) to check against the known oneOf
+ * @param type The type (IRI or bnode) to check against the known oneOf
* sets.
* @return {@code true} if the type is an enumerated type. {@code false}
* otherwise.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseIRI.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseIRI.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseIRI.java
new file mode 100644
index 0000000..ff083ff
--- /dev/null
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseIRI.java
@@ -0,0 +1,64 @@
+/*
+ * 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.rya.rdftriplestore.inference;
+
+import org.eclipse.rdf4j.model.IRI;
+
+public class InverseIRI implements IRI {
+ private static final long serialVersionUID = 1L;
+
+ private final IRI impl;
+
+ public InverseIRI(final IRI iri) {
+ this.impl = iri;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((impl == null) ? 0 : impl.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (obj instanceof InverseIRI){
+ return impl.equals(((InverseIRI) obj).impl);
+ }
+ return false;
+ }
+
+ @Override
+ public String stringValue() {
+ return impl.stringValue();
+ }
+
+ @Override
+ public String getNamespace() {
+ return impl.getNamespace();
+ }
+
+ @Override
+ public String getLocalName() {
+ return impl.getLocalName();
+ }
+
+
+}
[23/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetTest.java
index 2b14f6e..6bddd85 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.rya.indexing.external.tupleSet;
+import java.math.BigInteger;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.HashSet;
@@ -30,35 +31,6 @@ import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.hadoop.conf.Configuration;
-import org.apache.rya.indexing.pcj.storage.PcjException;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.SailException;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.persist.RyaDAOException;
@@ -66,9 +38,33 @@ import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.external.PcjIntegrationTestingUtil;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer;
+import org.apache.rya.indexing.pcj.storage.PcjException;
+import org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.SailException;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
public class AccumuloIndexSetTest {
@@ -77,6 +73,7 @@ public class AccumuloIndexSetTest {
protected RepositoryConnection ryaConn = null;
protected Configuration conf = getConf();
protected String prefix = "rya_";
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Before
public void init() throws AccumuloException, AccumuloSecurityException,
@@ -104,14 +101,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -128,7 +125,7 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
@@ -139,18 +136,18 @@ public class AccumuloIndexSetTest {
}
// Ensure the expected results match those that were stored.
final QueryBindingSet alice = new QueryBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final QueryBindingSet bob = new QueryBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final QueryBindingSet charlie = new QueryBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- final Set<BindingSet> expectedResults = Sets.<BindingSet>newHashSet(alice, bob, charlie);
+ final Set<BindingSet> expectedResults = Sets.newHashSet(alice, bob, charlie);
Assert.assertEquals(expectedResults, fetchedResults);
}
@@ -167,14 +164,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -192,17 +189,17 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("name",new URIImpl("http://Alice"));
- bs.addBinding("location",new URIImpl("http://Virginia"));
+ bs.addBinding("name",VF.createIRI("http://Alice"));
+ bs.addBinding("location",VF.createIRI("http://Virginia"));
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bs);
- bs.addBinding("age",new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ bs.addBinding("age",VF.createLiteral(BigInteger.valueOf(14)));
Assert.assertEquals(bs, results.next());
}
@@ -211,14 +208,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -236,31 +233,31 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("birthDate",new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs.addBinding("name",new URIImpl("http://Alice"));
+ bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs.addBinding("name",VF.createIRI("http://Alice"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("birthDate",new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs2.addBinding("name",new URIImpl("http://Bob"));
+ bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs2.addBinding("name",VF.createIRI("http://Bob"));
- final Set<BindingSet> bSets = Sets.<BindingSet>newHashSet(bs,bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
final QueryBindingSet alice = new QueryBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
- alice.addBinding("birthDate", new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
+ alice.addBinding("birthDate", VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
final QueryBindingSet bob = new QueryBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
- bob.addBinding("birthDate", new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
+ bob.addBinding("birthDate", VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
final Set<BindingSet> fetchedResults = new HashSet<>();
while(results.hasNext()) {
@@ -277,14 +274,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -302,7 +299,7 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
@@ -317,14 +314,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -342,29 +339,29 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("birthDate",new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs.addBinding("location",new URIImpl("http://Virginia"));
+ bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs.addBinding("location",VF.createIRI("http://Virginia"));
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bs);
final QueryBindingSet alice = new QueryBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
alice.addAll(bs);
final QueryBindingSet bob = new QueryBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
bob.addAll(bs);
final QueryBindingSet charlie = new QueryBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
charlie.addAll(bs);
final Set<BindingSet> fetchedResults = new HashSet<>();
@@ -380,14 +377,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -405,50 +402,50 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("birthDate",new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs.addBinding("location",new URIImpl("http://Virginia"));
+ bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs.addBinding("location",VF.createIRI("http://Virginia"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("birthDate",new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs2.addBinding("location",new URIImpl("http://Georgia"));
+ bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs2.addBinding("location",VF.createIRI("http://Georgia"));
- final Set<BindingSet> bSets = Sets.<BindingSet>newHashSet(bs,bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
final QueryBindingSet alice1 = new QueryBindingSet();
- alice1.addBinding("name", new URIImpl("http://Alice"));
- alice1.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice1.addBinding("name", VF.createIRI("http://Alice"));
+ alice1.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
alice1.addAll(bs);
final QueryBindingSet bob1 = new QueryBindingSet();
- bob1.addBinding("name", new URIImpl("http://Bob"));
- bob1.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob1.addBinding("name", VF.createIRI("http://Bob"));
+ bob1.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
bob1.addAll(bs);
final QueryBindingSet charlie1 = new QueryBindingSet();
- charlie1.addBinding("name", new URIImpl("http://Charlie"));
- charlie1.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie1.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie1.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
charlie1.addAll(bs);
final QueryBindingSet alice2 = new QueryBindingSet();
- alice2.addBinding("name", new URIImpl("http://Alice"));
- alice2.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice2.addBinding("name", VF.createIRI("http://Alice"));
+ alice2.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
alice2.addAll(bs2);
final QueryBindingSet bob2 = new QueryBindingSet();
- bob2.addBinding("name", new URIImpl("http://Bob"));
- bob2.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob2.addBinding("name", VF.createIRI("http://Bob"));
+ bob2.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
bob2.addAll(bs2);
final QueryBindingSet charlie2 = new QueryBindingSet();
- charlie2.addBinding("name", new URIImpl("http://Charlie"));
- charlie2.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie2.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie2.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
charlie2.addAll(bs2);
final Set<BindingSet> fetchedResults = new HashSet<>();
@@ -466,14 +463,14 @@ public class AccumuloIndexSetTest {
RyaTypeResolverException, MalformedQueryException, SailException, QueryEvaluationException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -491,7 +488,7 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final String sparql2 =
"SELECT ?x ?y " +
@@ -510,29 +507,29 @@ public class AccumuloIndexSetTest {
final AccumuloIndexSet ais = new AccumuloIndexSet(conf, pcjTableName);
ais.setProjectionExpr((Projection) pq.getTupleExpr());
ais.setTableVarMap(map);
- ais.setSupportedVariableOrderMap(Lists.<String>newArrayList("x;y","y;x"));
+ ais.setSupportedVariableOrderMap(Lists.newArrayList("x;y","y;x"));
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("birthDate",new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs.addBinding("x",new URIImpl("http://Alice"));
+ bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs.addBinding("x",VF.createIRI("http://Alice"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("birthDate",new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs2.addBinding("x",new URIImpl("http://Bob"));
+ bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs2.addBinding("x",VF.createIRI("http://Bob"));
- final Set<BindingSet> bSets = Sets.<BindingSet>newHashSet(bs,bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
final QueryBindingSet alice = new QueryBindingSet();
- alice.addBinding("x", new URIImpl("http://Alice"));
- alice.addBinding("y", new NumericLiteralImpl(14, XMLSchema.INTEGER));
- alice.addBinding("birthDate", new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
+ alice.addBinding("x", VF.createIRI("http://Alice"));
+ alice.addBinding("y", VF.createLiteral(BigInteger.valueOf(14)));
+ alice.addBinding("birthDate", VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
final QueryBindingSet bob = new QueryBindingSet();
- bob.addBinding("x", new URIImpl("http://Bob"));
- bob.addBinding("y", new NumericLiteralImpl(16, XMLSchema.INTEGER));
- bob.addBinding("birthDate", new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
+ bob.addBinding("x", VF.createIRI("http://Bob"));
+ bob.addBinding("y", VF.createLiteral(BigInteger.valueOf(16)));
+ bob.addBinding("birthDate", VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
final Set<BindingSet> fetchedResults = new HashSet<>();
@@ -549,14 +546,14 @@ public class AccumuloIndexSetTest {
public void accumuloIndexSetTestWithTwoDirectProductBindingSetsWithConstantMapping() throws Exception {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -573,7 +570,7 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final String sparql2 =
"SELECT ?x " +
@@ -590,14 +587,14 @@ public class AccumuloIndexSetTest {
ais.setProjectionExpr((Projection) QueryVariableNormalizer.getNormalizedIndex(pq2.getTupleExpr(), pq1.getTupleExpr()).get(0));
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("birthDate",new LiteralImpl("1983-03-17",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs.addBinding("x",new URIImpl("http://Alice"));
+ bs.addBinding("birthDate",VF.createLiteral("1983-03-17",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs.addBinding("x",VF.createIRI("http://Alice"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("birthDate",new LiteralImpl("1983-04-18",new URIImpl("http://www.w3.org/2001/XMLSchema#date")));
- bs2.addBinding("x",new URIImpl("http://Bob"));
+ bs2.addBinding("birthDate",VF.createLiteral("1983-04-18",VF.createIRI("http://www.w3.org/2001/XMLSchema#date")));
+ bs2.addBinding("x",VF.createIRI("http://Bob"));
- final Set<BindingSet> bSets = Sets.<BindingSet>newHashSet(bs,bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs,bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
@@ -611,13 +608,13 @@ public class AccumuloIndexSetTest {
}
@Test
- public void accumuloIndexSetTestAttemptJoinAccrossTypes() throws Exception {
+ public void accumuloIndexSetTestAttemptJoinAcrossTypes() throws Exception {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -634,15 +631,15 @@ public class AccumuloIndexSetTest {
final String pcjTableName = new PcjTableNameFactory().makeTableName(prefix, "testPcj");
// Create and populate the PCJ table.
- PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ PcjIntegrationTestingUtil.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
final AccumuloIndexSet ais = new AccumuloIndexSet(conf,pcjTableName);
final QueryBindingSet bs1 = new QueryBindingSet();
- bs1.addBinding("age",new LiteralImpl("16"));
+ bs1.addBinding("age", VF.createLiteral("16"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("age",new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ bs2.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
- final Set<BindingSet> bSets = Sets.<BindingSet>newHashSet(bs1,bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs1,bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
@@ -652,7 +649,7 @@ public class AccumuloIndexSetTest {
fetchedResults.add(next);
}
- bs2.addBinding("name", new URIImpl("http://Alice"));
+ bs2.addBinding("name", VF.createIRI("http://Alice"));
Assert.assertEquals(Sets.<BindingSet>newHashSet(bs2), fetchedResults);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
index cc260af..607c1ef 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtilTest.java
@@ -20,11 +20,11 @@ package org.apache.rya.indexing.external.tupleSet;
import static org.junit.Assert.assertTrue;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/QueryVariableNormalizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/QueryVariableNormalizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/QueryVariableNormalizerTest.java
index c191003..9c76f4d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/QueryVariableNormalizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/QueryVariableNormalizerTest.java
@@ -19,25 +19,20 @@ package org.apache.rya.indexing.external.tupleSet;
* under the License.
*/
-
-
import java.util.List;
import java.util.Set;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer;
-
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
-
-
public class QueryVariableNormalizerTest {
private String q1 = ""//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSetTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSetTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSetTest.java
index 15dfff4..f9ec5c7 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSetTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSetTest.java
@@ -26,11 +26,11 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
/**
* Tests {@link SimpleExternalTupleSet}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/VarConstQueryVariableNormalizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/VarConstQueryVariableNormalizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/VarConstQueryVariableNormalizerTest.java
index ebd1294..2a0afe0 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/VarConstQueryVariableNormalizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/VarConstQueryVariableNormalizerTest.java
@@ -19,22 +19,20 @@ package org.apache.rya.indexing.external.tupleSet;
* under the License.
*/
-
import java.util.List;
import java.util.Set;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer;
-
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -723,7 +721,7 @@ public class VarConstQueryVariableNormalizerTest {
- private static class FilterCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class FilterCollector extends AbstractQueryModelVisitor<RuntimeException> {
private List<QueryModelNode> filterList = Lists.newArrayList();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
index 6b73691..8d86a6d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
@@ -52,34 +52,31 @@ import org.apache.rya.indexing.mongodb.MongoDbSmartUri;
import org.apache.rya.indexing.smarturi.SmartUriAdapter;
import org.apache.rya.indexing.smarturi.SmartUriException;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Tests for MongoDB based Smart URI.
*/
public class MongoDbSmartUriIT extends MongoITBase {
private static final String NAMESPACE = RyaSchema.NAMESPACE;
- private static final ValueFactory VALUE_FACTORY = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
// People
private static final RyaURI BOB = createRyaUri("Bob");
@@ -142,7 +139,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
* @return the {@link RyraURI}.
*/
private static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createURI(namespace, localName));
+ return RdfToRyaConversions.convertURI(VF.createIRI(namespace, localName));
}
private static Entity createBobEntity() {
@@ -162,7 +159,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime().minusYears(40))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date())))
.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)))
- .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bob.smitch00@gmail.com"))))
+ .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_ATTRIBUTE_SPACE, stringRyaType("attribute space")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_MOTTO, stringRyaType("!@#*\\&%20^ smörgåsbord")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_BLOOD_TYPE, stringRyaType("A+ blood type")))
@@ -214,18 +211,18 @@ public class MongoDbSmartUriIT extends MongoITBase {
}
private static String getRyaUriLocalName(final RyaURI ryaUri) {
- return new URIImpl(ryaUri.getData()).getLocalName();
+ return VF.createIRI(ryaUri.getData()).getLocalName();
}
@Test
public void testSerializeDeserialize() throws SmartUriException, URISyntaxException {
- final URI smartUri = SmartUriAdapter.serializeUriEntity(BOB_ENTITY);
+ final IRI smartUri = SmartUriAdapter.serializeUriEntity(BOB_ENTITY);
final Entity resultEntity = SmartUriAdapter.deserializeUriEntity(smartUri);
assertEquals(BOB_ENTITY.getSubject(), resultEntity.getSubject());
}
@Test
- public void testStorage() throws SmartUriException, MalformedQueryException, RuntimeException, QueryEvaluationException {
+ public void testStorage() throws SmartUriException, RuntimeException {
smartUriConverter.storeEntity(BOB_ENTITY);
final String sparql = "SELECT * WHERE { " +
@@ -295,7 +292,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
// Look up Person Type Entities that match Bob's SSN property
final Set<Property> properties = new LinkedHashSet<>();
properties.add(BOB_ENTITY.lookupTypeProperty(PERSON_TYPE, HAS_SSN).get());
- final Map<URI, Value> map = SmartUriAdapter.propertiesToMap(properties);
+ final Map<IRI, Value> map = SmartUriAdapter.propertiesToMap(properties);
final ConvertingCursor<TypedEntity> cursor = smartUriConverter.queryEntity(PERSON_TYPE, map);
int count = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
index ee3869f..3a38923 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -30,18 +30,17 @@ import org.apache.rya.indexing.entity.query.EntityQueryNode;
import org.apache.rya.indexing.entity.storage.EntityStorage;
import org.apache.rya.indexing.entity.storage.TypeStorage;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.ImmutableSet;
@@ -230,7 +229,7 @@ public class MongoEntityIndex2IT extends MongoITBase {
expr.visit(new EntityFetchingAsserterVisitor(expected));
}
- private class EntityFetchingAsserterVisitor extends QueryModelVisitorBase<Exception> {
+ private class EntityFetchingAsserterVisitor extends AbstractQueryModelVisitor<Exception> {
private final EntityQueryNode expected;
public EntityFetchingAsserterVisitor(final EntityQueryNode expected) {
this.expected = expected;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
index 463cabc..f49f274 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -21,6 +21,7 @@ package org.apache.rya.indexing.mongo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import java.math.BigInteger;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
@@ -35,24 +36,24 @@ import org.apache.rya.indexing.entity.update.mongo.MongoEntityIndexer;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
import com.google.common.collect.ImmutableSet;
public class MongoEntityIndexIT extends MongoITBase {
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
protected void updateConfiguration(final MongoDBRdfConfiguration conf) {
@@ -108,8 +109,8 @@ public class MongoEntityIndexIT extends MongoITBase {
results.add(bs);
}
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("flavor", ValueFactoryImpl.getInstance().createLiteral("Strawberry"));
- expected.addBinding("brand", ValueFactoryImpl.getInstance().createLiteral("Awesome Icecream"));
+ expected.addBinding("flavor", VF.createLiteral("Strawberry"));
+ expected.addBinding("brand", VF.createLiteral("Awesome Icecream"));
assertEquals(1, results.size());
assertEquals(expected, results.iterator().next());
@@ -145,11 +146,10 @@ public class MongoEntityIndexIT extends MongoITBase {
System.out.println(bs);
results.add(bs);
}
- final ValueFactory vf = ValueFactoryImpl.getInstance();
final MapBindingSet expected = new MapBindingSet();
- //expected.addBinding("name", vf.createURI("http://www.w3.org/2001/SMLSchema#string", "George"));
- expected.addBinding("name", vf.createLiteral("George"));
- expected.addBinding("eye", vf.createLiteral("blue"));
+ //expected.addBinding("name", VF.createIRI("http://www.w3.org/2001/SMLSchema#string", "George"));
+ expected.addBinding("name", VF.createLiteral("George"));
+ expected.addBinding("eye", VF.createLiteral("blue"));
assertEquals(1, results.size());
assertEquals(expected, results.iterator().next());
@@ -197,122 +197,124 @@ public class MongoEntityIndexIT extends MongoITBase {
private void addStatements(SailRepositoryConnection conn) throws Exception {
//alice
- URI subject = VF.createURI("urn:alice");
- URI predicate = VF.createURI("urn:name");
+ IRI subject = VF.createIRI("urn:alice");
+ IRI predicate = VF.createIRI("urn:name");
Value object = VF.createLiteral("Alice");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("blue");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(30);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(30));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//bob
- subject = VF.createURI("urn:bob");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:bob");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("Bob");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("brown");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(57);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(57));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//charlie
- subject = VF.createURI("urn:charlie");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:charlie");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("Charlie");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("hazel");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(25);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(25));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//david
- subject = VF.createURI("urn:david");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:david");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("David");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("brown");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(30);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(30));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//eve
- subject = VF.createURI("urn:eve");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:eve");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("Bob");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(25);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(25));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//frank
- subject = VF.createURI("urn:frank");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:frank");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("Frank");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("Hazel");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(57);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(57));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
//george
- subject = VF.createURI("urn:george");
- predicate = VF.createURI("urn:name");
+ subject = VF.createIRI("urn:george");
+ predicate = VF.createIRI("urn:name");
object = VF.createLiteral("George");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:eye");
+ predicate = VF.createIRI("urn:eye");
object = VF.createLiteral("blue");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:age");
- object = VF.createLiteral(30);
+ predicate = VF.createIRI("urn:age");
+ object = VF.createLiteral(BigInteger.valueOf(30));
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:person")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:person")));
// Some Icecream typed objects.
//chocolate
- subject = VF.createURI("urn:chocolate");
- predicate = VF.createURI("urn:brand");
+ subject = VF.createIRI("urn:chocolate");
+ predicate = VF.createIRI("urn:brand");
object = VF.createLiteral("Awesome Icecream");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:flavor");
+ predicate = VF.createIRI("urn:flavor");
object = VF.createLiteral("Chocolate");
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:icecream")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:icecream")));
//vanilla
- subject = VF.createURI("urn:vanilla");
- predicate = VF.createURI("urn:brand");
+ subject = VF.createIRI("urn:vanilla");
+ predicate = VF.createIRI("urn:brand");
object = VF.createLiteral("Awesome Icecream");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:flavor");
+ predicate = VF.createIRI("urn:flavor");
object = VF.createLiteral("Vanilla");
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:icecream")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:icecream")));
//strawberry
- subject = VF.createURI("urn:strawberry");
- predicate = VF.createURI("urn:brand");
+ subject = VF.createIRI("urn:strawberry");
+ predicate = VF.createIRI("urn:brand");
object = VF.createLiteral("Awesome Icecream");
conn.add(VF.createStatement(subject, predicate, object));
- predicate = VF.createURI("urn:flavor");
+ predicate = VF.createIRI("urn:flavor");
object = VF.createLiteral("Strawberry");
conn.add(VF.createStatement(subject, predicate, object));
- conn.add(VF.createStatement(subject, RDF.TYPE, VF.createURI("urn:icecream")));
+ conn.add(VF.createStatement(subject, RDF.TYPE, VF.createIRI("urn:icecream")));
+
+ conn.commit();
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
index a8d496e..d827f78 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
@@ -33,19 +33,17 @@ import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.mongodb.freetext.MongoFreeTextIndexer;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDFS;
import com.google.common.collect.Sets;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Integration tests the methods of {@link MongoFreeTextIndexer}.
*/
@@ -58,13 +56,13 @@ public class MongoFreeTextIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
- final URI subject = new URIImpl("foo:subj");
- final URI predicate = RDFS.LABEL;
+ final IRI subject = vf.createIRI("foo:subj");
+ final IRI predicate = RDFS.LABEL;
final Value object = vf.createLiteral("this is a new hat");
- final URI context = new URIImpl("foo:context");
+ final IRI context = vf.createIRI("foo:context");
final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
@@ -83,22 +81,22 @@ public class MongoFreeTextIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
- final URI subject1 = new URIImpl("foo:subj");
- final URI predicate1 = RDFS.LABEL;
+ final IRI subject1 = vf.createIRI("foo:subj");
+ final IRI predicate1 = RDFS.LABEL;
final Value object1 = vf.createLiteral("this is a new hat");
- final URI context1 = new URIImpl("foo:context");
+ final IRI context1 = vf.createIRI("foo:context");
final Statement statement1 = vf.createStatement(subject1, predicate1, object1, context1);
f.storeStatement(RdfToRyaConversions.convertStatement(statement1));
- final URI subject2 = new URIImpl("foo:subject");
- final URI predicate2 = RDFS.LABEL;
+ final IRI subject2 = vf.createIRI("foo:subject");
+ final IRI predicate2 = RDFS.LABEL;
final Value object2 = vf.createLiteral("Do you like my new hat?");
- final URI context2 = new URIImpl("foo:context");
+ final IRI context2 = vf.createIRI("foo:context");
final Statement statement2 = vf.createStatement(subject2, predicate2, object2, context2);
f.storeStatement(RdfToRyaConversions.convertStatement(statement2));
@@ -161,11 +159,11 @@ public class MongoFreeTextIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final URI subject = new URIImpl("foo:subj");
- final URI predicate = new URIImpl(RDFS.COMMENT.toString());
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI subject = vf.createIRI("foo:subj");
+ final IRI predicate = vf.createIRI(RDFS.COMMENT.toString());
final Value object = vf.createLiteral("this is a new hat");
- final URI context = new URIImpl("foo:context");
+ final IRI context = vf.createIRI("foo:context");
final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
@@ -174,7 +172,7 @@ public class MongoFreeTextIndexerIT extends MongoITBase {
assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat", EMPTY_CONSTRAINTS)));
assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat", new StatementConstraints().setContext(context))));
assertEquals(Sets.newHashSet(),
- getSet(f.queryText("hat", new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryText("hat", new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
}
}
[39/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
index e3a74d5..534d9e5 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
@@ -63,13 +63,13 @@ public class InverseOfVisitor extends AbstractInferVisitor {
" { ?b ?pred ?a }
*/
- IRI predUri = (IRI) predVar.getValue();
- IRI invPropUri = inferenceEngine.findInverseOf(predUri);
- if (invPropUri != null) {
+ IRI predIri = (IRI) predVar.getValue();
+ IRI invPropIri = inferenceEngine.findInverseOf(predIri);
+ if (invPropIri != null) {
Var subjVar = sp.getSubjectVar();
Union union = new InferUnion();
union.setLeftArg(sp);
- union.setRightArg(new StatementPattern(objVar, new Var(predVar.getName(), invPropUri), subjVar, cntxtVar));
+ union.setRightArg(new StatementPattern(objVar, new Var(predVar.getName(), invPropIri), subjVar, cntxtVar));
node.replaceWith(union);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
deleted file mode 100644
index b038604..0000000
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
+++ /dev/null
@@ -1,64 +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.rya.rdftriplestore.inference;
-
-import org.eclipse.rdf4j.model.IRI;
-
-public class InverseURI implements IRI {
- private static final long serialVersionUID = 1L;
-
- private final IRI impl;
-
- public InverseURI(final IRI iri) {
- this.impl = iri;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((impl == null) ? 0 : impl.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj instanceof InverseURI){
- return impl.equals(((InverseURI) obj).impl);
- }
- return false;
- }
-
- @Override
- public String stringValue() {
- return impl.stringValue();
- }
-
- @Override
- public String getNamespace() {
- return impl.getNamespace();
- }
-
- @Override
- public String getLocalName() {
- return impl.getLocalName();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
index 2df3461..3a5a76c 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
@@ -62,8 +62,8 @@ public class PropertyChainVisitor extends AbstractInferVisitor {
!RDFS.NAMESPACE.equals(predNamespace)
&& !EXPANDED.equals(cntxtVar)) {
- final IRI chainPropURI = (IRI) predVar.getValue();
- final List<IRI> chain = inferenceEngine.getPropertyChain(chainPropURI);
+ final IRI chainPropIRI = (IRI) predVar.getValue();
+ final List<IRI> chain = inferenceEngine.getPropertyChain(chainPropIRI);
final List<StatementPattern> expandedPatterns = new ArrayList<StatementPattern>();
if (chain.size() > 0) {
final Var originalSubj = sp.getSubjectVar();
@@ -75,7 +75,7 @@ public class PropertyChainVisitor extends AbstractInferVisitor {
final String s = UUID.randomUUID().toString();
final Var currentObj = new Var("c-" + s);
StatementPattern statementPattern = new StatementPattern(nextSubj, new Var(chainElement.stringValue()), currentObj, sp.getContextVar());
- if (chainElement instanceof InverseURI){
+ if (chainElement instanceof InverseIRI){
statementPattern = new StatementPattern(currentObj, new Var(chainElement.stringValue()), nextSubj, sp.getContextVar());
}
expandedPatterns.add(statementPattern);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
index 0d11918..31b7792 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
@@ -61,15 +61,15 @@ public class SubClassOfVisitor extends AbstractInferVisitor {
// join.getProperties().put(InferConstants.INFERRED, InferConstants.TRUE);
// node.replaceWith(join);
- final IRI subclassof_uri = (IRI) objVar.getValue();
- final Collection<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), subclassof_uri);
+ final IRI subclassof_iri = (IRI) objVar.getValue();
+ final Collection<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), subclassof_iri);
if (parents != null && parents.size() > 0) {
final String s = UUID.randomUUID().toString();
final Var typeVar = new Var(s);
final FixedStatementPattern fsp = new FixedStatementPattern(typeVar, new Var("c-" + s, RDFS.SUBCLASSOF), objVar, conVar);
- parents.add(subclassof_uri);
- for (final IRI u : parents) {
- fsp.statements.add(new NullableStatementImpl(u, RDFS.SUBCLASSOF, subclassof_uri));
+ parents.add(subclassof_iri);
+ for (final IRI iri : parents) {
+ fsp.statements.add(new NullableStatementImpl(iri, RDFS.SUBCLASSOF, subclassof_iri));
}
final StatementPattern rdfType = new DoNotExpandSP(sp.getSubjectVar(), sp.getPredicateVar(), typeVar, conVar);
@@ -82,8 +82,8 @@ public class SubClassOfVisitor extends AbstractInferVisitor {
// StatementPatterns statementPatterns = new StatementPatterns();
// statementPatterns.patterns.add(node);
// Var subjVar = node.getSubjectVar();
-// for (URI u : parents) {
-// statementPatterns.patterns.add(new StatementPattern(subjVar, predVar, new Var(objVar.getName(), u)));
+// for (IRI iri : parents) {
+// statementPatterns.patterns.add(new StatementPattern(subjVar, predVar, new Var(objVar.getName(), iri)));
// }
// node.replaceWith(statementPatterns);
// }
@@ -92,8 +92,8 @@ public class SubClassOfVisitor extends AbstractInferVisitor {
// VarCollection vc = new VarCollection();
// vc.setName(objVar.getName());
// vc.values.add(objVar);
-// for (URI u : parents) {
-// vc.values.add(new Var(objVar.getName(), u));
+// for (IRI iri : parents) {
+// vc.values.add(new Var(objVar.getName(), iri));
// }
// Var subjVar = node.getSubjectVar();
// node.replaceWith(new StatementPattern(subjVar, predVar, vc, node.getContextVar()));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
index 102c0b2..e49e605 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
@@ -78,8 +78,8 @@ public class SubPropertyOfVisitor extends AbstractInferVisitor {
// StatementPatterns statementPatterns = new StatementPatterns();
// statementPatterns.patterns.add(node);
// Var subjVar = node.getSubjectVar();
-// for (URI u : parents) {
-// statementPatterns.patterns.add(new StatementPattern(subjVar, new Var(predVar.getName(), u), objVar));
+// for (IRI iri : parents) {
+// statementPatterns.patterns.add(new StatementPattern(subjVar, new Var(predVar.getName(), iri), objVar));
// }
// node.replaceWith(statementPatterns);
// }
@@ -87,24 +87,24 @@ public class SubPropertyOfVisitor extends AbstractInferVisitor {
// VarCollection vc = new VarCollection();
// vc.setName(predVar.getName());
// vc.values.add(predVar);
-// for (URI u : parents) {
-// vc.values.add(new Var(predVar.getName(), u));
+// for (IRI iri : parents) {
+// vc.values.add(new Var(predVar.getName(), iri));
// }
// Var subjVar = node.getSubjectVar();
// node.replaceWith(new StatementPattern(subjVar, vc, objVar, node.getContextVar()));
// }
- final IRI subprop_uri = (IRI) predVar.getValue();
- final Set<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), subprop_uri);
+ final IRI subprop_iri = (IRI) predVar.getValue();
+ final Set<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), subprop_iri);
if (parents != null && parents.size() > 0) {
final String s = UUID.randomUUID().toString();
final Var typeVar = new Var(s);
final FixedStatementPattern fsp = new FixedStatementPattern(typeVar, new Var("c-" + s, RDFS.SUBPROPERTYOF), predVar, cntxtVar);
// fsp.statements.add(new NullableStatementImpl(subprop_uri, RDFS.SUBPROPERTYOF, subprop_uri));
//add self
- parents.add(subprop_uri);
+ parents.add(subprop_iri);
for (final IRI u : parents) {
- fsp.statements.add(new NullableStatementImpl(u, RDFS.SUBPROPERTYOF, subprop_uri));
+ fsp.statements.add(new NullableStatementImpl(u, RDFS.SUBPROPERTYOF, subprop_iri));
}
final StatementPattern rdfType = new DoNotExpandSP(sp.getSubjectVar(), typeVar, sp.getObjectVar(), cntxtVar);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
index c8e1a7d..72a3dae 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
@@ -63,8 +63,8 @@ public class SymmetricPropertyVisitor extends AbstractInferVisitor {
" { ?b ?pred ?a }
*/
- IRI symmPropUri = (IRI) predVar.getValue();
- if(inferenceEngine.isSymmetricProperty(symmPropUri)) {
+ IRI symmPropIri = (IRI) predVar.getValue();
+ if(inferenceEngine.isSymmetricProperty(symmPropIri)) {
Var subjVar = sp.getSubjectVar();
Union union = new InferUnion();
union.setLeftArg(sp);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
index 666bbd8..bae1bd1 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
@@ -56,8 +56,8 @@ public class TransitivePropertyVisitor extends AbstractInferVisitor {
!RDFS.NAMESPACE.equals(predNamespace)
&& !EXPANDED.equals(cntxtVar)) {
- final IRI transPropUri = (IRI) predVar.getValue();
- if (inferenceEngine.isTransitiveProperty(transPropUri)) {
+ final IRI transPropIri = (IRI) predVar.getValue();
+ if (inferenceEngine.isTransitiveProperty(transPropIri)) {
node.replaceWith(new TransitivePropertySP(sp.getSubjectVar(), sp.getPredicateVar(), sp.getObjectVar(), sp.getContextVar()));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/test/java/org/apache/rya/HashJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/HashJoinTest.java b/sail/src/test/java/org/apache/rya/HashJoinTest.java
index e0463c9..8fc2590 100644
--- a/sail/src/test/java/org/apache/rya/HashJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/HashJoinTest.java
@@ -33,7 +33,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.HashJoin;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
@@ -68,13 +68,13 @@ public class HashJoinTest {
@Test
public void testSimpleJoin() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -88,11 +88,11 @@ public class HashJoinTest {
//1 join
HashJoin hjoin = new HashJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = hjoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two));
+ CloseableIteration<RyaIRI, RyaDAOException> join = hjoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two));
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -106,15 +106,15 @@ public class HashJoinTest {
@Test
public void testSimpleJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -136,14 +136,14 @@ public class HashJoinTest {
//1 join
HashJoin hjoin = new HashJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = hjoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = hjoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -157,16 +157,16 @@ public class HashJoinTest {
@Test
public void testMergeJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -188,14 +188,14 @@ public class HashJoinTest {
//1 join
HashJoin hjoin = new HashJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = hjoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = hjoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -208,16 +208,16 @@ public class HashJoinTest {
@Test
public void testMergeJoinMultiWayNone() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, three));
@@ -234,11 +234,11 @@ public class HashJoinTest {
//1 join
HashJoin hjoin = new HashJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = hjoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = hjoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
@@ -248,16 +248,16 @@ public class HashJoinTest {
@Test
public void testMergeJoinMultiWayNone2() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, four));
@@ -272,11 +272,11 @@ public class HashJoinTest {
//1 join
HashJoin hjoin = new HashJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = hjoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = hjoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
@@ -286,13 +286,13 @@ public class HashJoinTest {
@Test
public void testSimpleHashJoinPredicateOnly() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred2, one));
@@ -320,15 +320,15 @@ public class HashJoinTest {
@Test
public void testSimpleMergeJoinPredicateOnly2() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred1, two));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/IterativeJoinTest.java b/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
index 8e40e2d..6612f9e 100644
--- a/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
@@ -33,7 +33,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.IterativeJoin;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
@@ -68,13 +68,13 @@ public class IterativeJoinTest {
@Test
public void testSimpleIterativeJoin() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -87,10 +87,10 @@ public class IterativeJoinTest {
//1 join
IterativeJoin iterJoin = new IterativeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = iterJoin.join(null, new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two));
+ CloseableIteration<RyaIRI, RyaDAOException> join = iterJoin.join(null, new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two));
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -104,15 +104,15 @@ public class IterativeJoinTest {
@Test
public void testSimpleIterativeJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -133,14 +133,14 @@ public class IterativeJoinTest {
//1 join
IterativeJoin iterativeJoin = new IterativeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = iterativeJoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = iterativeJoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -154,16 +154,16 @@ public class IterativeJoinTest {
@Test
public void testIterativeJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -184,14 +184,14 @@ public class IterativeJoinTest {
//1 join
IterativeJoin iterativeJoin = new IterativeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = iterativeJoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = iterativeJoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -204,16 +204,16 @@ public class IterativeJoinTest {
@Test
public void testIterativeJoinMultiWayNone() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, three));
@@ -229,11 +229,11 @@ public class IterativeJoinTest {
//1 join
IterativeJoin iterativeJoin = new IterativeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = iterativeJoin.join(null,
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = iterativeJoin.join(null,
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
@@ -243,16 +243,16 @@ public class IterativeJoinTest {
@Test
public void testIterativeJoinMultiWayNone2() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, four));
@@ -266,10 +266,10 @@ public class IterativeJoinTest {
//1 join
IterativeJoin iterativeJoin = new IterativeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = iterativeJoin.join(null, new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, one),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, two),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, three),
- new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = iterativeJoin.join(null, new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, one),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, two),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, three),
+ new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
@@ -279,13 +279,13 @@ public class IterativeJoinTest {
@Test
public void testSimpleIterativeJoinPredicateOnly() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred2, one));
@@ -313,15 +313,15 @@ public class IterativeJoinTest {
@Test
public void testSimpleIterativeJoinPredicateOnly2() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred1, two));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/test/java/org/apache/rya/MergeJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/MergeJoinTest.java b/sail/src/test/java/org/apache/rya/MergeJoinTest.java
index efc44c3..c06b777 100644
--- a/sail/src/test/java/org/apache/rya/MergeJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/MergeJoinTest.java
@@ -33,7 +33,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreUtils.CustomEntry;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.MergeJoin;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
@@ -71,13 +71,13 @@ public class MergeJoinTest {
@Test
public void testSimpleMergeJoin() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -91,10 +91,10 @@ public class MergeJoinTest {
//1 join
MergeJoin mergeJoin = new MergeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaURI, RyaType>(pred, one),
- new CustomEntry<RyaURI, RyaType>(pred, two));
+ CloseableIteration<RyaIRI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaIRI, RyaType>(pred, one),
+ new CustomEntry<RyaIRI, RyaType>(pred, two));
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -108,13 +108,13 @@ public class MergeJoinTest {
@Test
public void testSimpleMergeJoinPredicateOnly() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred2, one));
@@ -142,15 +142,15 @@ public class MergeJoinTest {
@Test
public void testSimpleMergeJoinPredicateOnly2() throws Exception {
//add data
- RyaURI pred1 = new RyaURI(litdupsNS, "pred1");
- RyaURI pred2 = new RyaURI(litdupsNS, "pred2");
+ RyaIRI pred1 = new RyaIRI(litdupsNS, "pred1");
+ RyaIRI pred2 = new RyaIRI(litdupsNS, "pred2");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred1, one));
dao.add(new RyaStatement(subj1, pred1, two));
@@ -194,15 +194,15 @@ public class MergeJoinTest {
@Test
public void testSimpleMergeJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -224,13 +224,13 @@ public class MergeJoinTest {
//1 join
MergeJoin mergeJoin = new MergeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaURI, RyaType>(pred, one),
- new CustomEntry<RyaURI, RyaType>(pred, two),
- new CustomEntry<RyaURI, RyaType>(pred, three),
- new CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaIRI, RyaType>(pred, one),
+ new CustomEntry<RyaIRI, RyaType>(pred, two),
+ new CustomEntry<RyaIRI, RyaType>(pred, three),
+ new CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -244,16 +244,16 @@ public class MergeJoinTest {
@Test
public void testMergeJoinMultiWay() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, two));
@@ -275,13 +275,13 @@ public class MergeJoinTest {
//1 join
MergeJoin mergeJoin = new MergeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaURI, RyaType>(pred, one),
- new CustomEntry<RyaURI, RyaType>(pred, two),
- new CustomEntry<RyaURI, RyaType>(pred, three),
- new CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaIRI, RyaType>(pred, one),
+ new CustomEntry<RyaIRI, RyaType>(pred, two),
+ new CustomEntry<RyaIRI, RyaType>(pred, three),
+ new CustomEntry<RyaIRI, RyaType>(pred, four)
);
- Set<RyaURI> uris = new HashSet<RyaURI>();
+ Set<RyaIRI> uris = new HashSet<RyaIRI>();
while (join.hasNext()) {
uris.add(join.next());
}
@@ -294,16 +294,16 @@ public class MergeJoinTest {
@Test
public void testMergeJoinMultiWayNone() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, three));
@@ -320,10 +320,10 @@ public class MergeJoinTest {
//1 join
MergeJoin mergeJoin = new MergeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaURI, RyaType>(pred, one),
- new CustomEntry<RyaURI, RyaType>(pred, two),
- new CustomEntry<RyaURI, RyaType>(pred, three),
- new CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaIRI, RyaType>(pred, one),
+ new CustomEntry<RyaIRI, RyaType>(pred, two),
+ new CustomEntry<RyaIRI, RyaType>(pred, three),
+ new CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
@@ -333,16 +333,16 @@ public class MergeJoinTest {
@Test
public void testMergeJoinMultiWayNone2() throws Exception {
//add data
- RyaURI pred = new RyaURI(litdupsNS, "pred1");
+ RyaIRI pred = new RyaIRI(litdupsNS, "pred1");
RyaType zero = new RyaType("0");
RyaType one = new RyaType("1");
RyaType two = new RyaType("2");
RyaType three = new RyaType("3");
RyaType four = new RyaType("4");
- RyaURI subj1 = new RyaURI(litdupsNS, "subj1");
- RyaURI subj2 = new RyaURI(litdupsNS, "subj2");
- RyaURI subj3 = new RyaURI(litdupsNS, "subj3");
- RyaURI subj4 = new RyaURI(litdupsNS, "subj4");
+ RyaIRI subj1 = new RyaIRI(litdupsNS, "subj1");
+ RyaIRI subj2 = new RyaIRI(litdupsNS, "subj2");
+ RyaIRI subj3 = new RyaIRI(litdupsNS, "subj3");
+ RyaIRI subj4 = new RyaIRI(litdupsNS, "subj4");
dao.add(new RyaStatement(subj1, pred, one));
dao.add(new RyaStatement(subj1, pred, four));
@@ -357,10 +357,10 @@ public class MergeJoinTest {
//1 join
MergeJoin mergeJoin = new MergeJoin(dao.getQueryEngine());
- CloseableIteration<RyaURI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaURI, RyaType>(pred, one),
- new CustomEntry<RyaURI, RyaType>(pred, two),
- new CustomEntry<RyaURI, RyaType>(pred, three),
- new CustomEntry<RyaURI, RyaType>(pred, four)
+ CloseableIteration<RyaIRI, RyaDAOException> join = mergeJoin.join(null, new CustomEntry<RyaIRI, RyaType>(pred, one),
+ new CustomEntry<RyaIRI, RyaType>(pred, two),
+ new CustomEntry<RyaIRI, RyaType>(pred, three),
+ new CustomEntry<RyaIRI, RyaType>(pred, four)
);
assertFalse(join.hasNext());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
index f40b4e9..c9ed744 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
@@ -33,7 +33,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.rdftriplestore.RdfCloudTripleStoreConnection.StoreTripleSource;
@@ -86,16 +86,16 @@ public class StatementPatternEvalTest {
ParsedQuery pq = parser.parseQuery(query, null);
List<StatementPattern> spList = StatementPatternCollector.process(pq.getTupleExpr());
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context2"), "", new StatementMetadata());
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context2"), "", new StatementMetadata());
dao.add(statement2);
- RyaStatement statement3 = new RyaStatement(new RyaURI("uri:Eric"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context3"), "", new StatementMetadata());
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("uri:Eric"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context3"), "", new StatementMetadata());
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
@@ -137,16 +137,16 @@ public class StatementPatternEvalTest {
ParsedQuery pq = parser.parseQuery(query, null);
List<StatementPattern> spList = StatementPatternCollector.process(pq.getTupleExpr());
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context2"), "", new StatementMetadata());
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context2"), "", new StatementMetadata());
dao.add(statement2);
- RyaStatement statement3 = new RyaStatement(new RyaURI("uri:Eric"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context3"), "", new StatementMetadata());
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("uri:Eric"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context3"), "", new StatementMetadata());
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
@@ -191,16 +191,16 @@ public class StatementPatternEvalTest {
ParsedQuery pq = parser.parseQuery(query, null);
List<StatementPattern> spList = StatementPatternCollector.process(pq.getTupleExpr());
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context2"), "", new StatementMetadata());
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context2"), "", new StatementMetadata());
dao.add(statement2);
- RyaStatement statement3 = new RyaStatement(new RyaURI("uri:Eric"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context3"), "", new StatementMetadata());
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("uri:Eric"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context3"), "", new StatementMetadata());
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
@@ -237,16 +237,16 @@ public class StatementPatternEvalTest {
ParsedQuery pq = parser.parseQuery(query, null);
List<StatementPattern> spList = StatementPatternCollector.process(pq.getTupleExpr());
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context2"), "", new StatementMetadata());
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context2"), "", new StatementMetadata());
dao.add(statement2);
- RyaStatement statement3 = new RyaStatement(new RyaURI("uri:Eric"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context3"), "", new StatementMetadata());
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("uri:Eric"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context3"), "", new StatementMetadata());
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
@@ -277,16 +277,16 @@ public class StatementPatternEvalTest {
ParsedQuery pq = parser.parseQuery(query, null);
List<StatementPattern> spList = StatementPatternCollector.process(pq.getTupleExpr());
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context1"), "", new StatementMetadata());
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context1"), "", new StatementMetadata());
dao.add(statement2);
- RyaStatement statement3 = new RyaStatement(new RyaURI("uri:Doug"), new RyaURI("uri:talksTo"),
- new RyaType("uri:Bob"), new RyaURI("uri:context2"), "", new StatementMetadata());
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("uri:Doug"), new RyaIRI("uri:talksTo"),
+ new RyaType("uri:Bob"), new RyaIRI("uri:context2"), "", new StatementMetadata());
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
index a3fd6ce..7a6bc79 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
@@ -115,7 +115,7 @@ public class PropertyChainTest extends TestCase {
inferenceEngine.refreshGraph();
List<IRI> chain = inferenceEngine.getPropertyChain(VF.createIRI("urn:greatMother"));
Assert.assertEquals(chain.size(), 2);
- Assert.assertEquals(chain.get(0), new InverseURI(VF.createIRI("urn:isChildOf")));
+ Assert.assertEquals(chain.get(0), new InverseIRI(VF.createIRI("urn:isChildOf")));
Assert.assertEquals(chain.get(1), VF.createIRI("urn:MotherOf"));
}
[08/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorTest.java
index 7ff2c96..f0fd762 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorTest.java
@@ -30,11 +30,11 @@ import org.apache.rya.streams.kafka.RdfTestUtil;
import org.apache.rya.streams.kafka.processors.ProcessorResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.UnaryResult;
import org.apache.rya.streams.kafka.processors.projection.ProjectionProcessorSupplier.ProjectionProcessor;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit tests the methods of {@link ProjectionProcessor}.
@@ -52,18 +52,18 @@ public class ProjectionProcessorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet inputBs = new MapBindingSet();
- inputBs.addBinding("person", vf.createURI("urn:Alice"));
- inputBs.addBinding("employee", vf.createURI("urn:Bob"));
- inputBs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ inputBs.addBinding("person", vf.createIRI("urn:Alice"));
+ inputBs.addBinding("employee", vf.createIRI("urn:Bob"));
+ inputBs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet inputVisBs = new VisibilityBindingSet(inputBs, "a");
// The expected binding set changes the "person" binding name to "p" and "employee" to "e".
final MapBindingSet expectedBs = new MapBindingSet();
- expectedBs.addBinding("p", vf.createURI("urn:Alice"));
- expectedBs.addBinding("e", vf.createURI("urn:Bob"));
- expectedBs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ expectedBs.addBinding("p", vf.createIRI("urn:Alice"));
+ expectedBs.addBinding("e", vf.createIRI("urn:Bob"));
+ expectedBs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet expectedVisBs = new VisibilityBindingSet(expectedBs, "a");
// Show it resulted in the correct output BindingSet.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLogIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLogIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLogIT.java
index 0dcd079..78db768 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLogIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLogIT.java
@@ -39,6 +39,7 @@ import org.apache.rya.streams.kafka.serialization.queries.QueryChangeSerializer;
import org.apache.rya.test.kafka.KafkaITBase;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -46,8 +47,6 @@ import org.junit.Test;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Integration tests the {@link KafkaQueryChangeLog}.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetKafkaIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetKafkaIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetKafkaIT.java
index 70cba1c..5b14bd4 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetKafkaIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetKafkaIT.java
@@ -31,11 +31,11 @@ import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the {@link VisibilityBindingSetSerde} class' methods.
@@ -48,10 +48,10 @@ public class VisibilityBindingSetKafkaIT {
@Test
public void readAndWrite() throws Exception {
// Create the object that will be written to the topic.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("urn:name", vf.createURI("urn:alice"));
+ bs.addBinding("urn:name", vf.createIRI("urn:alice"));
bs.addBinding("urn:age", vf.createLiteral(32));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b|c");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetSerdeTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetSerdeTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetSerdeTest.java
index 9d93539..049893b 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetSerdeTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityBindingSetSerdeTest.java
@@ -23,10 +23,10 @@ import static org.junit.Assert.assertNull;
import org.apache.kafka.common.serialization.Serde;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Tests the methods of {@link VisibilityBindingSetSerde}.
@@ -36,7 +36,7 @@ public class VisibilityBindingSetSerdeTest {
@Test
public void serializeAndDeserialize() {
// Create the object that will be serialized.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
bs.addBinding("name", vf.createLiteral("alice"));
bs.addBinding("age", vf.createLiteral(37));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementKafkaIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementKafkaIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementKafkaIT.java
index 9e85f52..a680582 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementKafkaIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementKafkaIT.java
@@ -31,10 +31,10 @@ import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.rya.api.model.VisibilityStatement;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
/**
* Integration tests the {@link VisibilityStatementSerde} class' methods.
@@ -47,13 +47,13 @@ public class VisibilityStatementKafkaIT {
@Test
public void readAndWrite() throws Exception {
// Create the object that will be written to the topic.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final VisibilityStatement original = new VisibilityStatement(
vf.createStatement(
- vf.createURI("urn:alice"),
- vf.createURI("urn:age"),
+ vf.createIRI("urn:alice"),
+ vf.createIRI("urn:age"),
vf.createLiteral(32),
- vf.createURI("urn:context")),
+ vf.createIRI("urn:context")),
"a|b|c");
// Write a VisibilityStatement to the test topic.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementSerdeTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementSerdeTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementSerdeTest.java
index 47a79c9..d4f8ada 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementSerdeTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/serialization/VisibilityStatementSerdeTest.java
@@ -23,10 +23,10 @@ import static org.junit.Assert.assertNull;
import org.apache.kafka.common.serialization.Serde;
import org.apache.rya.api.model.VisibilityStatement;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
/**
* Tests the methods of {@link VisibilityStatementSerde}.
@@ -36,12 +36,12 @@ public class VisibilityStatementSerdeTest {
@Test
public void serializeAndDeserialize() {
// Create the object that will be serialized.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Statement statement = vf.createStatement(
- vf.createURI("urn:person1"),
- vf.createURI("urn:hasName"),
+ vf.createIRI("urn:person1"),
+ vf.createIRI("urn:hasName"),
vf.createLiteral("alice"),
- vf.createURI("urn:testContext"));
+ vf.createIRI("urn:testContext"));
final VisibilityStatement original = new VisibilityStatement(statement, "a|b|c");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/topology/TopologyFactoryTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/topology/TopologyFactoryTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/topology/TopologyFactoryTest.java
index 31462ec..95e2ddb 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/topology/TopologyFactoryTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/topology/TopologyFactoryTest.java
@@ -23,16 +23,17 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.function.projection.RandomUUIDFactory;
import org.apache.rya.streams.kafka.topology.TopologyFactory.ProcessorEntry;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
/**
* Unit tests the methods of {@link TopologyFactory}.
@@ -40,9 +41,9 @@ import org.openrdf.query.algebra.Var;
public class TopologyFactoryTest {
private static TopologyFactory FACTORY;
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
- private static final Var TALKS_TO = new Var("-const-urn:talksTo", VF.createURI("urn:talksTo"));
- private static final Var CHEWS = new Var("-const-urn:chews", VF.createURI("urn:chews"));
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final Var TALKS_TO = VarNameUtils.createUniqueConstVar(VF.createIRI("urn:talksTo"));
+ private static final Var CHEWS = VarNameUtils.createUniqueConstVar(VF.createIRI("urn:chews"));
static {
TALKS_TO.setAnonymous(true);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/query-manager/src/main/java/org/apache/rya/streams/querymanager/QueryExecutor.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/query-manager/src/main/java/org/apache/rya/streams/querymanager/QueryExecutor.java b/extras/rya.streams/query-manager/src/main/java/org/apache/rya/streams/querymanager/QueryExecutor.java
index bcee796..2c0686f 100644
--- a/extras/rya.streams/query-manager/src/main/java/org/apache/rya/streams/querymanager/QueryExecutor.java
+++ b/extras/rya.streams/query-manager/src/main/java/org/apache/rya/streams/querymanager/QueryExecutor.java
@@ -22,7 +22,7 @@ import java.util.Set;
import java.util.UUID;
import org.apache.rya.streams.api.entity.StreamsQuery;
-import org.openrdf.model.Statement;
+import org.eclipse.rdf4j.model.Statement;
import com.google.common.util.concurrent.Service;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/query-manager/src/test/java/org/apache/rya/streams/querymanager/kafka/LocalQueryExecutorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/query-manager/src/test/java/org/apache/rya/streams/querymanager/kafka/LocalQueryExecutorIT.java b/extras/rya.streams/query-manager/src/test/java/org/apache/rya/streams/querymanager/kafka/LocalQueryExecutorIT.java
index 83f040d..fcb3a46 100644
--- a/extras/rya.streams/query-manager/src/test/java/org/apache/rya/streams/querymanager/kafka/LocalQueryExecutorIT.java
+++ b/extras/rya.streams/query-manager/src/test/java/org/apache/rya/streams/querymanager/kafka/LocalQueryExecutorIT.java
@@ -42,13 +42,13 @@ import org.apache.rya.streams.kafka.serialization.VisibilityStatementSerializer;
import org.apache.rya.streams.querymanager.QueryExecutor;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
@@ -89,34 +89,34 @@ public class LocalQueryExecutorIT {
final StreamsQuery sQuery = new StreamsQuery(UUID.randomUUID(), "SELECT * WHERE { ?person <urn:worksAt> ?business . }", true, false);
// Create the statements that will be loaded.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Alice"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:BurgerJoint")), "a"));
+ vf.createIRI("urn:Alice"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:BurgerJoint")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Bob"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Bob"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Charlie"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Charlie"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
// Create the expected results.
final List<VisibilityBindingSet> expected = new ArrayList<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Charlie"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Charlie"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
// Start the executor that will be tested.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/shell/src/main/java/org/apache/rya/shell/RyaCommands.java
----------------------------------------------------------------------
diff --git a/extras/shell/src/main/java/org/apache/rya/shell/RyaCommands.java b/extras/shell/src/main/java/org/apache/rya/shell/RyaCommands.java
index 1d53348..c257860 100644
--- a/extras/shell/src/main/java/org/apache/rya/shell/RyaCommands.java
+++ b/extras/shell/src/main/java/org/apache/rya/shell/RyaCommands.java
@@ -35,12 +35,14 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.rya.api.client.ExecuteSparqlQuery;
import org.apache.rya.api.client.RyaClient;
import org.apache.rya.api.client.RyaClientException;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
import org.apache.rya.shell.SharedShellState.ShellState;
import org.apache.rya.shell.util.ConsolePrinter;
import org.apache.rya.shell.util.SparqlPrompt;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.rio.RDFFormat;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.Rio;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -121,7 +123,7 @@ public class RyaCommands implements CommandMarker {
RDFFormat rdfFormat = null;
// If a format was provided, then go with that.
if (format != null) {
- rdfFormat = RDFFormat.valueOf(format);
+ rdfFormat = RdfFormatUtils.getRdfFormatFromName(format);
if (rdfFormat == null) {
throw new RuntimeException("Unsupported RDF Statement data input format: " + format);
}
@@ -129,7 +131,7 @@ public class RyaCommands implements CommandMarker {
// Otherwise try to figure it out using the filename.
else if (rdfFormat == null) {
- rdfFormat = RDFFormat.forFileName(rootedFile.getFileName().toString());
+ rdfFormat = Rio.getParserFormatForFileName(rootedFile.getFileName().toString()).get();
if (rdfFormat == null) {
throw new RuntimeException("Unable to detect RDF Statement data input format for file: " + rootedFile);
} else {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/shell/src/main/java/org/apache/rya/shell/RyaStreamsCommands.java
----------------------------------------------------------------------
diff --git a/extras/shell/src/main/java/org/apache/rya/shell/RyaStreamsCommands.java b/extras/shell/src/main/java/org/apache/rya/shell/RyaStreamsCommands.java
index fede1a9..f286472 100644
--- a/extras/shell/src/main/java/org/apache/rya/shell/RyaStreamsCommands.java
+++ b/extras/shell/src/main/java/org/apache/rya/shell/RyaStreamsCommands.java
@@ -37,7 +37,7 @@ import org.apache.rya.streams.api.RyaStreamsClient;
import org.apache.rya.streams.api.entity.StreamsQuery;
import org.apache.rya.streams.api.exception.RyaStreamsException;
import org.apache.rya.streams.kafka.KafkaRyaStreamsClientFactory;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.shell.core.CommandMarker;
import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/shell/src/main/java/org/apache/rya/shell/util/StreamsQueryFormatter.java
----------------------------------------------------------------------
diff --git a/extras/shell/src/main/java/org/apache/rya/shell/util/StreamsQueryFormatter.java b/extras/shell/src/main/java/org/apache/rya/shell/util/StreamsQueryFormatter.java
index babeec8..646ca7c 100644
--- a/extras/shell/src/main/java/org/apache/rya/shell/util/StreamsQueryFormatter.java
+++ b/extras/shell/src/main/java/org/apache/rya/shell/util/StreamsQueryFormatter.java
@@ -24,9 +24,9 @@ import java.util.Collection;
import java.util.List;
import org.apache.rya.streams.api.entity.StreamsQuery;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/shell/src/test/java/org/apache/rya/shell/RyaCommandsTest.java
----------------------------------------------------------------------
diff --git a/extras/shell/src/test/java/org/apache/rya/shell/RyaCommandsTest.java b/extras/shell/src/test/java/org/apache/rya/shell/RyaCommandsTest.java
index d08b0bd..ced94f3 100644
--- a/extras/shell/src/test/java/org/apache/rya/shell/RyaCommandsTest.java
+++ b/extras/shell/src/test/java/org/apache/rya/shell/RyaCommandsTest.java
@@ -17,6 +17,7 @@
* under the License.
*/
package org.apache.rya.shell;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
@@ -37,9 +38,9 @@ import org.apache.rya.api.client.RyaClientException;
import org.apache.rya.api.client.accumulo.AccumuloConnectionDetails;
import org.apache.rya.shell.util.ConsolePrinter;
import org.apache.rya.shell.util.SparqlPrompt;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Test;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.rio.RDFFormat;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/vagrantExample/src/main/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/extras/vagrantExample/src/main/vagrant/Vagrantfile b/extras/vagrantExample/src/main/vagrant/Vagrantfile
index e3f2a73..6b81abe 100644
--- a/extras/vagrantExample/src/main/vagrant/Vagrantfile
+++ b/extras/vagrantExample/src/main/vagrant/Vagrantfile
@@ -20,7 +20,7 @@
#
# Builds a single node Rya on Accumulo on Hadoop and Zookeeper.
-# Deploys Rya, and the Sesame openrdf-workbench on Tomcat accessable from the host's browser.
+# Deploys Rya, and the Eclipse rdf4j-workbench on Tomcat accessible from the host's browser.
# See the accompanying readme for URL's, verification, and troubleshooting.
#
# Note: Machine's ip is 192.168.33.10
@@ -52,8 +52,8 @@ Vagrant.configure(2) do |config|
export ACCUMULO_VERSION=1.6.5
###export ACCUMULO_VERSION=1.7.1
export HADOOP_VERSION=2.7.2
- export RYA_EXAMPLE_VERSION=3.2.10-SNAPSHOT
- export SESAME_VERSION=2.7.6
+ export RYA_EXAMPLE_VERSION=3.2.13-SNAPSHOT
+ export RDF4J_VERSION=2.3.1
export ZOOKEEPER_VERSION=3.4.5-cdh4.5.0
echo "Updating host file with permanent ip"
@@ -288,25 +288,25 @@ EOF
echo 'Done!'
- echo "Installing Sesame Server"
- # creating log dir sesame-http-server-${SESAME_VERSION}
- sudo mkdir --parents /usr/share/tomcat7/.aduna
+ echo "Installing RDF4J Server"
+ # creating log dir rdf4j-http-server-${RDF4J_VERSION}
+ sudo mkdir --parents /usr/share/tomcat7/.RDF4J
sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7
- sudo ln --force -s /usr/share/tomcat7/.aduna/openrdf-sesame/logs /var/log/tomcat7/openrdf-sesame
- sesamewar=/var/lib/tomcat7/webapps/openrdf-sesame.war
- if [[ ! -s $sesamewar ]] ; then
+ sudo ln --force -s /usr/share/tomcat7/.RDF4J/Server/logs /var/log/tomcat7/rdf4j-server
+ rdf4jwar=/var/lib/tomcat7/webapps/rdf4j-server.war
+ if [[ ! -s $rdf4jwar ]] ; then
echo "Downloading"
- download --output $sesamewar http://repo1.maven.org/maven2/org/openrdf/sesame/sesame-http-server/${SESAME_VERSION}/sesame-http-server-${SESAME_VERSION}.war || exit 110
+ download --output $rdf4jwar http://repo1.maven.org/maven2/org/eclipse/rdf4j/rdf4j-http-server/${RDF4J_VERSION}/rdf4j-http-server-${RDF4J_VERSION}.war || exit 110
fi
- echo "Sesame http server deployed at http://rya-example-box:8080/openrdf-sesame"
+ echo "RDF4J http server deployed at http://rya-example-box:8080/rdf4j-server"
- echo "Installing Sesame Workbench"
- workbench=/var/lib/tomcat7/webapps/openrdf-workbench.war
+ echo "Installing RDF4J Workbench"
+ workbench=/var/lib/tomcat7/webapps/rdf4j-workbench.war
if [[ ! -s $workbench ]] ; then
echo "Downloading"
- download --output $workbench http://repo1.maven.org/maven2/org/openrdf/sesame/sesame-http-workbench/${SESAME_VERSION}/sesame-http-workbench-${SESAME_VERSION}.war || exit 111
+ download --output $workbench http://repo1.maven.org/maven2/org/eclipse/rdf4j/rdf4j-http-workbench/${RDF4J_VERSION}/rdf4j-http-workbench-${RDF4J_VERSION}.war || exit 111
fi
- echo "Sesame workbench deployed at http://rya-example-box:8080/openrdf-workbench"
+ echo "RDF4J workbench deployed at http://rya-example-box:8080/rdf4j-workbench"
echo "Installing Rya"
ryaIndexing=rya.indexing.example-${RYA_EXAMPLE_VERSION}-distribution
@@ -319,23 +319,23 @@ EOF
sudo unzip -q -o ${ryaIndexing}.zip -d ${ryaIndexing}
# before continueing, wait for tomcat to deploy wars:
- waitForDeploy /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/
- waitForDeploy /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/
+ waitForDeploy /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/
+ waitForDeploy /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/
# soft linking the files doesn't seem to work in tomcat, so we copy them instead :(
- sudo cp ${ryaIndexing}/dist/lib/* /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/ || exit 113
- sudo cp ${ryaIndexing}/dist/lib/* /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/ || exit 114
+ sudo cp ${ryaIndexing}/dist/lib/* /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/ || exit 113
+ sudo cp ${ryaIndexing}/dist/lib/* /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/ || exit 114
# These are older libs that breaks tomcat 7
- sudo rm --force /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/servlet-api-2.5.jar
- sudo rm --force /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/jsp-api-2.1.jar
- sudo rm --force /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/servlet-api-2.5.jar
- sudo rm --force /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/jsp-api-2.1.jar
+ sudo rm --force /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/servlet-api-2.5.jar
+ sudo rm --force /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/jsp-api-2.1.jar
+ sudo rm --force /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/servlet-api-2.5.jar
+ sudo rm --force /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/jsp-api-2.1.jar
- sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/
- sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/
+ sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/
+ sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/
- echo "Downloading and installing new templates for OpenRdf WorkBench"
+ echo "Downloading and installing new templates for RDF4J WorkBench"
ryaVagrant=rya.vagrant.example-${RYA_EXAMPLE_VERSION}
if [[ ! -s ${ryaVagrant}.jar ]] ; then
echo "Downloading"
@@ -343,8 +343,8 @@ EOF
fi
sudo mkdir --parents ${ryaVagrant}
sudo unzip -q -o ${ryaVagrant}.jar -d ${ryaVagrant}
- sudo cp ${ryaVagrant}/*.xsl /var/lib/tomcat7/webapps/openrdf-workbench/transformations/
- sudo chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/openrdf-workbench/transformations/*
+ sudo cp ${ryaVagrant}/*.xsl /var/lib/tomcat7/webapps/rdf4j-workbench/transformations/
+ sudo chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/rdf4j-workbench/transformations/*
echo "Deploying Rya Web"
ryaWar=web.rya-${RYA_EXAMPLE_VERSION}.war
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/vagrantExample/src/main/vagrant/readme.md
----------------------------------------------------------------------
diff --git a/extras/vagrantExample/src/main/vagrant/readme.md b/extras/vagrantExample/src/main/vagrant/readme.md
index 235d28d..dcfcf8d 100644
--- a/extras/vagrantExample/src/main/vagrant/readme.md
+++ b/extras/vagrantExample/src/main/vagrant/readme.md
@@ -21,7 +21,7 @@
# Rya Vagrant Example Documentation
-The Rya Vagrant Example project allows users to quickly get up and running on Rya using a Virtual Machine. Specifically, this project uses Vagrant to create a VM, install Rya on Accumulo, and configure the OpenRDF Workbench Web Application to use Rya.
+The Rya Vagrant Example project allows users to quickly get up and running on Rya using a Virtual Machine. Specifically, this project uses Vagrant to create a VM, install Rya on Accumulo, and configure the RDF4J Workbench Web Application to use Rya.
## Setting up the VM
@@ -49,9 +49,9 @@ By default, the VM should be assigned the IP address of `192.168.33.10`. This v
1. **Verify the Tomcat instance**: Open a browser to <http://rya-example-box:8080/>. You should see a webpage that says “It works! If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
-1. **Verify the deployed OpenRDF Sesame service**: Open your browser to <http://rya-example-box:8080/openrdf-sesame/protocol> and you should see a `6` (this is the OpenRDF Protocol Version).
+1. **Verify the deployed RDF4J Server service**: Open your browser to <http://rya-example-box:8080/rdf4j-server/protocol> and you should see a `6` (this is the RDF4J Protocol Version).
-1. **Verify the deployed OpenRDF Workbench**: Open your browser to <http://rya-example-box:8080/openrdf-workbench>
+1. **Verify the deployed RDF4J Workbench**: Open your browser to <http://rya-example-box:8080/rdf4j-workbench>
1. **Verify the deployed Rya Web**: Open your browser to <http://rya-example-box:8080/web.rya/sparqlQuery.jsp>
@@ -74,15 +74,15 @@ the Vagrantfile.
Run these two commands and see if you have any Rya files in the two lib directories:
```
- ls /var/lib/tomcat7/webapps/openrdf-sesame/WEB-INF/lib/rya*
- ls /var/lib/tomcat7/webapps/openrdf-workbench/WEB-INF/lib/rya*
+ ls /var/lib/tomcat7/webapps/rdf4j-server/WEB-INF/lib/rya*
+ ls /var/lib/tomcat7/webapps/rdf4j-workbench/WEB-INF/lib/rya*
```
If these files do note exists, open the vagrant file and look for the line `echo "Downloading Rya"`. Try working through those commands manually on your Vagrant VM.
-#### OpenRDF Workbench transformations are not installed
+#### RDF4J Workbench transformations are not installed
-OpenRDF Workbench requires a set of "transformations" for listing Rya in the OpenRDF Workbench Repository list. The transforms are in this directory: /var/lib/tomcat7/webapps/openrdf-workbench/transformations/
+RDF4J Workbench requires a set of "transformations" for listing Rya in the RDF4J Workbench Repository list. The transforms are in this directory: /var/lib/tomcat7/webapps/rdf4j-workbench/transformations/
1. Verify that this file exists: create-RyaAccumuloSail.xsl
1. Verify that create.xsl has been updated for rya. (run: "cat create.xsl | grep Rya" and make sure there's some stuff there.)
@@ -183,30 +183,30 @@ From within the VM, run:
## Interacting with Rya on the VM
-### Connecting to Rya via OpenRDF Workbench
+### Connecting to Rya via RDF4J Workbench
-The first step to using Rya via the OpenRDF Workbench is to create a repository using the Rya Accumulo Store connector.
+The first step to using Rya via the RDF4J Workbench is to create a repository using the Rya Accumulo Store connector.
-1. Open your browser to the [OpenRDF Workbench](http://rya-example-box:8080/openrdf-workbench)
+1. Open your browser to the [RDF4j Workbench](http://rya-example-box:8080/rdf4j-workbench)
2. Click on `New Repository`
3. Choose "Type" of `Rya Accumulo Store`, a Repository "ID" (e.g., `RyaAccumulo`), and a Repository "Title" (e.g., `Rya Accumulo`). Click on `Next` when complete.
4. Enter the Rya Accumulo Store connection parameters. The default parameters will connect to the Rya Example Box Acccumulo deployment (i.e., Accumulo User: `root`, Accumulo Password: `root`, Accumulo Instance: `dev`, Zookeepers: `localhost`, is Mock?: `false`). Click on `Create` when complete.
-### Uploading Data via OpenRDF Workbench
+### Uploading Data via RDF4J Workbench
-Once we've created a Rya repository, we can load data into Rya via the OpenRDF Workbench.
+Once we've created a Rya repository, we can load data into Rya via the RDF4J Workbench.
-1. Open your browser to the [OpenRDF Workbench](http://rya-example-box:8080/openrdf-workbench)
-1. Verify that OpenRDF Workbench is connected to Rya. The OpenRDF Workbench screen should have `Current Selections: Repository: Rya Accumulo ( RyaAccumulo )` at the top of the page.
+1. Open your browser to the [RDF4J Workbench](http://rya-example-box:8080/rdf4j-workbench)
+1. Verify that RDF4J Workbench is connected to Rya. The RDF4j Workbench screen should have `Current Selections: Repository: Rya Accumulo ( RyaAccumulo )` at the top of the page.
2. Click on `Add` on the left side of the page.
3. This page allows a user to add data either through a local file (uploaded through the browser), cut-and-pasted RDF, or a file located on the web. For this example, let's choose a file on the web. Set "Data Format" to `RDF/XML` and "Location of the RDF data you wish to upload" to `http://telegraphis.net/data/currencies/currencies.rdf`. All other fields should remain empty. Click on `Upload` when complete.
-### Querying Data via OpenRDF Workbench
+### Querying Data via RDF4J Workbench
-Once we've created a Rya repository and uploaded data, we can query Rya via the OpenRDF Workbench.
+Once we've created a Rya repository and uploaded data, we can query Rya via the RDF4J Workbench.
-1. Open your browser to the [OpenRDF Workbench](http://rya-example-box:8080/openrdf-workbench)
-1. Verify that OpenRDF Workbench is connected to Rya. The OpenRDF Workbench screen should have `Current Selections: Repository: Rya Accumulo ( RyaAccumulo )` at the top of the page.
+1. Open your browser to the [RDF4J Workbench](http://rya-example-box:8080/rdf4j-workbench)
+1. Verify that RDF4J Workbench is connected to Rya. The RDF4J Workbench screen should have `Current Selections: Repository: Rya Accumulo ( RyaAccumulo )` at the top of the page.
1. Click on `Query` on the left side of the page.
1. Use the example SPARQL query below to query for Currencies with a Short Name of "dollar"
@@ -220,9 +220,10 @@ Once we've created a Rya repository and uploaded data, we can query Rya via the
}
```
-### Using the OpenRDF REST Service
+### Using the RDF4J REST Service
-More information about the Sesame REST HTTP Protocol is availible in the [OpenRDF 2.7 Docs] (http://rdf4j.org/sesame/2.7/docs/system.docbook?view#The_Sesame_REST_HTTP_Protocol)
+More information about the RDF4J REST HTTP Protocol is availible in the [RDF4J 2.3.1 Docs]
+(http://docs.rdf4j.org/rest-api/)
### Using Rya Java Client
TODO
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/pom.xml
----------------------------------------------------------------------
diff --git a/mapreduce/pom.xml b/mapreduce/pom.xml
index 98b4200..dc3cec4 100644
--- a/mapreduce/pom.xml
+++ b/mapreduce/pom.xml
@@ -60,16 +60,16 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-nquads</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-nquads</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/AbstractAccumuloMRTool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/AbstractAccumuloMRTool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/AbstractAccumuloMRTool.java
index 0e7cbc6..7489391 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/AbstractAccumuloMRTool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/AbstractAccumuloMRTool.java
@@ -19,13 +19,6 @@ package org.apache.rya.accumulo.mr;
* under the License.
*/
-import org.apache.rya.accumulo.AccumuloRdfConstants;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
-import org.apache.rya.api.RdfCloudTripleStoreUtils;
-import org.apache.rya.indexing.accumulo.ConfigUtils;
-
import java.io.IOException;
import org.apache.accumulo.core.client.AccumuloException;
@@ -45,7 +38,13 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.util.Tool;
-import org.openrdf.rio.RDFFormat;
+import org.apache.rya.accumulo.AccumuloRdfConstants;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
+import org.apache.rya.api.RdfCloudTripleStoreUtils;
+import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.rio.RDFFormat;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/MRUtils.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/MRUtils.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/MRUtils.java
index e985563..f826b71 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/MRUtils.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/MRUtils.java
@@ -1,5 +1,3 @@
-package org.apache.rya.accumulo.mr;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,6 +16,7 @@ package org.apache.rya.accumulo.mr;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.mr;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.mapreduce.InputFormatBase;
@@ -27,11 +26,11 @@ import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.rio.RDFFormat;
-
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.rio.RDFFormat;
/**
* Contains constants and static methods for interacting with a
@@ -114,7 +113,7 @@ public class MRUtils {
public static final String AC_TABLE_PROP = "ac.table";
public static final String HADOOP_IO_SORT_MB = "io.sort.mb";
- public static final ValueFactory vf = new ValueFactoryImpl();
+ public static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* Gets the TTL from a given Configuration.
@@ -200,7 +199,7 @@ public class MRUtils {
* @return The configured RDFFormat, or null if not set.
*/
public static RDFFormat getRDFFormat(Configuration conf) {
- return RDFFormat.valueOf(conf.get(FORMAT_PROP));
+ return RdfFormatUtils.getRdfFormatFromName(conf.get(FORMAT_PROP));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RdfFileInputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RdfFileInputFormat.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RdfFileInputFormat.java
index 27e38f2..84e0210 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RdfFileInputFormat.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RdfFileInputFormat.java
@@ -38,17 +38,18 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.KeyValueLineRecordReader;
import org.apache.log4j.Logger;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandler;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.Rio;
-
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandler;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.rio.RDFParser;
+import org.eclipse.rdf4j.rio.Rio;
/**
* {@link FileInputFormat} that can read multiple RDF files and convert into
@@ -124,7 +125,7 @@ public class RdfFileInputFormat extends FileInputFormat<LongWritable, RyaStateme
private RDFFormat getRDFFormat(JobContext context) {
String name = context.getConfiguration().get(FORMAT_PROP);
- return RDFFormat.valueOf(name);
+ return RdfFormatUtils.getRdfFormatFromName(name);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
index 0d42df2..0dd08b1 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaOutputFormat.java
@@ -62,8 +62,8 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.entity.EntityCentricIndex;
import org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
-import org.openrdf.model.Statement;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* {@link OutputFormat} that uses Rya, the {@link GeoIndexer}, the
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaTypeWritable.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaTypeWritable.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaTypeWritable.java
index ec47d82..be90180 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaTypeWritable.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/RyaTypeWritable.java
@@ -23,11 +23,10 @@ import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
-import org.apache.rya.api.domain.RyaType;
-
import org.apache.hadoop.io.WritableComparable;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.apache.rya.api.domain.RyaType;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
public class RyaTypeWritable implements WritableComparable<RyaTypeWritable>{
@@ -52,10 +51,10 @@ public class RyaTypeWritable implements WritableComparable<RyaTypeWritable>{
@Override
public void readFields(DataInput dataInput) throws IOException {
- ValueFactoryImpl vfi = new ValueFactoryImpl();
+ SimpleValueFactory vfi = SimpleValueFactory.getInstance();
String data = dataInput.readLine();
String dataTypeString = dataInput.readLine();
- URI dataType = vfi.createURI(dataTypeString);
+ IRI dataType = vfi.createIRI(dataTypeString);
ryatype.setData(data);
ryatype.setDataType(dataType);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
index ab42aab..593e568 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/examples/TextOutputExample.java
@@ -1,7 +1,3 @@
-package org.apache.rya.accumulo.mr.examples;
-
-import java.io.BufferedReader;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +16,9 @@ import java.io.BufferedReader;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.mr.examples;
+import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.Charset;
@@ -51,11 +49,11 @@ import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFWriter;
-import org.openrdf.rio.Rio;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFWriter;
+import org.eclipse.rdf4j.rio.Rio;
/**
* Example of using a MapReduce tool to get triples from a Rya instance and serialize them to a text file as RDF.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
index 5adb893..c2ad57a 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountTool.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo.mr.tools;
* under the License.
*/
-
-
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
@@ -49,8 +47,8 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.collect.Lists;
import com.google.common.io.ByteArrayDataInput;
@@ -130,7 +128,7 @@ public class AccumuloRdfCountTool extends AbstractAccumuloMRTool implements Tool
public static final byte[] EMPTY_BYTES = new byte[0];
private RdfCloudTripleStoreConstants.TABLE_LAYOUT tableLayout = RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
- ValueFactoryImpl vf = new ValueFactoryImpl();
+ SimpleValueFactory vf = SimpleValueFactory.getInstance();
private final Text keyOut = new Text();
private final LongWritable valOut = new LongWritable(1);
@@ -213,7 +211,7 @@ public class AccumuloRdfCountTool extends AbstractAccumuloMRTool implements Tool
Text row = new Text();
Text cat_txt = new Text();
Value v_out = new Value();
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
// any count lower than this does not need to be saved
public static final int TOO_LOW = 10;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/RdfFileInputTool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/RdfFileInputTool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/RdfFileInputTool.java
index 55c4365..c004f4e 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/RdfFileInputTool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/RdfFileInputTool.java
@@ -25,10 +25,9 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
-import org.openrdf.rio.RDFFormat;
-
import org.apache.rya.accumulo.mr.AbstractAccumuloMRTool;
import org.apache.rya.accumulo.mr.MRUtils;
+import org.eclipse.rdf4j.rio.RDFFormat;
/**
* Reads RDF data from one or more file(s) and inserts statements into Rya.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
index 4edc949..e271e27 100644
--- a/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
+++ b/mapreduce/src/main/java/org/apache/rya/accumulo/mr/tools/Upgrade322Tool.java
@@ -1,5 +1,3 @@
-package org.apache.rya.accumulo.mr.tools;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,11 +16,17 @@ package org.apache.rya.accumulo.mr.tools;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.mr.tools;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.DELIM;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.TBL_OSP_SUFFIX;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.TBL_PO_SUFFIX;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.TBL_PRFX_DEF;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.TBL_SPO_SUFFIX;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.TYPE_DELIM;
-
-import org.apache.rya.accumulo.mr.AbstractAccumuloMRTool;
-import org.apache.rya.accumulo.mr.MRUtils;
+import java.io.IOException;
+import java.util.Date;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
@@ -37,14 +41,11 @@ import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
+import org.apache.rya.accumulo.mr.AbstractAccumuloMRTool;
+import org.apache.rya.accumulo.mr.MRUtils;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
-import java.io.IOException;
-import java.util.Date;
-
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.*;
-
/**
*/
public class Upgrade322Tool extends AbstractAccumuloMRTool implements Tool {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RdfFileInputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RdfFileInputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RdfFileInputFormatTest.java
index c3bbbba..6129d6c 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RdfFileInputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RdfFileInputFormatTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.rya.accumulo.mr;
import java.io.File;
@@ -12,41 +30,21 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl;
+import org.apache.rya.api.resolver.RyaToRdfConversions;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.rio.RDFFormat;
-
-import org.apache.rya.api.resolver.RyaToRdfConversions;
-
-/*
- * 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.
- */
public class RdfFileInputFormatTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
static String NT_INPUT = "src/test/resources/test.ntriples";
static String TRIG_INPUT = "src/test/resources/namedgraphs.trig";
@@ -81,17 +79,17 @@ public class RdfFileInputFormatTest {
RdfFileInputFormat.setRDFFormat(job, RDFFormat.NTRIPLES);
init(NT_INPUT);
String prefix = "urn:lubm:rdfts#";
- URI[] gs = {
- new URIImpl(prefix + "GraduateStudent01"),
- new URIImpl(prefix + "GraduateStudent02"),
- new URIImpl(prefix + "GraduateStudent03"),
- new URIImpl(prefix + "GraduateStudent04")
+ IRI[] gs = {
+ VF.createIRI(prefix + "GraduateStudent01"),
+ VF.createIRI(prefix + "GraduateStudent02"),
+ VF.createIRI(prefix + "GraduateStudent03"),
+ VF.createIRI(prefix + "GraduateStudent04")
};
- URI hasFriend = new URIImpl(prefix + "hasFriend");
+ IRI hasFriend = VF.createIRI(prefix + "hasFriend");
Statement[] statements = {
- new StatementImpl(gs[0], hasFriend, gs[1]),
- new StatementImpl(gs[1], hasFriend, gs[2]),
- new StatementImpl(gs[2], hasFriend, gs[3])
+ VF.createStatement(gs[0], hasFriend, gs[1]),
+ VF.createStatement(gs[1], hasFriend, gs[2]),
+ VF.createStatement(gs[2], hasFriend, gs[3])
};
int count = 0;
while (reader.nextKeyValue()) {
@@ -109,11 +107,11 @@ public class RdfFileInputFormatTest {
init(TRIG_INPUT);
Assert.assertTrue(reader.nextKeyValue());
Assert.assertEquals(1, reader.getCurrentKey().get());
- Statement expected = new ContextStatementImpl(
- new URIImpl("http://www.example.org/exampleDocument#Monica"),
- new URIImpl("http://www.example.org/vocabulary#name"),
- new LiteralImpl("Monica Murphy"),
- new URIImpl("http://www.example.org/exampleDocument#G1"));
+ Statement expected = VF.createStatement(
+ VF.createIRI("http://www.example.org/exampleDocument#Monica"),
+ VF.createIRI("http://www.example.org/vocabulary#name"),
+ VF.createLiteral("Monica Murphy"),
+ VF.createIRI("http://www.example.org/exampleDocument#G1"));
Statement actual = RyaToRdfConversions.convertStatement(
reader.getCurrentValue().getRyaStatement());
Assert.assertEquals(expected, actual);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
index 96f57f6..e0a7ac0 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaOutputFormatTest.java
@@ -36,15 +36,14 @@ import org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer;
import org.apache.rya.indexing.accumulo.freetext.SimpleTokenizer;
import org.apache.rya.indexing.accumulo.freetext.Tokenizer;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import info.aduna.iteration.CloseableIteration;
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -224,7 +223,7 @@ public class RyaOutputFormatTest {
RyaOutputFormat.setFreeTextEnabled(job, false);
RyaOutputFormat.setTemporalEnabled(job, true);
RyaOutputFormat.setEntityEnabled(job, false);
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
for (int i = 0; i < instants.length; i++) {
final RyaType time = RdfToRyaConversions.convertLiteral(vf.createLiteral(instants[i].toString()));
final RyaStatement input = RyaStatement.builder()
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
index 29639c2..98d36c9 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/RyaStatementWritableTest.java
@@ -5,17 +5,16 @@ import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.junit.Assert;
-import org.junit.Rule;
-
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaTripleContext;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
/*
* Licensed to the Apache Software Foundation (ASF) under one
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
index 9b7fa22..30c6a7a 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/AccumuloRdfCountToolTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya.accumulo.mr.tools;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,16 +16,14 @@ package org.apache.rya.accumulo.mr.tools;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.mr.tools;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import java.util.HashMap;
+import java.util.Map;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.accumulo.mr.tools.AccumuloRdfCountTool;
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Scanner;
@@ -40,18 +36,17 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.resolver.RdfToRyaConversions;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
/**
* Created by IntelliJ IDEA.
@@ -70,7 +65,7 @@ public class AccumuloRdfCountToolTest {
private Connector connector;
private AccumuloRyaDAO dao;
- private ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
static String litdupsNS = "urn:test:litdups#";
@@ -110,19 +105,19 @@ public class AccumuloRdfCountToolTest {
@Test
public void testMR() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "pred1"));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(0))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(1))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(2))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(3))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(4))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(5))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(6))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(7))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(8))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(9))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(10))));
+ RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
+ RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(3))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(4))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(5))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(6))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(7))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(8))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(9))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(10))));
AccumuloRdfCountTool.main(new String[]{
"-Dac.mock=true",
@@ -155,19 +150,19 @@ public class AccumuloRdfCountToolTest {
}
// public void testMRObject() throws Exception {
-// URI pred1 = vf.createURI(litdupsNS, "pred1");
-// Literal literal = vf.createLiteral(0);
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test0"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test1"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test2"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test3"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test4"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test5"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test6"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test7"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test8"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test9"), pred1, literal));
-// dao.add(new StatementImpl(vf.createURI(litdupsNS, "test10"), pred1, literal));
+// URI pred1 = VF.createIRI(litdupsNS, "pred1");
+// Literal literal = VF.createLiteral(0);
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test0"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test1"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test2"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test3"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test4"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test5"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test6"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test7"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test8"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test9"), pred1, literal));
+// dao.add(new StatementImpl(VF.createIRI(litdupsNS, "test10"), pred1, literal));
// dao.commit();
//
// AccumuloRdfCountTool.main(new String[]{
@@ -202,19 +197,19 @@ public class AccumuloRdfCountToolTest {
@Test
public void testTTL() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "pred1"));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(0))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(1))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(2))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(3))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(4))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(5))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(6))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(7))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(8))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(9))));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(10))));
+ RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
+ RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(3))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(4))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(5))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(6))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(7))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(8))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(9))));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(10))));
AccumuloRdfCountTool.main(new String[]{
"-Dac.mock=true",
@@ -236,20 +231,20 @@ public class AccumuloRdfCountToolTest {
@Test
public void testContext() throws Exception {
- RyaURI test1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "test1"));
- RyaURI pred1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "pred1"));
- RyaURI cntxt = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "cntxt"));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(0)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(1)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(2)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(3)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(4)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(5)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(6)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(7)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(8)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(9)), cntxt));
- dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(vf.createLiteral(10)), cntxt));
+ RyaURI test1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "test1"));
+ RyaURI pred1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred1"));
+ RyaURI cntxt = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cntxt"));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(0)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(1)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(2)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(3)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(4)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(5)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(6)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(7)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(8)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(9)), cntxt));
+ dao.add(new RyaStatement(test1, pred1, RdfToRyaConversions.convertLiteral(VF.createLiteral(10)), cntxt));
AccumuloRdfCountTool.main(new String[]{
"-Dac.mock=true",
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
index 6b41ca2..b8b2384 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/RdfFileInputToolTest.java
@@ -19,23 +19,21 @@ package org.apache.rya.accumulo.mr.tools;
* under the License.
*/
+import junit.framework.TestCase;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
-import org.junit.Test;
-import org.openrdf.rio.RDFFormat;
-
-import junit.framework.TestCase;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.mr.TestUtils;
-import org.apache.rya.accumulo.mr.tools.RdfFileInputTool;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.junit.Test;
/**
* Created by IntelliJ IDEA.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
index f740cc0..cfdbeb7 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/Upgrade322ToolTest.java
@@ -1,23 +1,3 @@
-package org.apache.rya.accumulo.mr.tools;
-
-import java.util.Map;
-
-import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.BatchWriterConfig;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.admin.SecurityOperations;
-import org.apache.accumulo.core.client.mock.MockInstance;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.TablePermission;
-import org.openrdf.model.vocabulary.XMLSchema;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -36,19 +16,35 @@ import org.openrdf.model.vocabulary.XMLSchema;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.mr.tools;
+import java.util.Map;
-
-import junit.framework.TestCase;
+import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.admin.SecurityOperations;
+import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.TablePermission;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.accumulo.mr.TestUtils;
-import org.apache.rya.accumulo.mr.tools.Upgrade322Tool;
import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+
+import junit.framework.TestCase;
/**
* Created by IntelliJ IDEA.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/UpgradeObjectSerializationTest.java
----------------------------------------------------------------------
diff --git a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/UpgradeObjectSerializationTest.java b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/UpgradeObjectSerializationTest.java
index f7096e3..b14587c 100644
--- a/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/UpgradeObjectSerializationTest.java
+++ b/mapreduce/src/test/java/org/apache/rya/accumulo/mr/tools/UpgradeObjectSerializationTest.java
@@ -19,14 +19,18 @@ package org.apache.rya.accumulo.mr.tools;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import org.apache.rya.accumulo.mr.tools.Upgrade322Tool.UpgradeObjectSerialization;
-import org.apache.rya.api.resolver.impl.*;
+import org.apache.rya.api.resolver.impl.BooleanRyaTypeResolver;
+import org.apache.rya.api.resolver.impl.ByteRyaTypeResolver;
+import org.apache.rya.api.resolver.impl.DateTimeRyaTypeResolver;
+import org.apache.rya.api.resolver.impl.DoubleRyaTypeResolver;
+import org.apache.rya.api.resolver.impl.IntegerRyaTypeResolver;
+import org.apache.rya.api.resolver.impl.LongRyaTypeResolver;
import org.junit.Test;
-import static org.apache.rya.accumulo.mr.tools.Upgrade322Tool.UpgradeObjectSerialization;
-import static org.junit.Assert.*;
-
public class UpgradeObjectSerializationTest {
@Test
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/alx.rya.console/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/alx.rya.console/pom.xml b/osgi/alx.rya.console/pom.xml
index 72ee63a..e078e0d 100644
--- a/osgi/alx.rya.console/pom.xml
+++ b/osgi/alx.rya.console/pom.xml
@@ -39,8 +39,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-repository-api</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-repository-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/AbstractRyaCommand.java
----------------------------------------------------------------------
diff --git a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/AbstractRyaCommand.java b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/AbstractRyaCommand.java
index 0d3ac97..c4c4705 100644
--- a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/AbstractRyaCommand.java
+++ b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/AbstractRyaCommand.java
@@ -19,11 +19,9 @@ package org.apache.rya.alx.command;
* under the License.
*/
-
-
-import org.apache.rya.api.persist.RyaDAO;
import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.openrdf.repository.Repository;
+import org.apache.rya.api.persist.RyaDAO;
+import org.eclipse.rdf4j.repository.Repository;
import org.osgi.util.tracker.ServiceTracker;
public abstract class AbstractRyaCommand extends OsgiCommandSupport {
[10/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
index d1a7236..fabc074 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Schema.java
@@ -19,18 +19,18 @@ package org.apache.rya.reasoning;
* under the License.
*/
-import java.util.HashSet;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
/**
* Hold on to facts about the schema (TBox/RBox) and perform what reasoning we
@@ -56,8 +56,8 @@ import org.openrdf.model.vocabulary.OWL;
public class Schema {
// Statements using these predicates are automatically relevant schema
// information.
- private static final Set<URI> schemaPredicates = new HashSet<>();
- private static final URI[] schemaPredicateURIs = {
+ private static final Set<IRI> schemaPredicates = new HashSet<>();
+ private static final IRI[] schemaPredicateURIs = {
RDFS.SUBCLASSOF,
RDFS.SUBPROPERTYOF,
RDFS.DOMAIN,
@@ -89,7 +89,7 @@ public class Schema {
};
static {
- for (URI uri : schemaPredicateURIs) {
+ for (IRI uri : schemaPredicateURIs) {
schemaPredicates.add(uri);
}
for (Resource uri : schemaTypeURIs) {
@@ -102,7 +102,7 @@ public class Schema {
* information?
*/
public static boolean isSchemaTriple(Statement triple) {
- URI pred = triple.getPredicate();
+ IRI pred = triple.getPredicate();
// Triples with certain predicates are schema triples,
if (schemaPredicates.contains(pred)) {
return true;
@@ -119,7 +119,7 @@ public class Schema {
/**
* Map URIs to schema information about a property
*/
- protected Map<URI, OwlProperty> properties = new HashMap<>();
+ protected Map<IRI, OwlProperty> properties = new HashMap<>();
/**
* Map Resources to schema information about a class/restriction
@@ -149,7 +149,7 @@ public class Schema {
* Get schema information for a property, for reading and writing.
* Instantiates OwlProperty if it doesn't yet exist.
*/
- public OwlProperty getProperty(URI p) {
+ public OwlProperty getProperty(IRI p) {
if (!properties.containsKey(p)) {
properties.put(p, new OwlProperty(p));
}
@@ -161,13 +161,13 @@ public class Schema {
* Assumes this Value refers to a property URI.
*/
public OwlProperty getProperty(Value p) {
- return getProperty((URI) p);
+ return getProperty((IRI) p);
}
/**
* Return whether this resource corresponds to a property.
*/
- public boolean hasProperty(URI r) {
+ public boolean hasProperty(IRI r) {
return properties.containsKey(r);
}
@@ -193,14 +193,14 @@ public class Schema {
*/
public void processTriple(Statement triple) {
Resource s = triple.getSubject();
- URI p = triple.getPredicate();
+ IRI p = triple.getPredicate();
Value o = triple.getObject();
if (isSchemaTriple(triple)) {
// For a type statement to be schema information, it must yield
// some boolean information about a property.
if (p.equals(RDF.TYPE)) {
if (schemaTypes.contains(o)) {
- addPropertyType((URI) s, (Resource) o);
+ addPropertyType((IRI) s, (Resource) o);
}
}
@@ -288,7 +288,7 @@ public class Schema {
/**
* Add a particular characteristic to a property.
*/
- private void addPropertyType(URI p, Resource t) {
+ private void addPropertyType(IRI p, Resource t) {
OwlProperty prop = getProperty(p);
if (t.equals(OWL.TRANSITIVEPROPERTY)) {
prop.setTransitive();
@@ -367,7 +367,7 @@ public class Schema {
// schema-relevant triple at all.
if (isSchemaTriple(triple)) {
Resource s = triple.getSubject();
- URI p = triple.getPredicate();
+ IRI p = triple.getPredicate();
Value o = triple.getObject();
// If this is telling us something about a property:
if (properties.containsKey(s)) {
@@ -509,7 +509,7 @@ public class Schema {
if (classes.containsKey(type)) {
OwlClass pr = classes.get(type);
sb.append("owl:Restriction");
- for (URI p : pr.getOnProperty()) {
+ for (IRI p : pr.getOnProperty()) {
sb.append(" (owl:onProperty ").append(p.toString()).append(")");
}
for (Value v : pr.hasValue()) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
index 35009ab..8ccc774 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/TypeReasoner.java
@@ -19,18 +19,17 @@ package org.apache.rya.reasoning;
* under the License.
*/
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
/**
* Keep track of a single node's types and do reasoning about its types.
@@ -125,7 +124,7 @@ public class TypeReasoner extends AbstractReasoner {
}
}
// Apply property restriction rules:
- for (URI prop : c.getOnProperty()) {
+ for (IRI prop : c.getOnProperty()) {
// RL rule cls-hv1: if type is an owl:hasValue restriction
for (Value val : c.hasValue()) {
collect(triple(node, prop, val, OwlRule.CLS_HV1, typeFact));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/AbstractReasoningTool.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/AbstractReasoningTool.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/AbstractReasoningTool.java
index abb300d..c81c6fe 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/AbstractReasoningTool.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/AbstractReasoningTool.java
@@ -21,13 +21,6 @@ package org.apache.rya.reasoning.mr;
import java.io.IOException;
-import org.apache.rya.accumulo.mr.RyaStatementWritable;
-import org.apache.rya.accumulo.mr.RdfFileInputFormat;
-import org.apache.rya.accumulo.mr.MRUtils;
-import org.apache.rya.reasoning.Derivation;
-import org.apache.rya.reasoning.Fact;
-import org.apache.rya.reasoning.Schema;
-
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
import org.apache.accumulo.core.data.Key;
@@ -53,7 +46,13 @@ import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.Tool;
-import org.openrdf.rio.RDFFormat;
+import org.apache.rya.accumulo.mr.MRUtils;
+import org.apache.rya.accumulo.mr.RdfFileInputFormat;
+import org.apache.rya.accumulo.mr.RyaStatementWritable;
+import org.apache.rya.reasoning.Derivation;
+import org.apache.rya.reasoning.Fact;
+import org.apache.rya.reasoning.Schema;
+import org.eclipse.rdf4j.rio.RDFFormat;
/**
* Contains common functionality for MapReduce jobs involved in reasoning. A
@@ -62,7 +61,7 @@ import org.openrdf.rio.RDFFormat;
*/
abstract public class AbstractReasoningTool extends Configured implements Tool {
// Keep track of statistics about the input
- protected static enum COUNTERS { ABOX, TBOX, USEFUL };
+ protected enum COUNTERS { ABOX, TBOX, USEFUL }
// MapReduce job, to be configured by subclasses
protected Job job;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
index 420683f..34c8c44 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ConformanceTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya.reasoning.mr;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,6 +16,7 @@ package org.apache.rya.reasoning.mr;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.reasoning.mr;
import java.io.BufferedReader;
import java.io.File;
@@ -44,27 +43,28 @@ import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.api.path.PathUtils;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
import org.apache.rya.reasoning.Fact;
import org.apache.rya.reasoning.Schema;
-import org.openrdf.OpenRDFException;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.helpers.RDFHandlerBase;
-import org.openrdf.rio.ntriples.NTriplesParser;
-import org.openrdf.rio.rdfxml.RDFXMLParser;
-import org.openrdf.sail.memory.MemoryStore;
+import org.eclipse.rdf4j.RDF4JException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
+import org.eclipse.rdf4j.rio.ntriples.NTriplesParser;
+import org.eclipse.rdf4j.rio.rdfxml.RDFXMLParser;
+import org.eclipse.rdf4j.sail.memory.MemoryStore;
/**
* Test the reasoner against Owl conformance tests in the database.
@@ -86,7 +86,7 @@ public class ConformanceTest extends Configured implements Tool {
static String TEST_SEMANTICS = TEST + "semantics";
static String TEST_RDFBASED = TEST + "RDF-BASED";
- private static class OwlTest extends RDFHandlerBase {
+ private static class OwlTest extends AbstractRDFHandler {
Value uri;
String name;
String description;
@@ -125,7 +125,7 @@ public class ConformanceTest extends Configured implements Tool {
}
}
- private static class OutputCollector extends RDFHandlerBase {
+ private static class OutputCollector extends AbstractRDFHandler {
Set<Statement> triples = new HashSet<>();
@Override
public void handleStatement(final Statement st) {
@@ -170,7 +170,7 @@ public class ConformanceTest extends Configured implements Tool {
RDFFormat inputFormat= RDFFormat.RDFXML;
final String formatString = conf.get(MRUtils.FORMAT_PROP);
if (formatString != null) {
- inputFormat = RDFFormat.valueOf(formatString);
+ inputFormat = RdfFormatUtils.getRdfFormatFromName(formatString);
}
repo = new SailRepository(new MemoryStore());
repo.initialize();
@@ -250,7 +250,7 @@ public class ConformanceTest extends Configured implements Tool {
/**
* Verify that we can infer the correct triples or detect an inconsistency.
* @param conf Specifies working directory, etc.
- * @param OwlTest Contains premise/conclusion graphs, will store result
+ * @param test Contains premise/conclusion graphs, will store result
* @return Return value of the MapReduce job
*/
int runTest(final Configuration conf, final String[] args, final OwlTest test)
@@ -341,7 +341,7 @@ public class ConformanceTest extends Configured implements Tool {
* test type.
*/
Set<Value> getTestURIs(final RepositoryConnection conn, final String testType)
- throws IOException, OpenRDFException {
+ throws IOException, RDF4JException {
final Set<Value> testURIs = new HashSet<>();
final TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL,
"select ?test where { " +
@@ -362,7 +362,7 @@ public class ConformanceTest extends Configured implements Tool {
* Query a connection for conformance test details.
*/
Collection<OwlTest> getTests(final RepositoryConnection conn, final Set<Value> testURIs)
- throws IOException, OpenRDFException {
+ throws IOException, RDF4JException {
final Map<Value, OwlTest> tests = new HashMap<>();
final TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL,
"select * where { " +
@@ -419,7 +419,7 @@ public class ConformanceTest extends Configured implements Tool {
*/
boolean triviallyTrue(final Statement triple, final Schema schema) {
final Resource s = triple.getSubject();
- final URI p = triple.getPredicate();
+ final IRI p = triple.getPredicate();
final Value o = triple.getObject();
if (p.equals(RDF.TYPE)) {
if (o.equals(OWL.ONTOLOGY)) {
@@ -430,9 +430,9 @@ public class ConformanceTest extends Configured implements Tool {
}
else if ((o.equals(OWL.OBJECTPROPERTY)
|| o.equals(OWL.DATATYPEPROPERTY))
- && s instanceof URI) {
+ && s instanceof IRI) {
// Distinction not maintained, irrelevant to RL rules
- return schema.hasProperty((URI) s);
+ return schema.hasProperty((IRI) s);
}
}
return false;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ForwardChain.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ForwardChain.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ForwardChain.java
index 7c58638..9e1be47 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ForwardChain.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ForwardChain.java
@@ -21,13 +21,6 @@ package org.apache.rya.reasoning.mr;
import java.io.IOException;
-import org.apache.rya.accumulo.mr.RyaStatementWritable;
-import org.apache.rya.reasoning.Derivation;
-import org.apache.rya.reasoning.LocalReasoner;
-import org.apache.rya.reasoning.LocalReasoner.Relevance;
-import org.apache.rya.reasoning.Fact;
-import org.apache.rya.reasoning.Schema;
-
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.conf.Configuration;
@@ -39,7 +32,13 @@ import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.output.MultipleOutputs;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Logger;
-import org.openrdf.model.Resource;
+import org.apache.rya.accumulo.mr.RyaStatementWritable;
+import org.apache.rya.reasoning.Derivation;
+import org.apache.rya.reasoning.Fact;
+import org.apache.rya.reasoning.LocalReasoner;
+import org.apache.rya.reasoning.LocalReasoner.Relevance;
+import org.apache.rya.reasoning.Schema;
+import org.eclipse.rdf4j.model.Resource;
public class ForwardChain extends AbstractReasoningTool {
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
index 158fe32..06f0d20 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/ResourceWritable.java
@@ -25,8 +25,8 @@ import java.io.IOException;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;
-import org.openrdf.model.Resource;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* Allows us to use a URI or bnode for a key.
@@ -68,10 +68,10 @@ public class ResourceWritable implements WritableComparable<ResourceWritable> {
String s = in.readUTF();
if (s.length() > 0) {
if (s.startsWith("_")) {
- val = ValueFactoryImpl.getInstance().createBNode(s.substring(2));
+ val = SimpleValueFactory.getInstance().createBNode(s.substring(2));
}
else {
- val = ValueFactoryImpl.getInstance().createURI(s);
+ val = SimpleValueFactory.getInstance().createIRI(s);
}
}
key = in.readInt();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/SchemaWritable.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/SchemaWritable.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/SchemaWritable.java
index 97e3c78..87b6e4f 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/SchemaWritable.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/mr/SchemaWritable.java
@@ -68,8 +68,8 @@ public class SchemaWritable extends Schema implements Writable {
org.apache.rya.reasoning.OwlProperty.class, //
java.util.HashSet.class, //
org.apache.rya.reasoning.OwlClass.class, //
- org.openrdf.model.impl.URIImpl.class, //
- org.openrdf.model.impl.BNodeImpl.class);
+ org.eclipse.rdf4j.model.impl.SimpleIRI.class, //
+ org.eclipse.rdf4j.model.impl.SimpleBNode.class);
try {
Iterable<?> propList = (Iterable<?>) vois.readObject();
Iterable<?> classList = (Iterable<?>) vois.readObject();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/LocalReasonerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/LocalReasonerTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/LocalReasonerTest.java
index 8ed850a..9f81cb4 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/LocalReasonerTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/LocalReasonerTest.java
@@ -19,17 +19,16 @@ package org.apache.rya.reasoning;
* under the License.
*/
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SKOS;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.SKOS;
-
public class LocalReasonerTest {
private LocalReasoner reasoner;
private Schema schema;
@@ -479,8 +478,8 @@ public class LocalReasonerTest {
*/
@Test
public void testMaxCardinalityZero() throws Exception {
- URI r = TestUtils.uri("restriction");
- URI p = TestUtils.uri("impossiblePredicate1");
+ IRI r = TestUtils.uri("restriction");
+ IRI p = TestUtils.uri("impossiblePredicate1");
schema.processTriple(TestUtils.statement(r, OWL.MAXCARDINALITY,
TestUtils.intLiteral("0")));
schema.processTriple(TestUtils.statement(r, OWL.ONPROPERTY, p));
@@ -497,7 +496,7 @@ public class LocalReasonerTest {
@Test
public void testMaxQCardinalityZeroThings() throws Exception {
Resource r = TestUtils.bnode("restriction");
- URI p = TestUtils.uri("impossiblePredicate2");
+ IRI p = TestUtils.uri("impossiblePredicate2");
schema.processTriple(TestUtils.statement(r, OWL2.MAXQUALIFIEDCARDINALITY,
TestUtils.intLiteral("0")));
schema.processTriple(TestUtils.statement(r, OWL.ONPROPERTY, p));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/ReasonerFactTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/ReasonerFactTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/ReasonerFactTest.java
index 8b105c5..3c4636b 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/ReasonerFactTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/ReasonerFactTest.java
@@ -25,20 +25,19 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.util.ArrayList;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDFS;
-
public class ReasonerFactTest {
static final String wordnet = "http://www.w3.org/2006/03/wn/wn20/instances/";
static final String wnSchema = "http://www.w3.org/2006/03/wn/wn20/schema/";
- static final URI[] nodes = {
+ static final IRI[] nodes = {
TestUtils.uri(wordnet, "synset-entity-noun-1"),
TestUtils.uri(wordnet, "synset-physical_entity-noun-1"),
TestUtils.uri(wordnet, "synset-object-noun-1"),
@@ -49,7 +48,7 @@ public class ReasonerFactTest {
TestUtils.uri(wordnet, "synset-engineer-noun-1"),
TestUtils.uri(wordnet, "synset-programmer-noun-1")
};
- static final URI hyper = TestUtils.uri(wnSchema, "hypernymOf");
+ static final IRI hyper = TestUtils.uri(wnSchema, "hypernymOf");
static final Schema schema = new Schema();
static final ArrayList<ArrayList<Fact>> hierarchy = new ArrayList<>();
static final int MAX_LEVEL = 3;
@@ -140,7 +139,7 @@ public class ReasonerFactTest {
public void testTripleInequality() {
Fact a = hierarchy.get(2).get(0);
Fact b = a.clone();
- Statement stmt = new StatementImpl(TestUtils.uri(a.getSubject().stringValue()),
+ Statement stmt = SimpleValueFactory.getInstance().createStatement(TestUtils.uri(a.getSubject().stringValue()),
a.getPredicate(), a.getObject()); // subject will have extra prefix
b.setTriple(stmt);
Assert.assertFalse("Triple equality should be based on (s, p, o)", a.equals(b));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaReasoningTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaReasoningTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaReasoningTest.java
index b936f5d..97b2343 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaReasoningTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaReasoningTest.java
@@ -19,15 +19,14 @@ package org.apache.rya.reasoning;
* under the License.
*/
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDFS;
-
/**
* Test the application of the OWL RL/RDF schema ("scm-") rules.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaTest.java
index 95500a3..00162a7 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/SchemaTest.java
@@ -1,15 +1,3 @@
-package org.apache.rya.reasoning;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.apache.rya.reasoning.mr.SchemaWritable;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -28,20 +16,31 @@ import org.apache.rya.reasoning.mr.SchemaWritable;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.reasoning;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import org.apache.rya.reasoning.mr.SchemaWritable;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SKOS;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SKOS;
public class SchemaTest implements Serializable {
private static final long serialVersionUID = -3616030386119902719L;
- URI lubm(String s) {
+ IRI lubm(String s) {
return TestUtils.uri("http://swat.cse.lehigh.edu/onto/univ-bench.owl", s);
}
@@ -320,8 +319,8 @@ public class SchemaTest implements Serializable {
@Test
public void testInputMaxCardinality() throws Exception {
Schema schema = new Schema();
- URI s = TestUtils.uri("x");
- URI p = OWL.MAXCARDINALITY;
+ IRI s = TestUtils.uri("x");
+ IRI p = OWL.MAXCARDINALITY;
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("7")));
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("4")));
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("-1")));
@@ -334,8 +333,8 @@ public class SchemaTest implements Serializable {
@Test
public void testInputMaxQualifiedCardinality() throws Exception {
Schema schema = new Schema();
- URI s = TestUtils.uri("x");
- URI p = OWL2.MAXQUALIFIEDCARDINALITY;
+ IRI s = TestUtils.uri("x");
+ IRI p = OWL2.MAXQUALIFIEDCARDINALITY;
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("-20")));
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("100")));
schema.processTriple(TestUtils.statement(s, p, TestUtils.stringLiteral("0")));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
index 86fe9a7..bec124b 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/TestUtils.java
@@ -21,38 +21,37 @@ package org.apache.rya.reasoning;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
-
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
public class TestUtils {
- private static final ValueFactory VALUE_FACTORY = new ValueFactoryImpl();
+ private static final ValueFactory VALUE_FACTORY = SimpleValueFactory.getInstance();
public static final String TEST_PREFIX = "http://test.test";
- public static final URI NODE = uri("http://thisnode.test", "x");
+ public static final IRI NODE = uri("http://thisnode.test", "x");
- public static URI uri(String prefix, String u) {
+ public static IRI uri(String prefix, String u) {
if (prefix.length() > 0) {
u = prefix + "#" + u;
}
- return VALUE_FACTORY.createURI(u);
+ return VALUE_FACTORY.createIRI(u);
}
- public static URI uri(String u) {
+ public static IRI uri(String u) {
return uri(TEST_PREFIX, u);
}
- public static Fact fact(Resource s, URI p, Value o) {
+ public static Fact fact(Resource s, IRI p, Value o) {
return new Fact(s, p, o);
}
- public static Statement statement(Resource s, URI p, Value o) {
+ public static Statement statement(Resource s, IRI p, Value o) {
return VALUE_FACTORY.createStatement(s, p, o);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/DuplicateEliminationTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/DuplicateEliminationTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/DuplicateEliminationTest.java
index 11c1d6c..30ced20 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/DuplicateEliminationTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/DuplicateEliminationTest.java
@@ -23,6 +23,12 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.NullWritable;
+import org.apache.hadoop.mrunit.mapreduce.MapDriver;
+import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import org.apache.rya.accumulo.mr.RyaStatementWritable;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
@@ -30,22 +36,15 @@ import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolver;
import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
import org.apache.rya.reasoning.Derivation;
-import org.apache.rya.reasoning.OwlRule;
import org.apache.rya.reasoning.Fact;
+import org.apache.rya.reasoning.OwlRule;
import org.apache.rya.reasoning.TestUtils;
-
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
-import org.apache.hadoop.io.LongWritable;
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mrunit.mapreduce.MapDriver;
-import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/ForwardChainTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/ForwardChainTest.java b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/ForwardChainTest.java
index 9bcee1b..759ede9 100644
--- a/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/ForwardChainTest.java
+++ b/extras/rya.reasoning/src/test/java/org/apache/rya/reasoning/mr/ForwardChainTest.java
@@ -24,17 +24,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import org.apache.rya.accumulo.mr.RyaStatementWritable;
-import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.resolver.triple.TripleRow;
-import org.apache.rya.api.resolver.triple.TripleRowResolver;
-import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
-import org.apache.rya.reasoning.OwlRule;
-import org.apache.rya.reasoning.Fact;
-import org.apache.rya.reasoning.Schema;
-import org.apache.rya.reasoning.TestUtils;
-
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.io.LongWritable;
@@ -44,13 +33,23 @@ import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import org.apache.hadoop.mrunit.mapreduce.ReduceFeeder;
import org.apache.hadoop.mrunit.types.KeyValueReuseList;
import org.apache.hadoop.mrunit.types.Pair;
+import org.apache.rya.accumulo.mr.RyaStatementWritable;
+import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.resolver.triple.TripleRow;
+import org.apache.rya.api.resolver.triple.TripleRowResolver;
+import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
+import org.apache.rya.reasoning.Fact;
+import org.apache.rya.reasoning.OwlRule;
+import org.apache.rya.reasoning.Schema;
+import org.apache.rya.reasoning.TestUtils;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -187,7 +186,7 @@ public class ForwardChainTest {
public void testTransitiveChain() throws Exception {
int max = 8;
int n = 4;
- URI prop = TestUtils.uri("subOrganizationOf");
+ IRI prop = TestUtils.uri("subOrganizationOf");
Map<Integer, Map<Integer, Pair<Fact, NullWritable>>> connections
= new HashMap<>();
for (int i = 0; i <= max; i++) {
@@ -195,8 +194,8 @@ public class ForwardChainTest {
}
// Initial input: make a chain from org0 to org8
for (int i = 0; i < max; i++) {
- URI orgI = TestUtils.uri("org" + i);
- URI orgJ = TestUtils.uri("org" + (i + 1));
+ IRI orgI = TestUtils.uri("org" + i);
+ IRI orgJ = TestUtils.uri("org" + (i + 1));
Fact triple = new Fact(orgI, prop, orgJ);
connections.get(i).put(i+1, new Pair<>(triple, NullWritable.get()));
}
@@ -232,8 +231,8 @@ public class ForwardChainTest {
// This includes any path of length k for appropriate k:
for (int k = minSpan; k <= maxSpan && j+k <= max; k++) {
int middle = j + minSpan - 1;
- URI left = TestUtils.uri("org" + j);
- URI right = TestUtils.uri("org" + (j + k));
+ IRI left = TestUtils.uri("org" + j);
+ IRI right = TestUtils.uri("org" + (j + k));
Fact triple = new Fact(left, prop,
right, i, OwlRule.PRP_TRP, TestUtils.uri("org" + middle));
triple.addSource(connections.get(j).get(middle).getFirst());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/api/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.streams/api/pom.xml b/extras/rya.streams/api/pom.xml
index 9253d01..22f9b21 100644
--- a/extras/rya.streams/api/pom.xml
+++ b/extras/rya.streams/api/pom.xml
@@ -41,8 +41,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryparser-sparql</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryparser-sparql</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/interactor/defaults/DefaultAddQuery.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/interactor/defaults/DefaultAddQuery.java b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/interactor/defaults/DefaultAddQuery.java
index 67edec0..c06a61c 100644
--- a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/interactor/defaults/DefaultAddQuery.java
+++ b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/interactor/defaults/DefaultAddQuery.java
@@ -24,8 +24,8 @@ import org.apache.rya.streams.api.entity.StreamsQuery;
import org.apache.rya.streams.api.exception.RyaStreamsException;
import org.apache.rya.streams.api.interactor.AddQuery;
import org.apache.rya.streams.api.queries.QueryRepository;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryChangeLog.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryChangeLog.java b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryChangeLog.java
index f0f628e..1563e2f 100644
--- a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryChangeLog.java
+++ b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryChangeLog.java
@@ -25,11 +25,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* An in memory implementation of {@link QueryChangeLog}. Anything that is stored in this change log will be
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryRepository.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryRepository.java b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryRepository.java
index c71f0f8..4544fbb 100644
--- a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryRepository.java
+++ b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/InMemoryQueryRepository.java
@@ -32,6 +32,7 @@ import java.util.stream.Collectors;
import org.apache.rya.streams.api.entity.StreamsQuery;
import org.apache.rya.streams.api.queries.QueryChangeLog.QueryChangeLogException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +40,6 @@ import com.google.common.util.concurrent.AbstractScheduledService;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* An in memory implementation of {@link QueryRepository}. It is lazily
@@ -262,7 +262,7 @@ public class InMemoryQueryRepository extends AbstractScheduledService implements
listeners.forEach(listener -> listener.notify(entry, newQueryState));
cachePosition = Optional.of( entry.getPosition() );
- log.debug("New chache position: " + cachePosition);
+ log.debug("New cache position: " + cachePosition);
}
} catch (final QueryChangeLogException e) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/QueryChangeLog.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/QueryChangeLog.java b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/QueryChangeLog.java
index 5765366..6accdf6 100644
--- a/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/QueryChangeLog.java
+++ b/extras/rya.streams/api/src/main/java/org/apache/rya/streams/api/queries/QueryChangeLog.java
@@ -18,9 +18,10 @@
*/
package org.apache.rya.streams.api.queries;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* An ordered log of all of the changes that have been applied to the SPARQL Queries that are managed by Rya Streams.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/pom.xml b/extras/rya.streams/client/pom.xml
index dc5009b..f93f6ac 100644
--- a/extras/rya.streams/client/pom.xml
+++ b/extras/rya.streams/client/pom.xml
@@ -50,28 +50,28 @@ under the License.
<!-- Statement formats we support for loading. -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-nquads</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-nquads</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-rdfxml</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-rdfxml</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-sparqljson</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-sparqljson</artifactId>
</dependency>
<!-- Third Party dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/AddQueryCommand.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/AddQueryCommand.java b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/AddQueryCommand.java
index 3886a95..f80b85a 100644
--- a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/AddQueryCommand.java
+++ b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/AddQueryCommand.java
@@ -33,7 +33,7 @@ import org.apache.rya.streams.api.queries.QueryRepository;
import org.apache.rya.streams.client.RyaStreamsCommand;
import org.apache.rya.streams.kafka.KafkaTopics;
import org.apache.rya.streams.kafka.queries.KafkaQueryChangeLogFactory;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java
index 783aedc..dcc2ce8 100644
--- a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java
+++ b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java
@@ -37,10 +37,10 @@ import org.apache.rya.streams.kafka.interactor.KafkaGetQueryResultStream;
import org.apache.rya.streams.kafka.queries.KafkaQueryChangeLogFactory;
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserializer;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Reduced;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Reduced;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/util/QueryResultsOutputUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/util/QueryResultsOutputUtil.java b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/util/QueryResultsOutputUtil.java
index 114a6fe..a05d596 100644
--- a/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/util/QueryResultsOutputUtil.java
+++ b/extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/util/QueryResultsOutputUtil.java
@@ -27,15 +27,15 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.VisibilityStatement;
import org.apache.rya.streams.api.entity.QueryResultStream;
import org.apache.rya.streams.api.exception.RyaStreamsException;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriter;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFWriter;
-import org.openrdf.rio.Rio;
-import org.openrdf.rio.WriterConfig;
-import org.openrdf.rio.helpers.BasicWriterSettings;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLResultsJSONWriter;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFWriter;
+import org.eclipse.rdf4j.rio.Rio;
+import org.eclipse.rdf4j.rio.WriterConfig;
+import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/LoadStatementsCommandIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/LoadStatementsCommandIT.java b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/LoadStatementsCommandIT.java
index 03c31b4..7e79fe4 100644
--- a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/LoadStatementsCommandIT.java
+++ b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/LoadStatementsCommandIT.java
@@ -36,15 +36,16 @@ import org.apache.rya.streams.kafka.KafkaTopics;
import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserializer;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
/**
* Integration tests the methods of {@link LoadStatementsCommand}.
*/
public class LoadStatementsCommandIT {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final Path TURTLE_FILE = Paths.get("src/test/resources/statements.ttl");
@@ -83,16 +84,15 @@ public class LoadStatementsCommandIT {
}
}
- final ValueFactory VF = ValueFactoryImpl.getInstance();
final List<VisibilityStatement> expected = new ArrayList<>();
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#alice"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#bob")),
+ VF.createStatement(VF.createIRI("http://example#alice"), VF.createIRI("http://example#talksTo"), VF.createIRI("http://example#bob")),
visibilities));
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#bob"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#charlie")),
+ VF.createStatement(VF.createIRI("http://example#bob"), VF.createIRI("http://example#talksTo"), VF.createIRI("http://example#charlie")),
visibilities));
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#charlie"), VF.createURI("http://example#likes"), VF.createURI("http://example#icecream")),
+ VF.createStatement(VF.createIRI("http://example#charlie"), VF.createIRI("http://example#likes"), VF.createIRI("http://example#icecream")),
visibilities));
// Show the written statements matches the read ones.
@@ -129,16 +129,15 @@ public class LoadStatementsCommandIT {
}
}
- final ValueFactory VF = ValueFactoryImpl.getInstance();
final List<VisibilityStatement> expected = new ArrayList<>();
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#alice"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#bob")),
+ VF.createStatement(VF.createIRI("http://example#alice"), VF.createIRI("http://example#talksTo"), VF.createIRI("http://example#bob")),
visibilities));
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#bob"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#charlie")),
+ VF.createStatement(VF.createIRI("http://example#bob"), VF.createIRI("http://example#talksTo"), VF.createIRI("http://example#charlie")),
visibilities));
expected.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#charlie"), VF.createURI("http://example#likes"), VF.createURI("http://example#icecream")),
+ VF.createStatement(VF.createIRI("http://example#charlie"), VF.createIRI("http://example#likes"), VF.createIRI("http://example#icecream")),
visibilities));
// Show the written statements matches the read ones.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java
index 6df7a3d..9fbc2c6 100644
--- a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java
+++ b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/command/RunQueryCommandIT.java
@@ -52,13 +52,13 @@ import org.apache.rya.streams.kafka.serialization.queries.QueryChangeDeserialize
import org.apache.rya.streams.kafka.serialization.queries.QueryChangeSerializer;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.AbstractScheduledService.Scheduler;
@@ -148,34 +148,34 @@ public class RunQueryCommandIT {
};
// Create the statements that will be loaded.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Alice"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:BurgerJoint")), "a"));
+ vf.createIRI("urn:Alice"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:BurgerJoint")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Bob"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Bob"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Charlie"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Charlie"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
// Create the expected results.
final List<VisibilityBindingSet> expected = new ArrayList<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Charlie"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Charlie"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
// Execute the test. This will result in a set of results that were read from the results topic.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/util/QueryResultsOutputUtilTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/util/QueryResultsOutputUtilTest.java b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/util/QueryResultsOutputUtilTest.java
index b82e671..be0db23 100644
--- a/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/util/QueryResultsOutputUtilTest.java
+++ b/extras/rya.streams/client/src/test/java/org/apache/rya/streams/client/util/QueryResultsOutputUtilTest.java
@@ -31,13 +31,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.VisibilityStatement;
import org.apache.rya.streams.api.entity.QueryResultStream;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.base.Charsets;
@@ -46,7 +46,7 @@ import com.google.common.base.Charsets;
*/
public class QueryResultsOutputUtilTest {
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void toNtriplesFile() throws Exception {
@@ -58,10 +58,10 @@ public class QueryResultsOutputUtilTest {
final List<VisibilityStatement> results = new ArrayList<>();
- Statement stmt = VF.createStatement(VF.createURI("urn:alice"), VF.createURI("urn:age"), VF.createLiteral(23));
+ Statement stmt = VF.createStatement(VF.createIRI("urn:alice"), VF.createIRI("urn:age"), VF.createLiteral(23));
results.add( new VisibilityStatement(stmt) );
- stmt = VF.createStatement(VF.createURI("urn:bob"), VF.createURI("urn:worksAt"), VF.createLiteral("Taco Shop"));
+ stmt = VF.createStatement(VF.createIRI("urn:bob"), VF.createIRI("urn:worksAt"), VF.createLiteral("Taco Shop"));
results.add( new VisibilityStatement(stmt) );
return results;
});
@@ -103,7 +103,7 @@ public class QueryResultsOutputUtilTest {
MapBindingSet bs = new MapBindingSet();
bs.addBinding("name", VF.createLiteral("alice"));
bs.addBinding("company", VF.createLiteral("Taco Shop"));
- bs.addBinding("ssn", VF.createURI("urn:111-11-1111"));
+ bs.addBinding("ssn", VF.createIRI("urn:111-11-1111"));
results.add(new VisibilityBindingSet(bs, ""));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/geo/src/test/java/org/apache/rya/streams/kafka/processors/filter/GeoFilterIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/geo/src/test/java/org/apache/rya/streams/kafka/processors/filter/GeoFilterIT.java b/extras/rya.streams/geo/src/test/java/org/apache/rya/streams/kafka/processors/filter/GeoFilterIT.java
index 17a290a..82aa4b8 100644
--- a/extras/rya.streams/geo/src/test/java/org/apache/rya/streams/kafka/processors/filter/GeoFilterIT.java
+++ b/extras/rya.streams/geo/src/test/java/org/apache/rya/streams/kafka/processors/filter/GeoFilterIT.java
@@ -38,18 +38,17 @@ import org.apache.rya.streams.kafka.processors.filter.FilterProcessorSupplier.Fi
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.function.Function;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.impl.MapBindingSet;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
@@ -104,7 +103,7 @@ public class GeoFilterIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = getStatements();
// Make the expected results.
@@ -127,11 +126,11 @@ public class GeoFilterIT {
}
private static Statement statement(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("urn:event1");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("urn:event1");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final WKTWriter w = new WKTWriter();
final Value object = vf.createLiteral(w.write(geo), GeoConstants.XMLSCHEMA_OGC_WKT);
- return new StatementImpl(subject, predicate, object);
+ return vf.createStatement(subject, predicate, object);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorIT.java
index 2a1e760..ab0c2ab 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorIT.java
@@ -34,12 +34,12 @@ import org.apache.rya.streams.kafka.processors.aggregation.AggregationProcessorS
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests {@link AggregationProcessor}.
@@ -59,29 +59,29 @@ public class AggregationProcessorIT {
"} GROUP BY ?person";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasBook"), vf.createLiteral("Book 1")), "a"));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasBook"), vf.createLiteral("Book 1")), "a"));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hasBook"), vf.createLiteral("Book 1")), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hasBook"), vf.createLiteral("Book 1")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasBook"), vf.createLiteral("Book 2")), "b"));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasBook"), vf.createLiteral("Book 2")), "b"));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("bookCount", vf.createLiteral("1", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
bs.addBinding("bookCount", vf.createLiteral("1", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("bookCount", vf.createLiteral("2", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, "a&b"));
@@ -109,26 +109,26 @@ public class AggregationProcessorIT {
"} GROUP BY ?person";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasFoodType"), vf.createURI("urn:corn")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasFoodType"), vf.createIRI("urn:corn")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasFoodType"), vf.createURI("urn:apple")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasFoodType"), vf.createIRI("urn:apple")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:corn"), vf.createURI("urn:count"), vf.createLiteral(4)), ""));
+ vf.createStatement(vf.createIRI("urn:corn"), vf.createIRI("urn:count"), vf.createLiteral(4)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:count"), vf.createLiteral(3)), ""));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:count"), vf.createLiteral(3)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("totalFood", vf.createLiteral("4", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("totalFood", vf.createLiteral("7", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
@@ -155,14 +155,14 @@ public class AggregationProcessorIT {
"}";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral(3)), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral(3)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(7)), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(7)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:age"), vf.createLiteral(2)), ""));
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:age"), vf.createLiteral(2)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
@@ -201,18 +201,18 @@ public class AggregationProcessorIT {
"}";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral(13)), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral(13)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(14)), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(14)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:age"), vf.createLiteral(7)), ""));
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:age"), vf.createLiteral(7)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:age"), vf.createLiteral(5)), ""));
+ vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:age"), vf.createLiteral(5)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:age"), vf.createLiteral(25)), ""));
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:age"), vf.createLiteral(25)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
@@ -251,18 +251,18 @@ public class AggregationProcessorIT {
"}";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral(13)), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral(13)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(14)), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(14)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:age"), vf.createLiteral(7)), ""));
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:age"), vf.createLiteral(7)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:age"), vf.createLiteral(5)), ""));
+ vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:age"), vf.createLiteral(5)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:age"), vf.createLiteral(25)), ""));
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:age"), vf.createLiteral(25)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
@@ -304,65 +304,65 @@ public class AggregationProcessorIT {
"} GROUP BY ?business ?employee";
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoJoint")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoJoint")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:TacoJoint"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard1")), ""));
+ vf.createStatement(vf.createIRI("urn:TacoJoint"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard1")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard1")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard1")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:timecard1"), vf.createURI("urn:hours"), vf.createLiteral(40)), ""));
+ vf.createStatement(vf.createIRI("urn:timecard1"), vf.createIRI("urn:hours"), vf.createLiteral(40)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:TacoJoint"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard2")), ""));
+ vf.createStatement(vf.createIRI("urn:TacoJoint"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard2")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard2")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard2")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:timecard2"), vf.createURI("urn:hours"), vf.createLiteral(25)), ""));
+ vf.createStatement(vf.createIRI("urn:timecard2"), vf.createIRI("urn:hours"), vf.createLiteral(25)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoJoint")), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoJoint")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:TacoJoint"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard3")), ""));
+ vf.createStatement(vf.createIRI("urn:TacoJoint"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard3")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard3")), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard3")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:timecard3"), vf.createURI("urn:hours"), vf.createLiteral(28)), ""));
+ vf.createStatement(vf.createIRI("urn:timecard3"), vf.createIRI("urn:hours"), vf.createLiteral(28)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:worksAt"), vf.createURI("urn:CoffeeShop")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:CoffeeShop")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:CoffeeShop"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard5")), ""));
+ vf.createStatement(vf.createIRI("urn:CoffeeShop"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard5")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasTimecardId"), vf.createURI("urn:timecard5")), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasTimecardId"), vf.createIRI("urn:timecard5")), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:timecard5"), vf.createURI("urn:hours"), vf.createLiteral(12)), ""));
+ vf.createStatement(vf.createIRI("urn:timecard5"), vf.createIRI("urn:hours"), vf.createLiteral(12)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
- bs.addBinding("employee", vf.createURI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
+ bs.addBinding("employee", vf.createIRI("urn:Alice"));
bs.addBinding("totalHours", vf.createLiteral("40", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
bs = new MapBindingSet();
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
- bs.addBinding("employee", vf.createURI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
+ bs.addBinding("employee", vf.createIRI("urn:Alice"));
bs.addBinding("totalHours", vf.createLiteral("65", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
bs = new MapBindingSet();
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
bs.addBinding("totalHours", vf.createLiteral("28", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
bs = new MapBindingSet();
- bs.addBinding("business", vf.createURI("urn:CoffeeShop"));
- bs.addBinding("employee", vf.createURI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:CoffeeShop"));
+ bs.addBinding("employee", vf.createIRI("urn:Alice"));
bs.addBinding("totalHours", vf.createLiteral("12", XMLSchema.INTEGER));
expected.add(new VisibilityBindingSet(bs, ""));
@@ -389,18 +389,18 @@ public class AggregationProcessorIT {
"}";
// Create the statements that will be input into the query..
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral(13)), ""));
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral(13)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(14)), ""));
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(14)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:age"), vf.createLiteral(7)), ""));
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:age"), vf.createLiteral(7)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:age"), vf.createLiteral(5)), ""));
+ vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:age"), vf.createLiteral(5)), ""));
statements.add(new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:age"), vf.createLiteral(25)), ""));
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:age"), vf.createLiteral(25)), ""));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
[12/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/QueryIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/QueryIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/QueryIT.java
index 11415eb..706dc48 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/QueryIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/QueryIT.java
@@ -22,6 +22,7 @@ import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
+import java.math.BigInteger;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Collection;
@@ -47,24 +48,24 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPeriodicQueryResultStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil;
+import org.eclipse.rdf4j.model.impl.BooleanLiteral;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.FN;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.datatypes.XMLDatatypeUtil;
-import org.openrdf.model.impl.BooleanLiteralImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.FN;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.collect.Sets;
@@ -82,32 +83,32 @@ public class QueryIT extends RyaExportITBase {
+ "OPTIONAL {?person <http://passedExam> ?exam } . " + "}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://hasDegreeIn"),
- vf.createURI("http://Computer Science")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://passedExam"),
- vf.createURI("http://Certified Ethical Hacker")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://hasDegreeIn"), vf.createURI("http://Law")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://passedExam"), vf.createURI("http://MBE")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://passedExam"), vf.createURI("http://BAR-Kansas")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://hasDegreeIn"), vf.createURI("http://Law")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://hasDegreeIn"),
+ vf.createIRI("http://Computer Science")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://passedExam"),
+ vf.createIRI("http://Certified Ethical Hacker")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://hasDegreeIn"), vf.createIRI("http://Law")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://passedExam"), vf.createIRI("http://MBE")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://passedExam"), vf.createIRI("http://BAR-Kansas")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://hasDegreeIn"), vf.createIRI("http://Law")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("http://Bob"));
- bs.addBinding("exam", vf.createURI("http://MBE"));
+ bs.addBinding("person", vf.createIRI("http://Bob"));
+ bs.addBinding("exam", vf.createIRI("http://MBE"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("http://Bob"));
- bs.addBinding("exam", vf.createURI("http://BAR-Kansas"));
+ bs.addBinding("person", vf.createIRI("http://Bob"));
+ bs.addBinding("exam", vf.createIRI("http://BAR-Kansas"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("http://Charlie"));
+ bs.addBinding("person", vf.createIRI("http://Charlie"));
expectedResults.add(bs);
// Verify the end results of the query match the expected results.
@@ -127,61 +128,61 @@ public class QueryIT extends RyaExportITBase {
+ "?candidate <http://talksTo> ?leader." + "?leader <http://leaderOf> <http://GeekSquad>. }";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
// Leaders
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://leaderOf"), vf.createURI("http://GeekSquad")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://leaderOf"), vf.createURI("http://GeekSquad")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://leaderOf"), vf.createIRI("http://GeekSquad")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://leaderOf"), vf.createIRI("http://GeekSquad")),
// Recruiters
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://recruiterFor"), vf.createURI("http://GeekSquad")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://recruiterFor"), vf.createURI("http://GeekSquad")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://recruiterFor"), vf.createIRI("http://GeekSquad")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://recruiterFor"), vf.createIRI("http://GeekSquad")),
// Candidates
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://skilledWith"), vf.createURI("http://Computers")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://livesIn"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://skilledWith"), vf.createURI("http://Computers")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://livesIn"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("http://George"), vf.createURI("http://skilledWith"), vf.createURI("http://Computers")),
- vf.createStatement(vf.createURI("http://George"), vf.createURI("http://livesIn"), vf.createLiteral("Germany")),
- vf.createStatement(vf.createURI("http://Harry"), vf.createURI("http://skilledWith"), vf.createURI("http://Negotiating")),
- vf.createStatement(vf.createURI("http://Harry"), vf.createURI("http://livesIn"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("http://Ivan"), vf.createURI("http://skilledWith"), vf.createURI("http://Computers")),
- vf.createStatement(vf.createURI("http://Ivan"), vf.createURI("http://livesIn"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://skilledWith"), vf.createIRI("http://Computers")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://livesIn"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://skilledWith"), vf.createIRI("http://Computers")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://livesIn"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("http://George"), vf.createIRI("http://skilledWith"), vf.createIRI("http://Computers")),
+ vf.createStatement(vf.createIRI("http://George"), vf.createIRI("http://livesIn"), vf.createLiteral("Germany")),
+ vf.createStatement(vf.createIRI("http://Harry"), vf.createIRI("http://skilledWith"), vf.createIRI("http://Negotiating")),
+ vf.createStatement(vf.createIRI("http://Harry"), vf.createIRI("http://livesIn"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("http://Ivan"), vf.createIRI("http://skilledWith"), vf.createIRI("http://Computers")),
+ vf.createStatement(vf.createIRI("http://Ivan"), vf.createIRI("http://livesIn"), vf.createLiteral("USA")),
// Candidates the recruiters talk to.
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://George")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Harry")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://talksTo"), vf.createURI("http://Frank")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://talksTo"), vf.createURI("http://Ivan")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://George")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Harry")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://talksTo"), vf.createIRI("http://Frank")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://talksTo"), vf.createIRI("http://Ivan")),
// Recruits that talk to leaders.
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://George"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://Harry"), vf.createURI("http://talksTo"), vf.createURI("http://Bob")),
- vf.createStatement(vf.createURI("http://Ivan"), vf.createURI("http://talksTo"), vf.createURI("http://Bob")));
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://George"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://Harry"), vf.createIRI("http://talksTo"), vf.createIRI("http://Bob")),
+ vf.createStatement(vf.createIRI("http://Ivan"), vf.createIRI("http://talksTo"), vf.createIRI("http://Bob")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("recruiter", vf.createURI("http://Charlie"));
- bs.addBinding("candidate", vf.createURI("http://Eve"));
- bs.addBinding("leader", vf.createURI("http://Alice"));
+ bs.addBinding("recruiter", vf.createIRI("http://Charlie"));
+ bs.addBinding("candidate", vf.createIRI("http://Eve"));
+ bs.addBinding("leader", vf.createIRI("http://Alice"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("recruiter", vf.createURI("http://David"));
- bs.addBinding("candidate", vf.createURI("http://Eve"));
- bs.addBinding("leader", vf.createURI("http://Alice"));
+ bs.addBinding("recruiter", vf.createIRI("http://David"));
+ bs.addBinding("candidate", vf.createIRI("http://Eve"));
+ bs.addBinding("leader", vf.createIRI("http://Alice"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("recruiter", vf.createURI("http://David"));
- bs.addBinding("candidate", vf.createURI("http://Ivan"));
- bs.addBinding("leader", vf.createURI("http://Bob"));
+ bs.addBinding("recruiter", vf.createIRI("http://David"));
+ bs.addBinding("candidate", vf.createIRI("http://Ivan"));
+ bs.addBinding("leader", vf.createIRI("http://Bob"));
expectedResults.add(bs);
// Verify the end results of the query match the expected results.
@@ -195,47 +196,47 @@ public class QueryIT extends RyaExportITBase {
+ "?worker <http://worksAt> <http://Chipotle>. " + "}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Bob")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Bob")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Charlie")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Charlie")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://David")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://David")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://livesIn"), vf.createURI("http://Leeds")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://livesIn"), vf.createIRI("http://Leeds")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Bob"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Bob"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Charlie"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Charlie"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://David"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://David"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResults.add(bs);
// Verify the end results of the query match the expected results.
@@ -248,30 +249,30 @@ public class QueryIT extends RyaExportITBase {
+ "?name <http://playsSport> \"Soccer\" " + "}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://hasAge"), vf.createLiteral(18)),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://hasAge"), vf.createLiteral(30)),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://hasAge"), vf.createLiteral(14)),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://hasAge"), vf.createLiteral(16)),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://hasAge"), vf.createLiteral(35)),
-
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://playsSport"), vf.createLiteral("Basketball")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://playsSport"), vf.createLiteral("Basketball")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(18))),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(30))),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(14))),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(16))),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(35))),
+
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://playsSport"), vf.createLiteral("Basketball")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://playsSport"), vf.createLiteral("Basketball")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("http://Alice"));
+ bs.addBinding("name", vf.createIRI("http://Alice"));
bs.addBinding("age", vf.createLiteral("18", XMLSchema.INTEGER));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("http://Charlie"));
+ bs.addBinding("name", vf.createIRI("http://Charlie"));
bs.addBinding("age", vf.createLiteral("14", XMLSchema.INTEGER));
expectedResults.add(bs);
@@ -301,16 +302,16 @@ public class QueryIT extends RyaExportITBase {
if (args[0] instanceof Literal) {
final Literal literal = (Literal) args[0];
- final URI datatype = literal.getDatatype();
+ final IRI datatype = literal.getDatatype();
// ABS function accepts only numeric literals
if (datatype != null && XMLDatatypeUtil.isNumericDatatype(datatype)) {
if (XMLDatatypeUtil.isDecimalDatatype(datatype)) {
final BigDecimal bigValue = literal.decimalValue();
- return BooleanLiteralImpl.valueOf(bigValue.compareTo(new BigDecimal(TEEN_THRESHOLD)) < 0);
+ return BooleanLiteral.valueOf(bigValue.compareTo(new BigDecimal(TEEN_THRESHOLD)) < 0);
} else if (XMLDatatypeUtil.isFloatingPointDatatype(datatype)) {
final double doubleValue = literal.doubleValue();
- return BooleanLiteralImpl.valueOf(doubleValue < TEEN_THRESHOLD);
+ return BooleanLiteral.valueOf(doubleValue < TEEN_THRESHOLD);
} else {
throw new ValueExprEvaluationException(
"unexpected datatype (expect decimal/int or floating) for function operand: " + args[0]);
@@ -329,30 +330,30 @@ public class QueryIT extends RyaExportITBase {
FunctionRegistry.getInstance().add(fooFunction);
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://hasAge"), vf.createLiteral(18)),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://hasAge"), vf.createLiteral(30)),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://hasAge"), vf.createLiteral(14)),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://hasAge"), vf.createLiteral(16)),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://hasAge"), vf.createLiteral(35)),
-
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://playsSport"), vf.createLiteral("Basketball")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://playsSport"), vf.createLiteral("Soccer")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://playsSport"), vf.createLiteral("Basketball")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(18))),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(30))),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(14))),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(16))),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://hasAge"), vf.createLiteral(BigInteger.valueOf(35))),
+
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://playsSport"), vf.createLiteral("Basketball")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://playsSport"), vf.createLiteral("Soccer")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://playsSport"), vf.createLiteral("Basketball")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("http://Alice"));
+ bs.addBinding("name", vf.createIRI("http://Alice"));
bs.addBinding("age", vf.createLiteral("18", XMLSchema.INTEGER));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("http://Charlie"));
+ bs.addBinding("name", vf.createIRI("http://Charlie"));
bs.addBinding("age", vf.createLiteral("14", XMLSchema.INTEGER));
expectedResults.add(bs);
@@ -371,53 +372,53 @@ public class QueryIT extends RyaExportITBase {
+ "FILTER(?time > '2001-01-01T01:01:03-08:00'^^xml:dateTime) " + "}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
- vf.createURI("http://www.w3.org/2006/time#Instant")),
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
+ vf.createIRI("http://www.w3.org/2006/time#Instant")),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T01:01:01-08:00"))), // 1 second
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T04:01:02.000-05:00"))), // 2 second
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T01:01:03-08:00"))), // 3 seconds
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T01:01:04-08:00"))), // 4 seconds
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T09:01:05Z"))), // 5 seconds
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2006-01-01T05:00:00.000Z"))),
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2007-01-01T05:00:00.000Z"))),
- vf.createStatement(vf.createURI("http://eventz"), vf.createURI(dtPredUri),
+ vf.createStatement(vf.createIRI("http://eventz"), vf.createIRI(dtPredUri),
vf.createLiteral(dtf.newXMLGregorianCalendar("2008-01-01T05:00:00.000Z"))));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("http://eventz"));
+ bs.addBinding("event", vf.createIRI("http://eventz"));
bs.addBinding("time", vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T09:01:04.000Z")));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("http://eventz"));
+ bs.addBinding("event", vf.createIRI("http://eventz"));
bs.addBinding("time", vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T09:01:05.000Z")));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("http://eventz"));
+ bs.addBinding("event", vf.createIRI("http://eventz"));
bs.addBinding("time", vf.createLiteral(dtf.newXMLGregorianCalendar("2006-01-01T05:00:00.000Z")));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("http://eventz"));
+ bs.addBinding("event", vf.createIRI("http://eventz"));
bs.addBinding("time", vf.createLiteral(dtf.newXMLGregorianCalendar("2007-01-01T05:00:00.000Z")));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("http://eventz"));
+ bs.addBinding("event", vf.createIRI("http://eventz"));
bs.addBinding("time", vf.createLiteral(dtf.newXMLGregorianCalendar("2008-01-01T05:00:00.000Z")));
expectedResults.add(bs);
@@ -429,7 +430,7 @@ public class QueryIT extends RyaExportITBase {
@Test
public void dateTimeWithin() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
FunctionRegistry.getInstance().add(new DateTimeWithinPeriod());
@@ -452,17 +453,17 @@ public class QueryIT extends RyaExportITBase {
// Create the Statements that will be loaded into Rya.
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("uri:event1"), vf.createURI("uri:startTime"), lit),
- vf.createStatement(vf.createURI("uri:event1"), vf.createURI("uri:endTime"), lit1),
- vf.createStatement(vf.createURI("uri:event2"), vf.createURI("uri:startTime"), lit),
- vf.createStatement(vf.createURI("uri:event2"), vf.createURI("uri:endTime"), lit2)
+ vf.createStatement(vf.createIRI("uri:event1"), vf.createIRI("uri:startTime"), lit),
+ vf.createStatement(vf.createIRI("uri:event1"), vf.createIRI("uri:endTime"), lit1),
+ vf.createStatement(vf.createIRI("uri:event2"), vf.createIRI("uri:startTime"), lit),
+ vf.createStatement(vf.createIRI("uri:event2"), vf.createIRI("uri:endTime"), lit2)
);
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("uri:event1"));
+ bs.addBinding("event", vf.createIRI("uri:event1"));
bs.addBinding("startTime", lit);
bs.addBinding("endTime", lit1);
expectedResults.add(bs);
@@ -474,7 +475,7 @@ public class QueryIT extends RyaExportITBase {
@Test
public void dateTimeWithinNow() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
FunctionRegistry.getInstance().add(new DateTimeWithinPeriod());
@@ -493,15 +494,15 @@ public class QueryIT extends RyaExportITBase {
// Create the Statements that will be loaded into Rya.
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("uri:event1"), vf.createURI("uri:startTime"), lit),
- vf.createStatement(vf.createURI("uri:event2"), vf.createURI("uri:startTime"), lit1)
+ vf.createStatement(vf.createIRI("uri:event1"), vf.createIRI("uri:startTime"), lit),
+ vf.createStatement(vf.createIRI("uri:event2"), vf.createIRI("uri:startTime"), lit1)
);
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("event", vf.createURI("uri:event1"));
+ bs.addBinding("event", vf.createIRI("uri:event1"));
bs.addBinding("startTime", lit);
expectedResults.add(bs);
@@ -521,7 +522,7 @@ public class QueryIT extends RyaExportITBase {
+ "?obs <uri:hasId> ?id }"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final ZonedDateTime time = ZonedDateTime.now();
final long currentTime = time.toInstant().toEpochMilli();
@@ -539,18 +540,18 @@ public class QueryIT extends RyaExportITBase {
final String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasId"), vf.createLiteral("id_4")));
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasId"), vf.createLiteral("id_4")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
@@ -622,7 +623,7 @@ public class QueryIT extends RyaExportITBase {
+ "?obs <uri:hasId> ?id }"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final ZonedDateTime time = ZonedDateTime.now();
final long currentTime = time.toInstant().toEpochMilli();
@@ -640,18 +641,18 @@ public class QueryIT extends RyaExportITBase {
final String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasId"), vf.createLiteral("id_4")));
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasId"), vf.createLiteral("id_4")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
@@ -693,7 +694,7 @@ public class QueryIT extends RyaExportITBase {
+ "?obs <uri:hasId> ?id } group by ?id"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final ZonedDateTime time = ZonedDateTime.now();
final long currentTime = time.toInstant().toEpochMilli();
@@ -711,24 +712,24 @@ public class QueryIT extends RyaExportITBase {
final String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasId"), vf.createLiteral("id_4")),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasId"), vf.createLiteral("id_4")),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")));
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
@@ -813,7 +814,7 @@ public class QueryIT extends RyaExportITBase {
+ "?obs <uri:hasLoc> ?location } group by ?location }}"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final ZonedDateTime time = ZonedDateTime.now();
final long currentTime = time.toInstant().toEpochMilli();
@@ -831,24 +832,24 @@ public class QueryIT extends RyaExportITBase {
final String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_4")),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_4")),
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_1")),
- vf.createStatement(vf.createURI("urn:obs_6"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_1")),
+ vf.createStatement(vf.createIRI("urn:obs_6"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_6"), vf.createURI("uri:hasLoc"), vf.createLiteral("loc_2")));
+ vf.createStatement(vf.createIRI("urn:obs_6"), vf.createIRI("uri:hasLoc"), vf.createLiteral("loc_2")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
@@ -892,7 +893,7 @@ public class QueryIT extends RyaExportITBase {
+ "?obs <uri:hasLoc> ?location } group by ?location }}"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
final ZonedDateTime time = ZonedDateTime.now();
final long currentTime = time.toInstant().toEpochMilli();
@@ -910,26 +911,26 @@ public class QueryIT extends RyaExportITBase {
final String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_1")),
- vf.createStatement(vf.createURI("uri:loc_1"), vf.createURI("uri:hasPopulation"), vf.createLiteral(3500)),
- vf.createStatement(vf.createURI("uri:loc_2"), vf.createURI("uri:hasPopulation"), vf.createLiteral(8000)),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_1")),
+ vf.createStatement(vf.createIRI("uri:loc_1"), vf.createIRI("uri:hasPopulation"), vf.createLiteral(3500)),
+ vf.createStatement(vf.createIRI("uri:loc_2"), vf.createIRI("uri:hasPopulation"), vf.createLiteral(8000)),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_4")),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_4")),
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_1")),
- vf.createStatement(vf.createURI("urn:obs_6"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_1")),
+ vf.createStatement(vf.createIRI("urn:obs_6"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_6"), vf.createURI("uri:hasLoc"), vf.createURI("uri:loc_2")));
+ vf.createStatement(vf.createIRI("urn:obs_6"), vf.createIRI("uri:hasLoc"), vf.createIRI("uri:loc_2")));
// Create the expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
@@ -939,14 +940,14 @@ public class QueryIT extends RyaExportITBase {
MapBindingSet bs = new MapBindingSet();
bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("location", vf.createURI("uri:loc_1"));
+ bs.addBinding("location", vf.createIRI("uri:loc_1"));
bs.addBinding("population", vf.createLiteral("3500", XMLSchema.INTEGER));
bs.addBinding("periodicBinId", vf.createLiteral(binId));
expectedResults.add(bs);
bs = new MapBindingSet();
bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("location", vf.createURI("uri:loc_2"));
+ bs.addBinding("location", vf.createIRI("uri:loc_2"));
bs.addBinding("population", vf.createLiteral("8000", XMLSchema.INTEGER));
bs.addBinding("periodicBinId", vf.createLiteral(binId));
expectedResults.add(bs);
@@ -954,7 +955,7 @@ public class QueryIT extends RyaExportITBase {
bs = new MapBindingSet();
bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("location", vf.createURI("uri:loc_2"));
+ bs.addBinding("location", vf.createIRI("uri:loc_2"));
bs.addBinding("population", vf.createLiteral("8000", XMLSchema.INTEGER));
bs.addBinding("periodicBinId", vf.createLiteral(binId + period));
expectedResults.add(bs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
index 15ff1b4..eabcd57 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
@@ -33,11 +33,11 @@ import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -60,7 +60,7 @@ public class RyaExportIT extends RyaExportITBase {
"}";
// Triples that will be streamed into Fluo after the PCJ has been created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Bob")),
new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://livesIn"), new RyaURI("http://London")),
@@ -86,21 +86,21 @@ public class RyaExportIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Bob"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Bob"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Charlie"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Charlie"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://David"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://David"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expected.add(bs);
// Create the PCJ table.
@@ -113,7 +113,7 @@ public class RyaExportIT extends RyaExportITBase {
new CreateFluoPcj().withRyaIntegration(pcjId, pcjStorage, fluoClient, accumuloConn, getRyaInstanceName());
// Stream the data into Fluo.
- new InsertTriples().insert(fluoClient, streamedTriples, Optional.<String>absent());
+ new InsertTriples().insert(fluoClient, streamedTriples, Optional.absent());
// Fetch the exported results from Accumulo once the observers finish working.
super.getMiniFluo().waitForObservers();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaInputIncrementalUpdateIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaInputIncrementalUpdateIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaInputIncrementalUpdateIT.java
index 65083e8..f6b88fe 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaInputIncrementalUpdateIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaInputIncrementalUpdateIT.java
@@ -34,14 +34,14 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.update.PrecomputedJoinUpdater;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.collect.Sets;
@@ -67,29 +67,29 @@ public class RyaInputIncrementalUpdateIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// The expected results of the SPARQL query once the PCJ has been
// computed.
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Bob"));
+ bs.addBinding("x", vf.createIRI("http://Bob"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Charlie"));
+ bs.addBinding("x", vf.createIRI("http://Charlie"));
expected.add(bs);
// Create the PCJ table.
@@ -140,17 +140,17 @@ public class RyaInputIncrementalUpdateIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Joe"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Joe"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Triples that will be streamed into Fluo after the PCJ has been
final Set<Statement> streamedTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Joe"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Joe"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Load the historic data into Rya.
final SailRepositoryConnection ryaConn = super.getRyaSailRepository().getConnection();
@@ -179,15 +179,15 @@ public class RyaInputIncrementalUpdateIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Alice"));
+ bs.addBinding("x", vf.createIRI("http://Alice"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Frank"));
+ bs.addBinding("x", vf.createIRI("http://Frank"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Joe"));
+ bs.addBinding("x", vf.createIRI("http://Joe"));
expected.add(bs);
final Set<BindingSet> results = new HashSet<>();
@@ -211,17 +211,17 @@ public class RyaInputIncrementalUpdateIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Joe"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Joe"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Triples that will be streamed into Fluo after the PCJ has been
final Set<Statement> streamedTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://talksTo"), vf.createURI("http://Betty")),
- vf.createStatement(vf.createURI("http://Joe"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://talksTo"), vf.createIRI("http://Betty")),
+ vf.createStatement(vf.createIRI("http://Joe"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Load the historic data into Rya.
final SailRepositoryConnection ryaConn = super.getRyaSailRepository().getConnection();
@@ -251,18 +251,18 @@ public class RyaInputIncrementalUpdateIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Alice"));
- bs.addBinding("y", vf.createURI("http://Eve"));
+ bs.addBinding("x", vf.createIRI("http://Alice"));
+ bs.addBinding("y", vf.createIRI("http://Eve"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Frank"));
- bs.addBinding("y", vf.createURI("http://Betty"));
+ bs.addBinding("x", vf.createIRI("http://Frank"));
+ bs.addBinding("y", vf.createIRI("http://Betty"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Joe"));
- bs.addBinding("y", vf.createURI("http://Alice"));
+ bs.addBinding("x", vf.createIRI("http://Joe"));
+ bs.addBinding("y", vf.createIRI("http://Alice"));
expected.add(bs);
final Set<BindingSet> results = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
index 6135920..776b69f 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/StreamingTestIT.java
@@ -33,17 +33,16 @@ import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
public class StreamingTestIT extends RyaExportITBase {
private static final Logger log = Logger.getLogger(StreamingTestIT.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testRandomStreamingIngest() throws Exception {
@@ -85,13 +84,13 @@ public class StreamingTestIT extends RyaExportITBase {
final Set<Statement> statementPairs = new HashSet<>();
for (int i = 0; i < numPairs; i++) {
final String uri = "http://uuid_" + UUID.randomUUID().toString();
- final Statement statement1 = new StatementImpl(new URIImpl(uri), new URIImpl("http://pred1"),
- new LiteralImpl("number_" + (i + 1)));
- final Statement statement2 = new StatementImpl(new URIImpl(uri), new URIImpl("http://pred2"), new LiteralImpl("literal"));
+ final Statement statement1 = VF.createStatement(VF.createIRI(uri), VF.createIRI("http://pred1"),
+ VF.createLiteral("number_" + (i + 1)));
+ final Statement statement2 = VF.createStatement(VF.createIRI(uri), VF.createIRI("http://pred2"), VF.createLiteral("literal"));
statementPairs.add(statement1);
statementPairs.add(statement2);
}
- super.getRyaSailRepository().getConnection().add(statementPairs, new Resource[0]);
+ super.getRyaSailRepository().getConnection().add(statementPairs);
super.getMiniFluo().waitForObservers();
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/HistoricStreamingVisibilityIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/HistoricStreamingVisibilityIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/HistoricStreamingVisibilityIT.java
index eab99b8..33c2761 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/HistoricStreamingVisibilityIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/HistoricStreamingVisibilityIT.java
@@ -36,13 +36,13 @@ import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Sets;
@@ -74,19 +74,19 @@ public class HistoricStreamingVisibilityIT extends RyaExportITBase {
dao.init();
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<RyaStatement> historicTriples = Sets.newHashSet(
- makeRyaStatement(vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),"U"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),"V"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),"W"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),"U"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),"V"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),"W"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin")), "U"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin")), "U"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")), "W"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")), "V"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")), "U"),
- makeRyaStatement(vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")), "V"));
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")), "W"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")), "V"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")), "U"),
+ makeRyaStatement(vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")), "V"));
dao.add(historicTriples.iterator());
dao.flush();
@@ -95,11 +95,11 @@ public class HistoricStreamingVisibilityIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Bob"));
+ bs.addBinding("x", vf.createIRI("http://Bob"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Charlie"));
+ bs.addBinding("x", vf.createIRI("http://Charlie"));
expected.add(bs);
// Create the PCJ table.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
index 45be971..60df148 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
@@ -58,14 +58,14 @@ import org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.sail.Sail;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -76,16 +76,16 @@ import com.google.common.collect.Sets;
*/
public class PcjVisibilityIT extends RyaExportITBase {
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
// Constants used within the test.
- private static final URI ALICE = VF.createURI("urn:Alice");
- private static final URI BOB = VF.createURI("urn:Bob");
- private static final URI TALKS_TO = VF.createURI("urn:talksTo");
- private static final URI LIVES_IN = VF.createURI("urn:livesIn");
- private static final URI WORKS_AT = VF.createURI("urn:worksAt");
- private static final URI HAPPYVILLE = VF.createURI("urn:Happyville");
- private static final URI BURGER_JOINT = VF.createURI("urn:BurgerJoint");
+ private static final IRI ALICE = VF.createIRI("urn:Alice");
+ private static final IRI BOB = VF.createIRI("urn:Bob");
+ private static final IRI TALKS_TO = VF.createIRI("urn:talksTo");
+ private static final IRI LIVES_IN = VF.createIRI("urn:livesIn");
+ private static final IRI WORKS_AT = VF.createIRI("urn:worksAt");
+ private static final IRI HAPPYVILLE = VF.createIRI("urn:Happyville");
+ private static final IRI BURGER_JOINT = VF.createIRI("urn:BurgerJoint");
@Test
public void visibilitySimplified() throws Exception {
@@ -239,27 +239,27 @@ public class PcjVisibilityIT extends RyaExportITBase {
final Set<BindingSet> rootExpected = Sets.newHashSet();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Bob"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Bob"));
+ bs.addBinding("city", VF.createIRI("http://London"));
rootExpected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Charlie"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Charlie"));
+ bs.addBinding("city", VF.createIRI("http://London"));
rootExpected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Eve"));
- bs.addBinding("city", VF.createURI("http://Leeds"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Eve"));
+ bs.addBinding("city", VF.createIRI("http://Leeds"));
rootExpected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://David"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://David"));
+ bs.addBinding("city", VF.createIRI("http://London"));
rootExpected.add(bs);
assertEquals(rootExpected, rootResults);
@@ -273,9 +273,9 @@ public class PcjVisibilityIT extends RyaExportITBase {
final Set<BindingSet> abExpected = Sets.newHashSet();
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Bob"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Bob"));
+ bs.addBinding("city", VF.createIRI("http://London"));
abExpected.add(bs);
assertEquals(abExpected, abResults);
@@ -288,15 +288,15 @@ public class PcjVisibilityIT extends RyaExportITBase {
final Set<BindingSet> abcExpected = Sets.newHashSet();
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Bob"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Bob"));
+ bs.addBinding("city", VF.createIRI("http://London"));
abcExpected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Charlie"));
- bs.addBinding("city", VF.createURI("http://London"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Charlie"));
+ bs.addBinding("city", VF.createIRI("http://London"));
abcExpected.add(bs);
assertEquals(abcExpected, abcResults);
@@ -309,9 +309,9 @@ public class PcjVisibilityIT extends RyaExportITBase {
final Set<BindingSet> adeExpected = Sets.newHashSet();
bs = new MapBindingSet();
- bs.addBinding("customer", VF.createURI("http://Alice"));
- bs.addBinding("worker", VF.createURI("http://Eve"));
- bs.addBinding("city", VF.createURI("http://Leeds"));
+ bs.addBinding("customer", VF.createIRI("http://Alice"));
+ bs.addBinding("worker", VF.createIRI("http://Eve"));
+ bs.addBinding("city", VF.createIRI("http://Leeds"));
adeExpected.add(bs);
assertEquals(adeExpected, adeResults);
[38/48] incubator-rya git commit: RYA-405 More documentation updates
Posted by pu...@apache.org.
RYA-405 More documentation updates
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/855d7155
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/855d7155
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/855d7155
Branch: refs/heads/master
Commit: 855d71557e7240dc838f6c8055d2a6ef1d804c0f
Parents: 648a87e
Author: eric.white <Er...@parsons.com>
Authored: Fri Apr 20 13:20:15 2018 -0400
Committer: Valiyil <Pu...@parsons.com>
Committed: Mon Apr 23 09:19:11 2018 -0400
----------------------------------------------------------------------
.../api/function/join/IterativeJoinTest.java | 7 +--
.../temporal/AfterTemporalFunctionsTest.java | 2 +-
.../temporal/BeforeTemporalFunctionsTest.java | 2 +-
.../temporal/EqualsTemporalFunctionsTest.java | 2 +-
.../temporal/WithinTemporalFunctionsTest.java | 2 +-
common/rya.api/pom.xml | 8 +--
.../rya/api/RdfCloudTripleStoreUtils.java | 40 +++++++--------
.../rya/api/date/DateTimeTtlValueConverter.java | 4 +-
.../api/date/TimestampTtlStrValueConverter.java | 4 +-
.../api/date/TimestampTtlValueConverter.java | 4 +-
.../apache/rya/api/date/TtlValueConverter.java | 2 +-
.../rya/api/functions/DateTimeWithinPeriod.java | 18 +++----
.../rya/api/resolver/RdfToRyaConversions.java | 14 ++---
.../rya/api/resolver/RyaToRdfConversions.java | 4 +-
.../apache/rya/indexing/FreeTextIndexer.java | 20 ++++----
.../IndexedQueryPlanSelector.java | 4 +-
.../accumulo/entity/AccumuloDocIndexerTest.java | 54 ++++++++++----------
.../indexing/accumulo/entity/StarQueryTest.java | 10 ++--
.../rya/indexing/mongo/MongoPCJIndexIT.java | 4 +-
.../GeoEnabledFilterFunctionOptimizer.java | 8 +--
.../geotemporal/GeoTemporalIndexer.java | 30 +++++------
.../accumulo/geo/GeoMesaGeoIndexer.java | 4 +-
.../accumulo/geo/GeoWaveGeoIndexer.java | 4 +-
extras/rya.reasoning/README.md | 18 +++----
.../apache/rya/reasoning/AbstractReasoner.java | 3 ++
.../vagrantExample/src/main/vagrant/Vagrantfile | 6 +--
.../rdftriplestore/inference/InverseURI.java | 4 +-
27 files changed, 140 insertions(+), 142 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
index 91997a3..c82f0b7 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
@@ -18,15 +18,14 @@
*/
package org.apache.rya.api.function.join;
+import static org.junit.Assert.assertEquals;
+
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.apache.rya.api.function.join.IterativeJoin;
-import org.apache.rya.api.function.join.LeftOuterJoin;
-import org.apache.rya.api.function.join.NaturalJoin;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.impl.MapBindingSet;
@@ -36,8 +35,6 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
-import static org.junit.Assert.assertEquals;
-
/**
* Tests the methods of {@link IterativeJoin}.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
index 48bbefa..e99417e 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
@@ -32,7 +32,7 @@ public class AfterTemporalFunctionsTest {
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testAfter_same() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
index 7fb5680..1a39423 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
@@ -32,7 +32,7 @@ public class BeforeTemporalFunctionsTest {
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testBefore_same() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
index bffade6..51fe263 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
@@ -32,7 +32,7 @@ public class EqualsTemporalFunctionsTest {
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testEquals_equal() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
index 2761287..e145c4d 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
@@ -33,7 +33,7 @@ public class WithinTemporalFunctionsTest {
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test(expected = ValueExprEvaluationException.class)
public void within_NotInterval() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.api/pom.xml b/common/rya.api/pom.xml
index 13cd4cf..ea4fb19 100644
--- a/common/rya.api/pom.xml
+++ b/common/rya.api/pom.xml
@@ -68,6 +68,10 @@ under the License.
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-turtle</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-base</artifactId>
+ </dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -108,10 +112,6 @@ under the License.
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.eclipse.rdf4j</groupId>
- <artifactId>rdf4j-sail-base</artifactId>
- </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
index 8a7c007..4fb5705 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
@@ -86,8 +86,8 @@ public class RdfCloudTripleStoreUtils {
////
//// Value ret = null;
//// if (valueTypeMarker == RdfCloudTripleStoreConstants.URI_MARKER) {
-//// String uriString = readString(dataIn);
-//// ret = vf.createIRI(uriString);
+//// String iriString = readString(dataIn);
+//// ret = vf.createIRI(iriString);
//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.BNODE_MARKER) {
//// String bnodeID = readString(dataIn);
//// ret = vf.createBNode(bnodeID);
@@ -261,16 +261,16 @@ public class RdfCloudTripleStoreUtils {
public static IRI convertToUri(String namespace, String value) {
if (value == null)
return null;
- IRI subjUri;
+ IRI subjIri;
try {
- subjUri = VF.createIRI(value);
+ subjIri = VF.createIRI(value);
} catch (Exception e) {
- //not uri
+ //not iri
if (namespace == null)
return null;
- subjUri = VF.createIRI(namespace, value);
+ subjIri = VF.createIRI(namespace, value);
}
- return subjUri;
+ return subjIri;
}
public static Literal convertToDataTypeLiteral(String s) {
@@ -294,10 +294,10 @@ public class RdfCloudTripleStoreUtils {
return lit != null && lit.indexOf("^^") != -1;
}
- public static boolean isUri(String uri) {
- if (uri == null) return false;
+ public static boolean isUri(String iri) {
+ if (iri == null) return false;
try {
- VF.createIRI(uri);
+ VF.createIRI(iri);
} catch (Exception e) {
return false;
}
@@ -315,16 +315,16 @@ public class RdfCloudTripleStoreUtils {
// }
-// public static void addTimeIndexUri(Configuration conf, IRI timeUri, Class<? extends TtlValueConverter> ttlValueConvClass) {
-// String[] timeIndexUris = conf.getStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS);
-// if (timeIndexUris == null)
-// timeIndexUris = new String[0];
-// List<String> stringList = new ArrayList<String>(Arrays.asList(timeIndexUris));
-// String timeUri_s = timeUri.stringValue();
-// if (!stringList.contains(timeUri_s))
-// stringList.add(timeUri_s);
+// public static void addTimeIndexUri(Configuration conf, IRI timeIri, Class<? extends TtlValueConverter> ttlValueConvClass) {
+// String[] timeIndexIris = conf.getStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS);
+// if (timeIndexIris == null)
+// timeIndexIris = new String[0];
+// List<String> stringList = new ArrayList<String>(Arrays.asList(timeIndexIris));
+// String timeIri_s = timeIri.stringValue();
+// if (!stringList.contains(timeIri_s))
+// stringList.add(timeIri_s);
// conf.setStrings(RdfCloudTripleStoreConfiguration.CONF_TIMEINDEXURIS, stringList.toArray(new String[stringList.size()]));
-// conf.set(timeUri_s, ttlValueConvClass.getName());
+// conf.set(timeIri_s, ttlValueConvClass.getName());
// }
// public static Class<? extends TtlValueConverter> getTtlValueConverter(Configuration conf, IRI predicate) throws ClassNotFoundException {
@@ -380,7 +380,7 @@ public class RdfCloudTripleStoreUtils {
if (resource.contains(":") || resource.contains("/") || resource.contains("#")) {
return VF.createIRI(resource);
} else {
- throw new RuntimeException((new StringBuilder()).append(resource).append(" is not a valid URI, blank node, or literal value").toString());
+ throw new RuntimeException((new StringBuilder()).append(resource).append(" is not a valid IRI, blank node, or literal value").toString());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
index 62ee8c0..5150219 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
@@ -49,10 +49,10 @@ public class DateTimeTtlValueConverter implements TtlValueConverter {
cal.setTimeZone(getTimeZone());
cal.setTimeInMillis(start_l);
DatatypeFactory factory = DatatypeFactory.newInstance();
- start = vf.createLiteral(factory.newXMLGregorianCalendar(cal));
+ start = VF.createLiteral(factory.newXMLGregorianCalendar(cal));
cal.setTimeInMillis(stop_l);
- stop = vf.createLiteral(factory.newXMLGregorianCalendar(cal));
+ stop = VF.createLiteral(factory.newXMLGregorianCalendar(cal));
} catch (DatatypeConfigurationException e) {
throw new RuntimeException("Exception occurred creating DataTypeFactory", e);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
index a52e0b4..5b25622 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
@@ -38,8 +38,8 @@ public class TimestampTtlStrValueConverter implements TtlValueConverter {
stop_l = Long.parseLong(startTime);
start_l = stop_l - ttl_l;
- start = vf.createLiteral(start_l + "");
- stop = vf.createLiteral(stop_l + "");
+ start = VF.createLiteral(start_l + "");
+ stop = VF.createLiteral(stop_l + "");
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
index 4ce6932..8fe1997 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
@@ -38,8 +38,8 @@ public class TimestampTtlValueConverter implements TtlValueConverter {
stop_l = Long.parseLong(startTime);
start_l = stop_l - ttl_l;
- start = vf.createLiteral(start_l);
- stop = vf.createLiteral(stop_l);
+ start = VF.createLiteral(start_l);
+ stop = VF.createLiteral(stop_l);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
index 98ea208..c053643 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
@@ -29,7 +29,7 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
*/
public interface TtlValueConverter {
- ValueFactory vf = SimpleValueFactory.getInstance();
+ public static final ValueFactory VF = SimpleValueFactory.getInstance();
public void convert(String ttl, String startTime);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
index 62720e6..26db3ac 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
@@ -17,6 +17,9 @@
* under the License.
*/package org.apache.rya.api.functions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import java.time.Duration;
import java.time.Instant;
@@ -30,15 +33,12 @@ import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
/**
* This {@link Function} determines whether two {@link XMLSchema#DATETIME}s occur within a specified period of time of
* one another. The method {@link Function#evaluate(ValueFactory, Value...)} expects four values, where the first two
- * values are the datetimes, the third value is an integer indicating the period, and the fourth value is a URI
+ * values are the datetimes, the third value is an integer indicating the period, and the fourth value is an IRI
* indicating the time unit of the period. The IRI must be of Type DurationDescription in the OWL-Time ontology (see
- * <a href ="https://www.w3.org/TR/owl-time/">https://www.w3.org/TR/owl-time/</a>). Examples of valid time unit URIs can
+ * <a href ="https://www.w3.org/TR/owl-time/">https://www.w3.org/TR/owl-time/</a>). Examples of valid time unit IRIs can
* be found in the class {@link OWLTime} and below
* <ul>
* <li>http://www.w3.org/2006/time#days</li>
@@ -50,11 +50,11 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public class DateTimeWithinPeriod implements Function {
- private static final String FUNCTION_URI = FN.NAMESPACE + "dateTimeWithin";
+ private static final String FUNCTION_IRI = FN.NAMESPACE + "dateTimeWithin";
@Override
public String getURI() {
- return FUNCTION_URI;
+ return FUNCTION_IRI;
}
/**
@@ -62,7 +62,7 @@ public class DateTimeWithinPeriod implements Function {
* values, where the first two values are the datetimes, the third value is an integer indicating the period, and
* the fourth value is an IRI indicating the time unit of the period. The IRI must be of Type DurationDescription in
* the OWL-Time ontology (see <a href ="https://www.w3.org/TR/owl-time/">https://www.w3.org/TR/owl-time/</a>).
- * Examples of valid time unit URIs can be found in the class {@link OWLTime} and below
+ * Examples of valid time unit IRIs can be found in the class {@link OWLTime} and below
* <ul>
* <li>http://www.w3.org/2006/time#days</li>
* <li>http://www.w3.org/2006/time#hours</li>
@@ -118,7 +118,7 @@ public class DateTimeWithinPeriod implements Function {
* Converts the period duration to milliseconds.
*
* @param duration - duration of temporal period
- * @param unit - IRI indicating the time unit (URI must be of type DurationDescription in the OWL-Time ontology
+ * @param unit - IRI indicating the time unit (IRI must be of type DurationDescription in the OWL-Time ontology
* indicated by the namespace <http://www.w3.org/2006/time#>)
* @return - duration in milliseconds
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
index e89306e..fca31e4 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
@@ -40,13 +40,13 @@ import org.eclipse.rdf4j.model.Value;
*/
public class RdfToRyaConversions {
- public static RyaURI convertURI(IRI uri) {
- if (uri == null) return null;
- if (uri instanceof RangeURI) {
- RangeURI ruri = (RangeURI) uri;
- return new RyaURIRange(convertURI(ruri.getStart()), convertURI(ruri.getEnd()));
+ public static RyaURI convertURI(IRI iri) {
+ if (iri == null) return null;
+ if (iri instanceof RangeURI) {
+ RangeURI riri = (RangeURI) iri;
+ return new RyaURIRange(convertURI(riri.getStart()), convertURI(riri.getEnd()));
}
- return new RyaURI(uri.stringValue());
+ return new RyaURI(iri.stringValue());
}
public static RyaType convertLiteral(Literal literal) {
@@ -68,7 +68,7 @@ public class RdfToRyaConversions {
return convertLiteral((Literal) value);
}
if (value instanceof RangeValue) {
- RangeValue rv = (RangeValue) value;
+ RangeValue<?> rv = (RangeValue<?>) value;
if (rv.getStart() instanceof IRI) {
return new RyaURIRange(convertURI((IRI) rv.getStart()), convertURI((IRI) rv.getEnd()));
} else {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
index e9e1e46..b43bdaa 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
@@ -37,8 +37,8 @@ import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
public class RyaToRdfConversions {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
- public static IRI convertURI(RyaURI uri) {
- return VF.createIRI(uri.getData());
+ public static IRI convertURI(RyaURI iri) {
+ return VF.createIRI(iri.getData());
}
private static IRI convertURI(RyaType value) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
index 7745b01..88bb1d9 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
@@ -30,15 +30,15 @@ import org.eclipse.rdf4j.query.QueryEvaluationException;
*/
public interface FreeTextIndexer extends RyaSecondaryIndexer {
- /**
- * Query the Free Text Index with specific constraints. A <code>null</code> or empty parameters imply no constraint.
- *
- * @param query
- * the query to perform
- * @param contraints
- * the constraints on the statements returned
- * @return the set of statements that meet the query and other constraints.
- * @throws IOException
- */
+ /**
+ * Query the Free Text Index with specific constraints. A <code>null</code> or empty parameters imply no constraint.
+ *
+ * @param query
+ * the query to perform
+ * @param contraints
+ * the constraints on the statements returned
+ * @return the set of statements that meet the query and other constraints.
+ * @throws IOException
+ */
public CloseableIteration<Statement, QueryEvaluationException> queryText(String query, StatementConstraints contraints) throws IOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
index 974f616..e8dffa6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
@@ -24,8 +24,6 @@ import java.util.Iterator;
import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface IndexedQueryPlanSelector {
-
- TupleExpr getThreshholdQueryPlan(Iterator<TupleExpr> tupleList, double threshhold,
+ public TupleExpr getThreshholdQueryPlan(Iterator<TupleExpr> tupleList, double threshhold,
double indexWeight, double commonVarWeight, double dirProdWeight);
-
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
index a6487df..b25864e 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
@@ -63,7 +63,7 @@ public class AccumuloDocIndexerTest {
private MockInstance mockInstance;
private Connector accCon;
AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- ValueFactory vf = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private String tableName;
@@ -316,11 +316,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createIRI("uri:5"));
+// b1.addBinding("X", VF.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createIRI("uri:15"));
+// b2.addBinding("X", VF.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createIRI("uri:25"));
+// b3.addBinding("X", VF.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
@@ -440,11 +440,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createIRI("uri:15"));
+ b2.addBinding("X", VF.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createIRI("uri:25"));
+ b3.addBinding("X", VF.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -666,11 +666,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createIRI("uri:15"));
+ b2.addBinding("X", VF.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createIRI("uri:25"));
+ b3.addBinding("X", VF.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -779,11 +779,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createIRI("uri:15"));
+ b2.addBinding("X", VF.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createIRI("uri:25"));
+ b3.addBinding("X", VF.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -934,11 +934,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createIRI("uri:5"));
+// b1.addBinding("X", VF.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createIRI("uri:15"));
+// b2.addBinding("X", VF.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createIRI("uri:25"));
+// b3.addBinding("X", VF.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
@@ -1111,11 +1111,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createIRI("uri:15"));
+ b2.addBinding("X", VF.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createIRI("uri:25"));
+ b3.addBinding("X", VF.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -1648,11 +1648,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createIRI("uri:15"));
+ b2.addBinding("X", VF.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createIRI("uri:25"));
+ b3.addBinding("X", VF.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -1850,10 +1850,10 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = new QueryBindingSet();
- b1.addBinding("X", vf.createIRI("uri:5"));
+ b1.addBinding("X", VF.createIRI("uri:5"));
b1.addBinding("Y3", v1);
QueryBindingSet b2 = new QueryBindingSet();
- b2.addBinding("X", vf.createIRI("uri:25"));
+ b2.addBinding("X", VF.createIRI("uri:25"));
b2.addBinding("Y3", v2);
bsList.add(b1);
bsList.add(b2);
@@ -2035,11 +2035,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createIRI("uri:5"));
+// b1.addBinding("X", VF.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createIRI("uri:15"));
+// b2.addBinding("X", VF.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createIRI("uri:25"));
+// b3.addBinding("X", VF.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
index 54b5dcd..d66dc8e 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
@@ -47,7 +47,7 @@ import com.google.common.primitives.Bytes;
public class StarQueryTest {
- ValueFactory vf = SimpleValueFactory.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
@@ -115,8 +115,8 @@ public class StarQueryTest {
QueryBindingSet bs1 = new QueryBindingSet();
QueryBindingSet bs2 = new QueryBindingSet();
- Value v1 = vf.createIRI("uri:hank");
- Value v2 = vf.createIRI("uri:bob");
+ Value v1 = VF.createIRI("uri:hank");
+ Value v2 = VF.createIRI("uri:bob");
bs1.addBinding("X",v1);
bs2.addBinding("X", v1);
@@ -176,8 +176,8 @@ public class StarQueryTest {
QueryBindingSet bs1 = new QueryBindingSet();
QueryBindingSet bs2 = new QueryBindingSet();
- Value v1 = vf.createIRI("uri:hank");
- Value v2 = vf.createIRI("uri:bob");
+ Value v1 = VF.createIRI("uri:hank");
+ Value v2 = VF.createIRI("uri:bob");
bs1.addBinding("X",v1);
bs2.addBinding("X", v1);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
index c169dac..8ff563d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
@@ -201,8 +201,8 @@ public class MongoPCJIndexIT extends MongoITBase {
}
private Set<Statement> getStatements() throws Exception {
- final Set<Statement> statements = new HashSet<>();
- statements.add(VF.createStatement(VF.createIRI("urn:Alice"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ final Set<Statement> statements = new HashSet<>();
+ statements.add(VF.createStatement(VF.createIRI("urn:Alice"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
statements.add(VF.createStatement(VF.createIRI("urn:Bob"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
statements.add(VF.createStatement(VF.createIRI("urn:Charlie"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
statements.add(VF.createStatement(VF.createIRI("urn:David"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
index a82656a..f126d57 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
@@ -234,8 +234,8 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
this.matchVar = matchVar;
}
- protected void addFilter(final IRI uri, final Object[] values) {
- func.add(uri);
+ protected void addFilter(final IRI iri, final Object[] values) {
+ func.add(iri);
args.add(values);
}
}
@@ -249,8 +249,8 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
@Override
public void meet(final FunctionCall call) {
- final IRI fnUri = VF.createIRI(call.getURI());
- final Var resultVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(fnUri, call.getArgs());
+ final IRI fnIri = VF.createIRI(call.getURI());
+ final Var resultVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(fnIri, call.getArgs());
if (resultVar != null && resultVar.getName().equals(matchVar)) {
addFilter(VF.createIRI(call.getURI()), GeoParseUtils.extractArguments(matchVar, call));
if (call.getParentNode() instanceof Filter || call.getParentNode() instanceof And || call.getParentNode() instanceof LeftJoin) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
index 37cb99d..0d3cef9 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
@@ -29,9 +29,9 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
* A repository to store, index, and retrieve {@link Statement}s based on geotemporal features.
*/
public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
- /**
- * initialize after setting configuration.
- */
+ /**
+ * Initialize after setting configuration.
+ */
@Override
public void init();
@@ -88,19 +88,19 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
*/
OVERLAPS(GeoConstants.GEO_SF_OVERLAPS);
- private final IRI uri;
+ private final IRI iri;
- private GeoPolicy(final IRI uri) {
- this.uri = uri;
+ private GeoPolicy(final IRI iri) {
+ this.iri = iri;
}
public IRI getURI() {
- return uri;
+ return iri;
}
- public static GeoPolicy fromURI(final IRI uri) {
+ public static GeoPolicy fromURI(final IRI iri) {
for(final GeoPolicy policy : GeoPolicy.values()) {
- if(policy.getURI().equals(uri)) {
+ if(policy.getURI().equals(iri)) {
return policy;
}
}
@@ -170,11 +170,11 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
INTERVAL_AFTER(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"intervalAfter"));
private final boolean isInstant;
- private final IRI uri;
+ private final IRI iri;
- TemporalPolicy(final boolean isInstant, final IRI uri) {
+ TemporalPolicy(final boolean isInstant, final IRI iri) {
this.isInstant = isInstant;
- this.uri = uri;
+ this.iri = iri;
}
public boolean isInstant(){
@@ -182,12 +182,12 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
}
public IRI getURI() {
- return uri;
+ return iri;
}
- public static TemporalPolicy fromURI(final IRI uri) {
+ public static TemporalPolicy fromURI(final IRI iri) {
for(final TemporalPolicy policy : TemporalPolicy.values()) {
- if(policy.getURI().equals(uri)) {
+ if(policy.getURI().equals(iri)) {
return policy;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
index 2771749..f2f71f0 100644
--- a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
+++ b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
@@ -305,8 +305,8 @@ public class GeoMesaGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
if (contraints.hasPredicates()) {
final List<String> predicates = new ArrayList<String>();
- for (final IRI u : contraints.getPredicates()) {
- predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + u.stringValue() + "') ");
+ for (final IRI iri : contraints.getPredicates()) {
+ predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + iri.stringValue() + "') ");
}
filterParms.add("(" + StringUtils.join(predicates, " OR ") + ")");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
index 8684d11..0709d78 100644
--- a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
+++ b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
@@ -367,8 +367,8 @@ public class GeoWaveGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
if (contraints.hasPredicates()) {
final List<String> predicates = new ArrayList<String>();
- for (final IRI u : contraints.getPredicates()) {
- predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + u.stringValue() + "') ");
+ for (final IRI iri : contraints.getPredicates()) {
+ predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + iri.stringValue() + "') ");
}
filterParms.add("(" + StringUtils.join(predicates, " OR ") + ")");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.reasoning/README.md
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/README.md b/extras/rya.reasoning/README.md
index 6401285..b65b252 100644
--- a/extras/rya.reasoning/README.md
+++ b/extras/rya.reasoning/README.md
@@ -331,10 +331,10 @@ to generate new triples and check for inconsistencies, and add any new triples
to the set of known triples for the next iteration, until there are no new
triples or inconsistencies generated.
-Reasoning is distributed according to URI: Mappers read in triples from Accumulo
+Reasoning is distributed according to IRI: Mappers read in triples from Accumulo
and from previous iterations, and partition triples according to their subject
and object. Reducers perform reasoning around one IRI at a time, receiving as
-input only triples involving that URI. This enables us to use MapReduce, but
+input only triples involving that IRI. This enables us to use MapReduce, but
requires making several passes through the data in cases where information
needs to be propagated several steps through the graph (for example, with
transitivity).
@@ -380,8 +380,8 @@ Together, this yields the following MapReduce jobs and workflow:
`(:c :d :e)` are relevant to the reducer for `:c`, then
`<:c, (:a :b :c)>` will be received before `<:c, (:c :d :e)>`.)
This allows joins to use less memory than they would otherwise need.
- * Reduce: Receives a series of triples involving a single URI. Creates a
- LocalReasoner object for that URI, which combines those triples with
+ * Reduce: Receives a series of triples involving a single IRI. Creates a
+ LocalReasoner object for that IRI, which combines those triples with
the schema knowledge to apply inference rules. Outputs newly generated
triples and/or inconsistencies to files.
2. **DuplicateElimination**
@@ -668,14 +668,14 @@ processType(fact):
The main reasoning logic is located in **org.apache.rya.reasoning**, while MapReduce
tools and utilities for interacting with Accumulo are located in
**org.apache.rya.reasoning.mr**. Reasoning logic makes use of RDF constructs in the
-**org.eclipse.rdf4j.model** API, in particular: Statement, URI, Resource, and Value.
+**org.eclipse.rdf4j.model** API, in particular: Statement, IRI, Resource, and Value.
### org.apache.rya.reasoning
- **OWL2**:
In general, the RDF4J API is used to represent RDF constructs and
refer to the RDF, RDFS, and OWL vocabularies. However, the API only covers
- OWL 1 constructs. The OWL2 class contains static URIs for new OWL 2
+ OWL 1 constructs. The OWL2 class contains static IRIs for new OWL 2
vocabulary resources: owl:IrreflexiveProperty, owl:propertyDisjointWith,
etc.
@@ -685,7 +685,7 @@ tools and utilities for interacting with Accumulo are located in
- **Schema**:
Schema represents the complete schema/TBox/RBox as a set of Java objects.
A schema consists of properties, classes, and their relationships. The
- Schema object maps URIs to instances of OwlProperty and Resources to
+ Schema object maps IRIs to instances of OwlProperty and Resources to
instances of OwlClass.
The schema is built one triple at a time: the Schema takes in a single
@@ -702,7 +702,7 @@ tools and utilities for interacting with Accumulo are located in
Once the schema has been constructed, it can be used in reasoning. The
Schema object serves as a repository for OwlClass and OwlProperty objects,
- accessed by their URIs (or Resources), which in turn contain detailed schema
+ accessed by their IRIs (or Resources), which in turn contain detailed schema
information about themselves.
The Schema class also provides static method isSchemaTriple for checking
@@ -719,7 +719,7 @@ tools and utilities for interacting with Accumulo are located in
Internally, they are represented as sets of those entities they are
connected to, one set for each type of relationship. (For example, each
OwlClass contains a set of its superclasses.) These are accessed via getter
- methods that return sets of URIs or Resources, as appropriate. Both also
+ methods that return sets of IRIs or Resources, as appropriate. Both also
apply some RL schema rules. Some rules are applied by the getter
methods (for example, every class being its own subclass), while others must
be explicitly invoked by the Schema (for example, determining that one
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
index 75313a2..4a6f1af 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
@@ -159,6 +159,9 @@ public abstract class AbstractReasoner {
/**
* Create a Fact representing a triple inferred by this reasoner.
+ * @param s The subject {@link Resource}.
+ * @param p The predicate {@link IRI}.
+ * @param o The object {@link Value}.
* @param rule The specific rule rule that yielded the inference
* @param source One (might be the only) fact used in the derivation
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/extras/vagrantExample/src/main/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/extras/vagrantExample/src/main/vagrant/Vagrantfile b/extras/vagrantExample/src/main/vagrant/Vagrantfile
index bfa882f..247f46c 100644
--- a/extras/vagrantExample/src/main/vagrant/Vagrantfile
+++ b/extras/vagrantExample/src/main/vagrant/Vagrantfile
@@ -315,7 +315,7 @@ EOF
if [[ ! -s ${ryaIndexing}.zip ]] ; then
# Eventually it'll be on maven...
echo "Downloading ${ryaIndexing}.zip quietly, this will take some minutes with no output..."
- download --output ${ryaIndexing}.zip ${mavenRepoUrl}org/apache/rya/rya.indexing.example/${RYA_EXAMPLE_VERSION}/${ryaIndexing}.zip?raw=1 || exit 112
+ download --output ${ryaIndexing}.zip ${mavenRepoUrl}org/apache/rya/rya.indexing.example/${RYA_EXAMPLE_VERSION}/${ryaIndexing}.zip || exit 112
fi
sudo mkdir --parents ${ryaIndexing}
sudo unzip -q -o ${ryaIndexing}.zip -d ${ryaIndexing}
@@ -341,7 +341,7 @@ EOF
ryaVagrant=rya.vagrant.example-${RYA_EXAMPLE_VERSION}
if [[ ! -s ${ryaVagrant}.jar ]] ; then
echo "Downloading ${ryaVagrant}.jar"
- download --output ${ryaVagrant}.jar ${mavenRepoUrl}org/apache/rya/rya.vagrant.example/${RYA_EXAMPLE_VERSION}/${ryaVagrant}.jar?raw=1 || exit 120
+ download --output ${ryaVagrant}.jar ${mavenRepoUrl}org/apache/rya/rya.vagrant.example/${RYA_EXAMPLE_VERSION}/${ryaVagrant}.jar || exit 120
fi
sudo mkdir --parents ${ryaVagrant}
sudo unzip -q -o ${ryaVagrant}.jar -d ${ryaVagrant}
@@ -352,7 +352,7 @@ EOF
ryaWar=web.rya-${RYA_EXAMPLE_VERSION}.war
if [[ ! -s ${ryaWar} ]] ; then
echo "Downloading ${ryaWar}"
- download ${mavenRepoUrl}org/apache/rya/web.rya/${RYA_EXAMPLE_VERSION}/${ryaWar}?raw=1 --output ${ryaWar} || exit 121
+ download ${mavenRepoUrl}org/apache/rya/web.rya/${RYA_EXAMPLE_VERSION}/${ryaWar} --output ${ryaWar} || exit 121
fi
sudo cp ${ryaWar} /var/lib/tomcat7/webapps/web.rya.war
# Wait for the war to deploy
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/855d7155/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
index 2a96ae6..b038604 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
@@ -25,8 +25,8 @@ public class InverseURI implements IRI {
private final IRI impl;
- public InverseURI(final IRI uri) {
- this.impl = uri;
+ public InverseURI(final IRI iri) {
+ this.impl = iri;
}
@Override
[25/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
index 993c758..54b5dcd 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/StarQueryTest.java
@@ -28,26 +28,26 @@ import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
import com.google.common.primitives.Bytes;
public class StarQueryTest {
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
@Test
@@ -115,8 +115,8 @@ public class StarQueryTest {
QueryBindingSet bs1 = new QueryBindingSet();
QueryBindingSet bs2 = new QueryBindingSet();
- Value v1 = vf.createURI("uri:hank");
- Value v2 = vf.createURI("uri:bob");
+ Value v1 = vf.createIRI("uri:hank");
+ Value v2 = vf.createIRI("uri:bob");
bs1.addBinding("X",v1);
bs2.addBinding("X", v1);
@@ -176,8 +176,8 @@ public class StarQueryTest {
QueryBindingSet bs1 = new QueryBindingSet();
QueryBindingSet bs2 = new QueryBindingSet();
- Value v1 = vf.createURI("uri:hank");
- Value v2 = vf.createURI("uri:bob");
+ Value v1 = vf.createIRI("uri:hank");
+ Value v2 = vf.createIRI("uri:bob");
bs1.addBinding("X",v1);
bs2.addBinding("X", v1);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
index 531085d..62396e4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
@@ -1,32 +1,3 @@
-package org.apache.rya.indexing.accumulo.freetext;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.security.Authorizations;
-import org.apache.hadoop.conf.Configuration;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDFS;
-
-import com.google.common.collect.Sets;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -35,9 +6,9 @@ import com.google.common.collect.Sets;
* 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
@@ -45,10 +16,22 @@ import com.google.common.collect.Sets;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.accumulo.freetext;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Set;
-
-import info.aduna.iteration.CloseableIteration;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.TableExistsException;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.admin.TableOperations;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
@@ -57,6 +40,19 @@ import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.collect.Sets;
+
public class AccumuloFreeTextIndexerTest {
private static final StatementConstraints EMPTY_CONSTRAINTS = new StatementConstraints();
@@ -96,13 +92,13 @@ public class AccumuloFreeTextIndexerTest {
f.setMultiTableBatchWriter(ConfigUtils.createMultitableBatchWriter(conf));
f.init();
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
- URI subject = new URIImpl("foo:subj");
- URI predicate = RDFS.LABEL;
+ IRI subject = vf.createIRI("foo:subj");
+ IRI predicate = RDFS.LABEL;
Value object = vf.createLiteral("this is a new hat");
- URI context = new URIImpl("foo:context");
+ IRI context = vf.createIRI("foo:context");
Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
@@ -139,22 +135,22 @@ public class AccumuloFreeTextIndexerTest {
f.setMultiTableBatchWriter(ConfigUtils.createMultitableBatchWriter(conf));
f.init();
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
- URI subject1 = new URIImpl("foo:subj");
- URI predicate1 = RDFS.LABEL;
+ IRI subject1 = vf.createIRI("foo:subj");
+ IRI predicate1 = RDFS.LABEL;
Value object1 = vf.createLiteral("this is a new hat");
- URI context1 = new URIImpl("foo:context");
+ IRI context1 = vf.createIRI("foo:context");
Statement statement1 = vf.createStatement(subject1, predicate1, object1, context1);
f.storeStatement(RdfToRyaConversions.convertStatement(statement1));
- URI subject2 = new URIImpl("foo:subject");
- URI predicate2 = RDFS.LABEL;
+ IRI subject2 = vf.createIRI("foo:subject");
+ IRI predicate2 = RDFS.LABEL;
Value object2 = vf.createLiteral("Do you like my new hat?");
- URI context2 = new URIImpl("foo:context");
+ IRI context2 = vf.createIRI("foo:context");
Statement statement2 = vf.createStatement(subject2, predicate2, object2, context2);
f.storeStatement(RdfToRyaConversions.convertStatement(statement2));
@@ -231,11 +227,11 @@ public class AccumuloFreeTextIndexerTest {
f.setMultiTableBatchWriter(ConfigUtils.createMultitableBatchWriter(conf));
f.init();
- ValueFactory vf = new ValueFactoryImpl();
- URI subject = new URIImpl("foo:subj");
- URI predicate = new URIImpl(RDFS.COMMENT.toString());
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI subject = vf.createIRI("foo:subj");
+ IRI predicate = vf.createIRI(RDFS.COMMENT.toString());
Value object = vf.createLiteral("this is a new hat");
- URI context = new URIImpl("foo:context");
+ IRI context = vf.createIRI("foo:context");
Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
@@ -244,7 +240,7 @@ public class AccumuloFreeTextIndexerTest {
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat", new StatementConstraints().setContext(context))));
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryText("hat", new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryText("hat", new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexerTest.java
index bba1b0d..c8f482d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexerTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya.indexing.accumulo.temporal;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,7 +16,7 @@ package org.apache.rya.indexing.accumulo.temporal;
* specific language governing permissions and limitations
* under the License.
*/
-
+package org.apache.rya.indexing.accumulo.temporal;
import static org.apache.rya.api.resolver.RdfToRyaConversions.convertStatement;
import static org.junit.Assert.assertEquals;
@@ -62,24 +60,22 @@ import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.TemporalInterval;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.QueryEvaluationException;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-
/**
* JUnit tests for TemporalIndexer and it's implementation AccumuloTemporalIndexer
*
@@ -174,7 +170,7 @@ public final class AccumuloTemporalIndexerTest {
seriesTs = new TemporalInstant[SERIES_OF_SECONDS];
for (int i = 0; i <= 40; i++)
seriesTs[i] = makeInstant(i);
- };
+ }
/**
* Make an uniform instant with given seconds.
@@ -185,23 +181,23 @@ public final class AccumuloTemporalIndexerTest {
static {
// Setup the statements only once. Each test will store some of these in there own index table.
- ValueFactory vf = new ValueFactoryImpl();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
// tiB03_E20 read as: time interval that Begins 3 seconds, ends at 20 seconds,
// Each time element the same, except seconds. year, month, .... minute are the same for each statement below.
- spo_B00_E01 = new StatementImpl(vf.createURI("foo:event0"), pred1_atTime, vf.createLiteral(tvB00_E01.toString()));
- spo_B02_E29 = new StatementImpl(vf.createURI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E29.toString()));
- spo_B02_E30 = new StatementImpl(vf.createURI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E30.toString()));
- spo_B02_E31 = new StatementImpl(vf.createURI("foo:event3"), pred1_atTime, vf.createLiteral(tvB02_E31.toString()));
- spo_B02_E40 = new StatementImpl(vf.createURI("foo:event4"), pred1_atTime, vf.createLiteral(tvB02_E40.toString()));
- spo_B03_E20 = new StatementImpl(vf.createURI("foo:event5"), pred1_atTime, vf.createLiteral(tvB03_E20.toString()));
- spo_B29_E30 = new StatementImpl(vf.createURI("foo:event1"), pred1_atTime, vf.createLiteral(tvB29_E30.toString()));
- spo_B30_E32 = new StatementImpl(vf.createURI("foo:event1"), pred1_atTime, vf.createLiteral(tvB30_E32.toString()));
- spo_B02 = new StatementImpl(vf.createURI("foo:event6"), pred1_atTime, vf.createLiteral(tsB02.getAsReadable()));
+ spo_B00_E01 = vf.createStatement(vf.createIRI("foo:event0"), pred1_atTime, vf.createLiteral(tvB00_E01.toString()));
+ spo_B02_E29 = vf.createStatement(vf.createIRI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E29.toString()));
+ spo_B02_E30 = vf.createStatement(vf.createIRI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E30.toString()));
+ spo_B02_E31 = vf.createStatement(vf.createIRI("foo:event3"), pred1_atTime, vf.createLiteral(tvB02_E31.toString()));
+ spo_B02_E40 = vf.createStatement(vf.createIRI("foo:event4"), pred1_atTime, vf.createLiteral(tvB02_E40.toString()));
+ spo_B03_E20 = vf.createStatement(vf.createIRI("foo:event5"), pred1_atTime, vf.createLiteral(tvB03_E20.toString()));
+ spo_B29_E30 = vf.createStatement(vf.createIRI("foo:event1"), pred1_atTime, vf.createLiteral(tvB29_E30.toString()));
+ spo_B30_E32 = vf.createStatement(vf.createIRI("foo:event1"), pred1_atTime, vf.createLiteral(tvB30_E32.toString()));
+ spo_B02 = vf.createStatement(vf.createIRI("foo:event6"), pred1_atTime, vf.createLiteral(tsB02.getAsReadable()));
// Create statements about time instants 0 - 40 seconds
for (int i = 0; i < seriesTs.length; i++) {
- seriesSpo[i] = new StatementImpl(vf.createURI("foo:event0" + i), pred1_atTime, vf.createLiteral(seriesTs[i].getAsReadable()));
+ seriesSpo[i] = vf.createStatement(vf.createIRI("foo:event0" + i), pred1_atTime, vf.createLiteral(seriesTs[i].getAsReadable()));
}
}
@@ -273,7 +269,7 @@ public final class AccumuloTemporalIndexerTest {
}
/**
- * Test method for {@link AccumuloTemporalIndexer#storeStatement(convertStatement(org.openrdf.model.Statement)}
+ * Test method for {@link AccumuloTemporalIndexer#storeStatement(convertStatement(org.eclipse.rdf4j.model.Statement)}
*
* @throws NoSuchAlgorithmException
*/
@@ -282,21 +278,21 @@ public final class AccumuloTemporalIndexerTest {
// count rows expected to store:
int rowsStoredExpected = 0;
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
- URI pred2_circa = vf.createURI(URI_PROPERTY_CIRCA);
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
+ IRI pred2_circa = vf.createIRI(URI_PROPERTY_CIRCA);
// Should not be stored because they are not in the predicate list
String validDateStringWithThirteens = "1313-12-13T13:13:13Z";
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), RDFS.LABEL, vf.createLiteral(validDateStringWithThirteens))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), RDFS.LABEL, vf.createLiteral(validDateStringWithThirteens))));
// Test: Should not store an improper date, and log a warning (log warning not tested).
final String invalidDateString = "ThisIsAnInvalidDate";
// // Silently logs a warning for bad dates. Old: Set true when we catch the error:
// boolean catchErrorThrownCorrectly = false;
// try {
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), pred1_atTime, vf.createLiteral(invalidDateString))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), pred1_atTime, vf.createLiteral(invalidDateString))));
// } catch (IllegalArgumentException e) {
// catchErrorThrownCorrectly = true;
// Assert.assertTrue(
@@ -314,15 +310,15 @@ public final class AccumuloTemporalIndexerTest {
// These should be stored because they are in the predicate list.
// BUT they will get converted to the same exact datetime in UTC.
- Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
- Statement s4 = new StatementImpl(vf.createURI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
+ Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
+ Statement s4 = vf.createStatement(vf.createIRI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
tIndexer.storeStatement(convertStatement(s3));
rowsStoredExpected++;
tIndexer.storeStatement(convertStatement(s4));
rowsStoredExpected++;
// This should not be stored because the object is not a literal
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj5"), pred1_atTime, vf.createURI("in:valid"))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj5"), pred1_atTime, vf.createIRI("in:valid"))));
tIndexer.flush();
@@ -336,18 +332,18 @@ public final class AccumuloTemporalIndexerTest {
// count rows expected to store:
int rowsStoredExpected = 0;
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
- URI pred2_circa = vf.createURI(URI_PROPERTY_CIRCA);
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
+ IRI pred2_circa = vf.createIRI(URI_PROPERTY_CIRCA);
final String testDate2014InBRST = "2014-12-31T23:59:59-02:00";
final String testDate2016InET = "2016-12-31T20:59:59-05:00";
// These should be stored because they are in the predicate list.
// BUT they will get converted to the same exact datetime in UTC.
- Statement s1 = new StatementImpl(vf.createURI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
- Statement s2 = new StatementImpl(vf.createURI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
+ Statement s1 = vf.createStatement(vf.createIRI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
+ Statement s2 = vf.createStatement(vf.createIRI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
tIndexer.storeStatement(convertStatement(s1));
rowsStoredExpected++;
tIndexer.storeStatement(convertStatement(s2));
@@ -367,12 +363,12 @@ public final class AccumuloTemporalIndexerTest {
@Test
public void testStoreStatementWithInterestingLiterals() throws Exception {
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
- tIndexer.storeStatement(convertStatement(new StatementImpl(
- vf.createURI("foo:subj2"),
+ tIndexer.storeStatement(convertStatement(vf.createStatement(
+ vf.createIRI("foo:subj2"),
pred1_atTime,
vf.createLiteral("A number of organizations located, gathered, or classed together. [Derived from Concise Oxford English Dictionary, 11th Edition, 2008]"))));
@@ -381,7 +377,7 @@ public final class AccumuloTemporalIndexerTest {
}
/**
- * Test method for {@link AccumuloTemporalIndexer#storeStatement(convertStatement(org.openrdf.model.Statement)}
+ * Test method for {@link AccumuloTemporalIndexer#storeStatement(convertStatement(org.eclipse.rdf4j.model.Statement)}
*
* @throws NoSuchAlgorithmException
*/
@@ -390,16 +386,16 @@ public final class AccumuloTemporalIndexerTest {
// count rows expected to store:
int rowsStoredExpected = 0;
- ValueFactory vf = new ValueFactoryImpl();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
// Test: Should not store an improper date interval, and log a warning (log warning not tested).
final String invalidDateIntervalString="[bad,interval]";
// Silently logs a warning for bad dates.
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), pred1_atTime, vf.createLiteral(invalidDateIntervalString))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), pred1_atTime, vf.createLiteral(invalidDateIntervalString))));
final String validDateIntervalString="[2016-12-31T20:59:59-05:00,2016-12-31T21:00:00-05:00]";
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), pred1_atTime, vf.createLiteral(validDateIntervalString))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), pred1_atTime, vf.createLiteral(validDateIntervalString))));
rowsStoredExpected++;
tIndexer.flush();
@@ -410,9 +406,9 @@ public final class AccumuloTemporalIndexerTest {
@Test
public void testStoreStatementsSameTime() throws IOException, NoSuchAlgorithmException, AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException {
- ValueFactory vf = new ValueFactoryImpl();
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
- URI pred2_circa = vf.createURI(URI_PROPERTY_CIRCA);
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
+ IRI pred2_circa = vf.createIRI(URI_PROPERTY_CIRCA);
// These are the same datetime instant but from different time
// zones.
@@ -424,9 +420,9 @@ public final class AccumuloTemporalIndexerTest {
// These all should be stored because they are in the predicate list.
// BUT they will get converted to the same exact datetime in UTC.
// So we have to make the key distinct! Good luck indexer!
- Statement s1 = new StatementImpl(vf.createURI("foo:subj1"), pred2_circa, vf.createLiteral(ZONETestDateInET));
- Statement s2 = new StatementImpl(vf.createURI("foo:subj2"), pred1_atTime, vf.createLiteral(ZONETestDateInZulu));
- Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1_atTime, vf.createLiteral(ZONETestDateInBRST));
+ Statement s1 = vf.createStatement(vf.createIRI("foo:subj1"), pred2_circa, vf.createLiteral(ZONETestDateInET));
+ Statement s2 = vf.createStatement(vf.createIRI("foo:subj2"), pred1_atTime, vf.createLiteral(ZONETestDateInZulu));
+ Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1_atTime, vf.createLiteral(ZONETestDateInBRST));
int rowsStoredExpected = 0;
tIndexer.storeStatement(convertStatement(s1));
rowsStoredExpected++;
@@ -894,28 +890,28 @@ public final class AccumuloTemporalIndexerTest {
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
tIndexer.storeStatement(convertStatement(seriesSpo[s]));
}
- ValueFactory vf = new ValueFactoryImpl();
- URI pred3_CIRCA_ = vf.createURI(URI_PROPERTY_CIRCA); // this one to ignore.
- URI pred2_eventTime = vf.createURI(URI_PROPERTY_EVENT_TIME);
- URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI pred3_CIRCA_ = vf.createIRI(URI_PROPERTY_CIRCA); // this one to ignore.
+ IRI pred2_eventTime = vf.createIRI(URI_PROPERTY_EVENT_TIME);
+ IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
// add the predicate = EventTime ; Store in an array for verification.
Statement[] SeriesTs_EventTime = new Statement[expectedResultCount+1];
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
- Statement statement = new StatementImpl(vf.createURI("foo:EventTimeSubj0" + s), pred2_eventTime, vf.createLiteral(seriesTs[s].getAsReadable()));
+ Statement statement = vf.createStatement(vf.createIRI("foo:EventTimeSubj0" + s), pred2_eventTime, vf.createLiteral(seriesTs[s].getAsReadable()));
tIndexer.storeStatement(convertStatement(statement));
if (s>searchForSeconds)
SeriesTs_EventTime[s - searchForSeconds -1 ] = statement;
}
// add the predicate = CIRCA ; to be ignored because it is not in the constraints.
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
- Statement statement = new StatementImpl(vf.createURI("foo:CircaEventSubj0" + s), pred3_CIRCA_, vf.createLiteral(seriesTs[s].getAsReadable()));
+ Statement statement = vf.createStatement(vf.createIRI("foo:CircaEventSubj0" + s), pred3_CIRCA_, vf.createLiteral(seriesTs[s].getAsReadable()));
tIndexer.storeStatement(convertStatement(statement));
}
tIndexer.flush();
CloseableIteration<Statement, QueryEvaluationException> iter;
StatementConstraints constraints = new StatementConstraints();
- constraints.setPredicates(new HashSet<URI>(Arrays.asList( pred2_eventTime, pred1_atTime )));
+ constraints.setPredicates(new HashSet<IRI>(Arrays.asList( pred2_eventTime, pred1_atTime )));
iter = tIndexer.queryInstantAfterInstant(seriesTs[searchForSeconds], constraints); // EMPTY_CONSTRAINTS);//
int count_AtTime = 0;
@@ -953,7 +949,7 @@ public final class AccumuloTemporalIndexerTest {
*/
@Test
public void testGetIndexablePredicates() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException, IOException {
- Set<URI> p = tIndexer.getIndexablePredicates();
+ Set<IRI> p = tIndexer.getIndexablePredicates();
Assert.assertEquals("number of predicates returned:", 3, p.size());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
index 66b79ef..c5b7fa1 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
@@ -22,10 +22,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
@@ -33,22 +35,21 @@ import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.storage.EntityStorage;
import org.apache.rya.indexing.entity.storage.mongo.MongoEntityStorage;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.ImmutableSet;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Integration tests the methods of {@link EntityQueryNode}.
*/
@@ -152,12 +153,12 @@ public class EntityQueryNodeIT extends MongoITBase {
@Test
public void evaluate_constantSubject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
- final ValueFactory vf = ValueFactoryImpl.getInstance();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
final Entity entity = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(20))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
@@ -187,12 +188,12 @@ public class EntityQueryNodeIT extends MongoITBase {
@Test
public void evaluate_variableSubject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
- final ValueFactory vf = ValueFactoryImpl.getInstance();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
final Entity bob = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(20))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
@@ -201,7 +202,7 @@ public class EntityQueryNodeIT extends MongoITBase {
final Entity fred = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(25))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(25)))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("brown"))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Fred"))))
.build();
@@ -240,18 +241,18 @@ public class EntityQueryNodeIT extends MongoITBase {
@Test
public void evaluate_constantObject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
- final ValueFactory vf = ValueFactoryImpl.getInstance();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
final Entity entity = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(20))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
.setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
storage.create(entity);
- // A set of patterns that match a sepecific Entity subject.
+ // A set of patterns that match a specific Entity subject.
final List<StatementPattern> patterns = getSPs(
"SELECT * WHERE { " +
"<urn:SSN:111-11-1111> <" + RDF.TYPE + "> <urn:person> ."+
@@ -264,7 +265,7 @@ public class EntityQueryNodeIT extends MongoITBase {
final CloseableIteration<BindingSet, QueryEvaluationException> rez = node.evaluate(new MapBindingSet());
final MapBindingSet expected = new MapBindingSet();
expected.addBinding("age", vf.createLiteral("20"));
- expected.addBinding("-const-blue", vf.createLiteral("blue"));
+ expected.addBinding(VarNameUtils.createUniqueConstVarNameLiteral("blue"), vf.createLiteral("blue"));
expected.addBinding("name", vf.createLiteral("Bob"));
while(rez.hasNext()) {
assertEquals(expected, rez.next());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
index 79ea998..b124470 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -26,8 +26,8 @@ import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
import org.bson.Document;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
/**
* Tests the methods of {@link EntityDocumentConverter}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
index 8e33d37..cec989e 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -37,8 +37,8 @@ import org.apache.rya.indexing.entity.storage.EntityStorage.EntityAlreadyExistsE
import org.apache.rya.indexing.entity.storage.EntityStorage.EntityStorageException;
import org.apache.rya.indexing.entity.storage.EntityStorage.StaleUpdateException;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java
index 3196793..5ffde39 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverterTest.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -24,9 +24,9 @@ import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
import org.bson.Document;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
/**
* Tests the methods of {@link RyaTypeDocumentConverter}.
@@ -36,7 +36,7 @@ public class RyaTypeDocumentConverterTest {
@Test
public void toDocument() {
// Convert the RyaType into a Document.
- final RyaType ryaType = RdfToRyaConversions.convertLiteral( new ValueFactoryImpl().createLiteral( 4.5 ) );
+ final RyaType ryaType = RdfToRyaConversions.convertLiteral( SimpleValueFactory.getInstance().createLiteral( 4.5 ) );
final Document document = new RyaTypeDocumentConverter().toDocument( ryaType );
// Show the document has the correct structure.
@@ -55,7 +55,7 @@ public class RyaTypeDocumentConverterTest {
final RyaType ryaType = new RyaTypeDocumentConverter().fromDocument( document );
// Show the converted value has the expected structure.
- final RyaType expected = RdfToRyaConversions.convertLiteral( new ValueFactoryImpl().createLiteral( 4.5 ) );
+ final RyaType expected = RdfToRyaConversions.convertLiteral( SimpleValueFactory.getInstance().createLiteral( 4.5 ) );
assertEquals(expected, ryaType);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
index 28fd330..dd1644b 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -33,9 +33,9 @@ import org.apache.rya.indexing.entity.storage.TypeStorage;
import org.apache.rya.indexing.entity.storage.mongo.MongoEntityStorage;
import org.apache.rya.indexing.entity.storage.mongo.MongoTypeStorage;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloConstantPcjIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloConstantPcjIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloConstantPcjIT.java
index 5d53737..1644ed1 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloConstantPcjIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloConstantPcjIT.java
@@ -1,7 +1,3 @@
-package org.apache.rya.indexing.external;
-
-import java.net.UnknownHostException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +16,9 @@ import java.net.UnknownHostException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.external;
+import java.net.UnknownHostException;
import java.util.List;
import org.apache.accumulo.core.client.AccumuloException;
@@ -30,42 +28,41 @@ import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.pcj.storage.PcjException;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
+import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.SailException;
import com.google.common.base.Optional;
-import org.apache.rya.api.persist.RyaDAOException;
-import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
-
public class AccumuloConstantPcjIT {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private SailRepositoryConnection conn, pcjConn;
private SailRepository repo, pcjRepo;
private Connector accCon;
String prefix = "table_";
String tablename = "table_INDEX_";
- URI obj, obj2, subclass, subclass2, talksTo;
+ IRI obj, obj2, subclass, subclass2, talksTo;
@Before
public void init() throws RepositoryException,
@@ -81,21 +78,21 @@ public class AccumuloConstantPcjIT {
pcjRepo = PcjIntegrationTestingUtil.getAccumuloPcjRepo(prefix, "instance");
pcjConn = pcjRepo.getConnection();
- final URI sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ final IRI sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
conn.add(sub, talksTo, obj);
- final URI sub2 = new URIImpl("uri:entity2");
- subclass2 = new URIImpl("uri:class2");
- obj2 = new URIImpl("uri:obj2");
+ final IRI sub2 = VF.createIRI("uri:entity2");
+ subclass2 = VF.createIRI("uri:class2");
+ obj2 = VF.createIRI("uri:obj2");
conn.add(sub2, RDF.TYPE, subclass2);
- conn.add(sub2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(sub2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub2, talksTo, obj2);
accCon = new MockInstance("instance").getConnector("root",new PasswordToken(""));
@@ -120,16 +117,16 @@ public class AccumuloConstantPcjIT {
MalformedQueryException, SailException, QueryEvaluationException,
TupleQueryResultHandlerException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -158,10 +155,10 @@ public class AccumuloConstantPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final CountingResultHandler crh1 = new CountingResultHandler();
final CountingResultHandler crh2 = new CountingResultHandler();
@@ -182,26 +179,26 @@ public class AccumuloConstantPcjIT {
MalformedQueryException, SailException, QueryEvaluationException,
TupleQueryResultHandlerException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
- final URI sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ final IRI sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
- final URI howlsAt = new URIImpl("uri:howlsAt");
- final URI subType = new URIImpl("uri:subType");
+ final IRI howlsAt = VF.createIRI("uri:howlsAt");
+ final IRI subType = VF.createIRI("uri:subType");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub, howlsAt, superclass);
conn.add(superclass, subType, obj);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -239,14 +236,14 @@ public class AccumuloConstantPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 3,
indexSparqlString3,
new String[] { "wolf", "sheep", "chicken" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final CountingResultHandler crh1 = new CountingResultHandler();
final CountingResultHandler crh2 = new CountingResultHandler();
@@ -269,15 +266,15 @@ public class AccumuloConstantPcjIT {
TupleQueryResultHandlerException, AccumuloException,
AccumuloSecurityException {
- final URI e1 = new URIImpl("uri:e1");
- final URI e2 = new URIImpl("uri:e2");
- final URI e3 = new URIImpl("uri:e3");
- final URI f1 = new URIImpl("uri:f1");
- final URI f2 = new URIImpl("uri:f2");
- final URI f3 = new URIImpl("uri:f3");
- final URI g1 = new URIImpl("uri:g1");
- final URI g2 = new URIImpl("uri:g2");
- final URI g3 = new URIImpl("uri:g3");
+ final IRI e1 = VF.createIRI("uri:e1");
+ final IRI e2 = VF.createIRI("uri:e2");
+ final IRI e3 = VF.createIRI("uri:e3");
+ final IRI f1 = VF.createIRI("uri:f1");
+ final IRI f2 = VF.createIRI("uri:f2");
+ final IRI f3 = VF.createIRI("uri:f3");
+ final IRI g1 = VF.createIRI("uri:g1");
+ final IRI g2 = VF.createIRI("uri:g2");
+ final IRI g3 = VF.createIRI("uri:g3");
conn.add(e1, talksTo, f1);
conn.add(f1, talksTo, g1);
@@ -309,7 +306,7 @@ public class AccumuloConstantPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "a", "b", "c", "d" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final CountingResultHandler crh1 = new CountingResultHandler();
final CountingResultHandler crh2 = new CountingResultHandler();
@@ -330,8 +327,8 @@ public class AccumuloConstantPcjIT {
TableNotFoundException,
TupleQueryResultHandlerException, AccumuloException, AccumuloSecurityException {
- final URI e1 = new URIImpl("uri:e1");
- final URI f1 = new URIImpl("uri:f1");
+ final IRI e1 = VF.createIRI("uri:e1");
+ final IRI f1 = VF.createIRI("uri:f1");
conn.add(e1, talksTo, e1);
conn.add(e1, talksTo, f1);
@@ -357,7 +354,7 @@ public class AccumuloConstantPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "a", "b", "c", "d" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final CountingResultHandler crh1 = new CountingResultHandler();
final CountingResultHandler crh2 = new CountingResultHandler();
[14/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/export/kafka/KryoVisibilityBindingSetSerializer.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/export/kafka/KryoVisibilityBindingSetSerializer.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/export/kafka/KryoVisibilityBindingSetSerializer.java
index f4182e0..ee79e4a 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/export/kafka/KryoVisibilityBindingSetSerializer.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/export/kafka/KryoVisibilityBindingSetSerializer.java
@@ -28,15 +28,14 @@ import org.apache.kafka.common.serialization.Serializer;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.ListBindingSet;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.ListBindingSet;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
@@ -54,6 +53,7 @@ public class KryoVisibilityBindingSetSerializer implements Serializer<Visibility
return kryo;
};
};
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* Deserialize a VisibilityBindingSet using Kyro lib. Exporting results of queries.
@@ -111,13 +111,12 @@ public class KryoVisibilityBindingSetSerializer implements Serializer<Visibility
// Do nothing.
}
- private static Value makeValue(final String valueString, final URI typeURI) {
+ private static Value makeValue(final String valueString, final IRI typeURI) {
// Convert the String Value into a Value.
- final ValueFactory valueFactory = ValueFactoryImpl.getInstance();
if (typeURI.equals(XMLSchema.ANYURI)) {
- return valueFactory.createURI(valueString);
+ return VF.createIRI(valueString);
} else {
- return valueFactory.createLiteral(valueString, typeURI);
+ return VF.createLiteral(valueString, typeURI);
}
}
@@ -135,7 +134,7 @@ public class KryoVisibilityBindingSetSerializer implements Serializer<Visibility
output.writeString(binding.getName());
final RyaType ryaValue = RdfToRyaConversions.convertValue(binding.getValue());
final String valueString = ryaValue.getData();
- final URI type = ryaValue.getDataType();
+ final IRI type = ryaValue.getDataType();
output.writeString(valueString);
output.writeString(type.toString());
}
@@ -150,7 +149,7 @@ public class KryoVisibilityBindingSetSerializer implements Serializer<Visibility
for (int i = bindingCount; i > 0; i--) {
namesList.add(input.readString());
final String valueString = input.readString();
- final URI type = new URIImpl(input.readString());
+ final IRI type = VF.createIRI(input.readString());
valuesList.add(makeValue(valueString, type));
}
final BindingSet bindingSet = new ListBindingSet(namesList, valuesList);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/AggregationObserver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/AggregationObserver.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/AggregationObserver.java
index e806b15..0823b70 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/AggregationObserver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/AggregationObserver.java
@@ -30,7 +30,7 @@ import org.apache.rya.indexing.pcj.fluo.app.AggregationResultUpdater.ObjectSeria
import org.apache.rya.indexing.pcj.fluo.app.BindingSetRow;
import org.apache.rya.indexing.pcj.fluo.app.query.AggregationMetadata;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/FilterObserver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/FilterObserver.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/FilterObserver.java
index e4c30e8..ee727ce 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/FilterObserver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/FilterObserver.java
@@ -28,7 +28,7 @@ import org.apache.rya.indexing.pcj.fluo.app.BindingSetRow;
import org.apache.rya.indexing.pcj.fluo.app.query.FilterMetadata;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Notified when the results of a Filter have been updated to include a new
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/JoinObserver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/JoinObserver.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/JoinObserver.java
index 4e5511f..63f3eb8 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/JoinObserver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/JoinObserver.java
@@ -28,7 +28,7 @@ import org.apache.rya.indexing.pcj.fluo.app.BindingSetRow;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Notified when the results of a Join have been updated to include a new
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/StatementPatternObserver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/StatementPatternObserver.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/StatementPatternObserver.java
index 4db1840..d59d64b 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/StatementPatternObserver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/StatementPatternObserver.java
@@ -28,7 +28,7 @@ import org.apache.rya.indexing.pcj.fluo.app.BindingSetRow;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.query.StatementPatternMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Notified when the results of a Statement Pattern have been updated to include
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/TripleObserver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/TripleObserver.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/TripleObserver.java
index a6ee325..751cc6e 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/TripleObserver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/TripleObserver.java
@@ -28,6 +28,7 @@ import org.apache.fluo.api.data.Bytes;
import org.apache.fluo.api.data.Column;
import org.apache.fluo.api.observer.AbstractObserver;
import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.IncUpdateDAO;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
@@ -140,7 +141,7 @@ public class TripleObserver extends AbstractObserver {
// Extract the binding names and values.
for(int i = 0; i < 3; i ++) {
- if(patternArray[i].startsWith("-const-")) {
+ if(VarNameUtils.isConstant(patternArray[i])) {
// If a constant value does not match, then the triple does not match the pattern.
if(!patternArray[i].substring(7).equals(tripleArray[i])) {
return "";
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/ConstructQueryMetadata.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/ConstructQueryMetadata.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/ConstructQueryMetadata.java
index 6bf968e..ea0499b 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/ConstructQueryMetadata.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/ConstructQueryMetadata.java
@@ -1,5 +1,3 @@
-package org.apache.rya.indexing.pcj.fluo.app.query;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,10 +16,12 @@ package org.apache.rya.indexing.pcj.fluo.app.query;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.rya.indexing.pcj.fluo.app.ConstructGraph;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryNode.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryNode.java
index f1ade59..61ebcc6 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryNode.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryNode.java
@@ -23,13 +23,13 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.rya.indexing.pcj.fluo.app.util.PeriodicQueryUtil;
-import org.openrdf.query.algebra.QueryModelVisitor;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
-import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
/**
* This is a {@link UnaryTupleOperator} that gets placed in the parsed query
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/SparqlFluoQueryBuilder.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/SparqlFluoQueryBuilder.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/SparqlFluoQueryBuilder.java
index 57ae9d2..e311846 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/SparqlFluoQueryBuilder.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/SparqlFluoQueryBuilder.java
@@ -31,6 +31,7 @@ import static org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants.SP
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -42,6 +43,7 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.rya.api.client.CreatePCJ.ExportStrategy;
import org.apache.rya.api.client.CreatePCJ.QueryType;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.function.aggregation.AggregationElement;
import org.apache.rya.api.function.aggregation.AggregationType;
import org.apache.rya.indexing.pcj.fluo.app.ConstructGraph;
@@ -56,33 +58,34 @@ import org.apache.rya.indexing.pcj.fluo.app.util.FluoQueryUtils;
import org.apache.rya.indexing.pcj.fluo.app.util.PeriodicQueryUtil;
import org.apache.rya.indexing.pcj.fluo.app.util.VariableOrderUpdateVisitor.UpdateAction;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.AggregateOperator;
-import org.openrdf.query.algebra.BNodeGenerator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Group;
-import org.openrdf.query.algebra.GroupElem;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.Reduced;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.AggregateOperator;
+import org.eclipse.rdf4j.query.algebra.BNodeGenerator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Group;
+import org.eclipse.rdf4j.query.algebra.GroupElem;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.Reduced;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
@@ -103,6 +106,7 @@ public class SparqlFluoQueryBuilder {
private String queryId;
private NodeIds nodeIds;
private Optional<Integer> joinBatchSize = Optional.empty();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
//Default behavior is to export to Kafka - subject to change when user can
//specify their own export strategy
@@ -283,7 +287,7 @@ public class SparqlFluoQueryBuilder {
* the node to a {@link FluoQuery.Builder}. This information is used by the
* application's observers to incrementally update a PCJ.
*/
- public static class NewQueryVisitor extends QueryModelVisitorBase<RuntimeException> {
+ public static class NewQueryVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final NodeIds nodeIds;
private final FluoQuery.Builder fluoQueryBuilder;
@@ -291,8 +295,6 @@ public class SparqlFluoQueryBuilder {
/**
* Constructs an instance of {@link NewQueryVisitor}.
*
- * @param sparql - The SPARQL query whose structure will be represented
- * within a Fluo application. (not null)
* @param fluoQueryBuilder - The builder that will be updated by this
* vistior to include metadata about each of the query nodes. (not null)
* @param nodeIds - The NodeIds object is passed in so that other parts
@@ -341,7 +343,7 @@ public class SparqlFluoQueryBuilder {
final String resultBindingName = groupElem.getName();
final AtomicReference<String> aggregatedBindingName = new AtomicReference<>();
- groupElem.visitChildren(new QueryModelVisitorBase<RuntimeException>() {
+ groupElem.visitChildren(new AbstractQueryModelVisitor<RuntimeException>() {
@Override
public void meet(final Var node) {
aggregatedBindingName.set( node.getName() );
@@ -529,7 +531,8 @@ public class SparqlFluoQueryBuilder {
// update variable order of this node and all ancestors to
// include BIN_ID binding as
// first variable in the ordering
- FluoQueryUtils.updateVarOrders(fluoQueryBuilder, UpdateAction.AddVariable, Arrays.asList(IncrementalUpdateConstants.PERIODIC_BIN_ID), periodicId);
+ FluoQueryUtils.updateVarOrders(fluoQueryBuilder, UpdateAction.AddVariable,
+ Collections.singletonList(IncrementalUpdateConstants.PERIODIC_BIN_ID), periodicId);
// Walk to the next node.
node.getArg().visit(this);
}
@@ -633,7 +636,7 @@ public class SparqlFluoQueryBuilder {
final Value value = ((ValueConstant) expr).getValue();
valueMap.put(name, value);
} else if(expr instanceof BNodeGenerator) {
- valueMap.put(name, new BNodeImpl(UUID.randomUUID().toString()));
+ valueMap.put(name, VF.createBNode(UUID.randomUUID().toString()));
}
}
@@ -683,7 +686,7 @@ public class SparqlFluoQueryBuilder {
final Set<String> vars = Sets.newHashSet();
for(final String bindingName : node.getBindingNames()) {
- if(!bindingName.startsWith("-const-")) {
+ if (!VarNameUtils.isConstant(bindingName)) {
vars.add(bindingName);
}
}
@@ -784,7 +787,7 @@ public class SparqlFluoQueryBuilder {
builder.setQueryType(locator.getQueryType());
}
- public static class QueryMetadataLocator extends QueryModelVisitorBase<Exception> {
+ public static class QueryMetadataLocator extends AbstractQueryModelVisitor<Exception> {
private VariableOrder varOrder;
private QueryType queryType;
@@ -850,13 +853,13 @@ public class SparqlFluoQueryBuilder {
return getConstructGraphVarOrder(projections);
}
- private static VariableOrder getConstructGraphVarOrder(final List<ProjectionElemList> projections) {
+ private static VariableOrder getConstructGraphVarOrder(List<ProjectionElemList> projections) {
final Set<String> varOrders = new HashSet<>();
for(final ProjectionElemList elems: projections) {
for(final ProjectionElem elem: elems.getElements()) {
final String name = elem.getSourceName();
- if(!name.startsWith("-const-") && !name.startsWith("-anon-")) {
+ if (!VarNameUtils.isConstant(name) && !VarNameUtils.isAnonymous(name)) {
varOrders.add(name);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunction.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunction.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunction.java
index e4485e0..1e3b250 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunction.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunction.java
@@ -30,7 +30,7 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetStringConverter;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Value;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingSetUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingSetUtil.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingSetUtil.java
index 30f026c..9321c1e 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingSetUtil.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingSetUtil.java
@@ -21,9 +21,9 @@ package org.apache.rya.indexing.pcj.fluo.app.util;
import static java.util.Objects.requireNonNull;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
/**
* A utility class that defines functions that make it easier to work with {@link BindingSet} objects.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializer.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializer.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializer.java
index 6c99809..2a59315 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializer.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializer.java
@@ -21,15 +21,15 @@ package org.apache.rya.indexing.pcj.fluo.app.util;
import java.util.HashSet;
import java.util.Set;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.SingletonSet;
-import org.openrdf.query.algebra.evaluation.function.Function;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.ParsedTupleQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.SingletonSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.ParsedTupleQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
/**
* Class for creating a String representation a given Filter, and for
@@ -85,7 +85,7 @@ public class FilterSerializer {
}
}
- public static class FilterVisitor extends QueryModelVisitorBase<RuntimeException> {
+ public static class FilterVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<Filter> filters;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
index 406ba4c..17fedf7 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/PeriodicQueryUtil.java
@@ -31,26 +31,26 @@ import org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants;
import org.apache.rya.indexing.pcj.fluo.app.NodeType;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.query.PeriodicQueryNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.Group;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.Reduced;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.Group;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.Reduced;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
@@ -60,12 +60,12 @@ import com.google.common.base.Preconditions;
*/
public class PeriodicQueryUtil {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
public static final String PeriodicQueryURI = "http://org.apache.rya/function#periodic";
public static final String temporalNameSpace = "http://www.w3.org/2006/time#";
- public static final URI DAYS = vf.createURI("http://www.w3.org/2006/time#days");
- public static final URI HOURS = vf.createURI("http://www.w3.org/2006/time#hours");
- public static final URI MINUTES = vf.createURI("http://www.w3.org/2006/time#minutes");
+ public static final IRI DAYS = VF.createIRI("http://www.w3.org/2006/time#days");
+ public static final IRI HOURS = VF.createIRI("http://www.w3.org/2006/time#hours");
+ public static final IRI MINUTES = VF.createIRI("http://www.w3.org/2006/time#minutes");
/**
* Returns a PeriodicQueryNode for all {@link FunctionCall}s that represent PeriodicQueryNodes, otherwise
@@ -105,7 +105,7 @@ public class PeriodicQueryUtil {
* Locates Filter containing FunctionCall with PeriodicQuery info and
* replaces that Filter with a PeriodicQueryNode.
*/
- public static class PeriodicQueryNodeVisitor extends QueryModelVisitorBase<RuntimeException> {
+ public static class PeriodicQueryNodeVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private int count = 0;
private PeriodicQueryNode periodicNode;
@@ -145,7 +145,7 @@ public class PeriodicQueryUtil {
* whose variable order needs to be changed when the PeriodicQueryMetadata
* is added.
*/
- public static class PeriodicQueryNodeRelocator extends QueryModelVisitorBase<RuntimeException> {
+ public static class PeriodicQueryNodeRelocator extends AbstractQueryModelVisitor<RuntimeException> {
private UnaryTupleOperator relocationParent;
@@ -261,8 +261,8 @@ public class PeriodicQueryUtil {
}
private static TimeUnit getTimeUnit(ValueConstant val) {
- Preconditions.checkArgument(val.getValue() instanceof URI);
- URI uri = (URI) val.getValue();
+ Preconditions.checkArgument(val.getValue() instanceof IRI);
+ IRI uri = (IRI) val.getValue();
Preconditions.checkArgument(uri.getNamespace().equals(temporalNameSpace));
switch (uri.getLocalName()) {
@@ -282,7 +282,7 @@ public class PeriodicQueryUtil {
Preconditions.checkArgument(val instanceof Literal);
Literal literal = (Literal) val;
String stringVal = literal.getLabel();
- URI dataType = literal.getDatatype();
+ IRI dataType = literal.getDatatype();
Preconditions.checkArgument(dataType.equals(XMLSchema.DECIMAL) || dataType.equals(XMLSchema.DOUBLE)
|| dataType.equals(XMLSchema.FLOAT) || dataType.equals(XMLSchema.INTEGER) || dataType.equals(XMLSchema.INT));
return Double.parseDouble(stringVal);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/RowKeyUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/RowKeyUtil.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/RowKeyUtil.java
index ffb2320..d7fa626 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/RowKeyUtil.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/util/RowKeyUtil.java
@@ -24,7 +24,7 @@ import org.apache.fluo.api.data.Bytes;
import org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetStringConverter;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Charsets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
index bab8cde..c52a72a 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -28,21 +29,21 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
public class ConstructGraphTest {
- private ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testConstructGraph() throws MalformedQueryException, UnsupportedEncodingException {
@@ -54,9 +55,9 @@ public class ConstructGraphTest {
ConstructGraph graph = new ConstructGraph(patterns);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", vf.createURI("uri:Joe"));
- bs.addBinding("y", vf.createURI("uri:Bob"));
- bs.addBinding("z", vf.createURI("uri:BurgerShack"));
+ bs.addBinding("x", VF.createIRI("uri:Joe"));
+ bs.addBinding("y", VF.createIRI("uri:Bob"));
+ bs.addBinding("z", VF.createIRI("uri:BurgerShack"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs,"FOUO");
Set<RyaStatement> statements = graph.createGraphFromBindingSet(vBs);
@@ -77,8 +78,8 @@ public class ConstructGraphTest {
ConstructGraph graph = new ConstructGraph(patterns);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", vf.createURI("uri:Joe"));
- bs.addBinding("z", vf.createURI("uri:BurgerShack"));
+ bs.addBinding("x", VF.createIRI("uri:Joe"));
+ bs.addBinding("z", VF.createIRI("uri:BurgerShack"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs, "FOUO");
Set<RyaStatement> statements = graph.createGraphFromBindingSet(vBs);
Set<RyaStatement> statements2 = graph.createGraphFromBindingSet(vBs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
index a12b6de..d505b33 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -26,8 +27,8 @@ import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
+import org.eclipse.rdf4j.model.Statement;
import org.junit.Assert;
-import org.openrdf.model.Statement;
import com.google.common.base.Objects;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
index 975c527..f884b7b 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
@@ -1,4 +1,5 @@
package org.apache.rya.indexing.pcj.fluo.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,6 +18,7 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import static org.junit.Assert.assertEquals;
import java.io.UnsupportedEncodingException;
@@ -26,22 +28,23 @@ import java.util.Map;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.BNode;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class ConstructProjectionTest {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testConstructProjectionProjectSubj() throws MalformedQueryException, UnsupportedEncodingException {
@@ -53,7 +56,7 @@ public class ConstructProjectionTest {
ConstructProjection projection = new ConstructProjection(patterns.get(0));
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", vf.createURI("uri:Joe"));
+ bs.addBinding("x", VF.createIRI("uri:Joe"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs, "FOUO");
RyaStatement statement = projection.projectBindingSet(vBs, new HashMap<>());
@@ -74,7 +77,7 @@ public class ConstructProjectionTest {
ConstructProjection projection = new ConstructProjection(patterns.get(0));
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("p", vf.createURI("uri:worksWith"));
+ bs.addBinding("p", VF.createIRI("uri:worksWith"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
RyaStatement statement = projection.projectBindingSet(vBs, new HashMap<>());
@@ -95,11 +98,11 @@ public class ConstructProjectionTest {
ConstructProjection projection = new ConstructProjection(patterns.get(0));
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("o", vf.createURI("uri:Bob"));
+ bs.addBinding("o", VF.createIRI("uri:Bob"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
- BNode bNode = vf.createBNode();
+ BNode bNode = VF.createBNode();
Map<String, BNode> bNodeMap = new HashMap<>();
- bNodeMap.put("-anon-1", bNode);
+ bNodeMap.put(VarNameUtils.prependAnonymous("1"), bNode);
RyaStatement statement = projection.projectBindingSet(vBs,bNodeMap);
RyaStatement expected = new RyaStatement(RdfToRyaConversions.convertResource(bNode), new RyaURI("uri:talksTo"), new RyaURI("uri:Bob"));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverterTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverterTest.java
index 60e1bc1..c49a06c 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverterTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverterTest.java
@@ -18,28 +18,31 @@
*/
package org.apache.rya.indexing.pcj.fluo.app;
+import static org.apache.rya.api.domain.VarNameUtils.prependConstant;
+import static org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants.TYPE_DELIM;
import static org.junit.Assert.assertEquals;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
/**
* Tests the methods of {@link FluoStringConverterTest}.
*/
public class FluoStringConverterTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void statementPatternToString() throws MalformedQueryException {
// Setup a StatementPattern that represents "?x <http://worksAt> <http://Chipotle>."
final Var subject = new Var("x");
- final Var predicate = new Var("-const-http://worksAt", new URIImpl("http://worksAt"));
+ final Var predicate = new Var(prependConstant("http://worksAt"), VF.createIRI("http://worksAt"));
predicate.setConstant(true);
- final Var object = new Var("-const-http://Chipotle", new URIImpl("http://Chipotle"));
+ final Var object = new Var(prependConstant("http://Chipotle"), VF.createIRI("http://Chipotle"));
object.setConstant(true);
final StatementPattern pattern = new StatementPattern(subject, predicate, object);
@@ -48,8 +51,8 @@ public class FluoStringConverterTest {
// Ensure it converted to the expected result.
final String expected = "x:::" +
- "-const-http://worksAt<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::" +
- "-const-http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI";
+ prependConstant("http://worksAt<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::") +
+ prependConstant("http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI");
assertEquals(spString, expected);
}
@@ -58,17 +61,17 @@ public class FluoStringConverterTest {
public void stringToStatementPattern() {
// Setup the String representation of a statement pattern.
final String patternString = "x:::" +
- "-const-http://worksAt<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::" +
- "-const-http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI";
+ prependConstant("http://worksAt<<~>>http://www.w3.org/2001/XMLSchema#anyURI:::") +
+ prependConstant("http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI");
// Convert it to a StatementPattern.
final StatementPattern statementPattern = FluoStringConverter.toStatementPattern(patternString);
// Enusre it converted to the expected result.
final Var subject = new Var("x");
- final Var predicate = new Var("-const-http://worksAt", new URIImpl("http://worksAt"));
+ final Var predicate = new Var(prependConstant("http://worksAt"), VF.createIRI("http://worksAt"));
predicate.setConstant(true);
- final Var object = new Var("-const-http://Chipotle", new URIImpl("http://Chipotle"));
+ final Var object = new Var(prependConstant("http://Chipotle"), VF.createIRI("http://Chipotle"));
object.setConstant(true);
final StatementPattern expected = new StatementPattern(subject, predicate, object);
@@ -78,13 +81,13 @@ public class FluoStringConverterTest {
@Test
public void toVar_uri() {
// Setup the string representation of the variable.
- final String varString = "-const-http://Chipotle<<~>>http://www.w3.org/2001/XMLSchema#anyURI";
+ final String varString = String.format(prependConstant("http://Chipotle%s%s"),TYPE_DELIM,XMLSchema.ANYURI );
// Convert it to a Var object.
final Var var = FluoStringConverter.toVar(varString);
// Ensure it converted to the expected result.
- final Var expected = new Var("-const-http://Chipotle", new URIImpl("http://Chipotle"));
+ final Var expected = new Var(prependConstant("http://Chipotle"), VF.createIRI("http://Chipotle"));
expected.setConstant(true);
assertEquals(expected, var);
@@ -93,13 +96,13 @@ public class FluoStringConverterTest {
@Test
public void toVar_int() throws MalformedQueryException {
// Setup the string representation of the variable.
- final String varString = "-const-5<<~>>http://www.w3.org/2001/XMLSchema#integer";
+ final String varString = prependConstant("5<<~>>http://www.w3.org/2001/XMLSchema#integer");
// Convert it to a Var object.
final Var result = FluoStringConverter.toVar(varString);
// Ensure it converted to the expected result.
- final Var expected = new Var("-const-5", new LiteralImpl("5", XMLSchema.INTEGER));
+ final Var expected = new Var(prependConstant("5"), VF.createLiteral("5", XMLSchema.INTEGER));
expected.setConstant(true);
assertEquals(expected, result);
@@ -108,13 +111,13 @@ public class FluoStringConverterTest {
@Test
public void toVar_string() {
// Setup the string representation of the variable.
- final String varString = "-const-Chipotle<<~>>http://www.w3.org/2001/XMLSchema#string";
+ final String varString = prependConstant("Chipotle<<~>>http://www.w3.org/2001/XMLSchema#string");
// Convert it to a Var object.
final Var result = FluoStringConverter.toVar(varString);
// Ensure it converted to the expected result.
- final Var expected = new Var("-const-Chipotle", new LiteralImpl("Chipotle", XMLSchema.STRING));
+ final Var expected = new Var(prependConstant("Chipotle"), VF.createLiteral("Chipotle", XMLSchema.STRING));
expected.setConstant(true);
assertEquals(expected, result);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
index 8b9feaf..9a9feef 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
@@ -17,17 +17,18 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import static org.junit.Assert.assertEquals;
import java.util.UUID;
-import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.indexing.pcj.fluo.app.export.kafka.RyaSubGraphKafkaSerDe;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
public class RyaSubGraphKafkaSerDeTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/batch/serializer/BatchInformationSerializerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/batch/serializer/BatchInformationSerializerTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/batch/serializer/BatchInformationSerializerTest.java
index 2c37462..cc9c825 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/batch/serializer/BatchInformationSerializerTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/batch/serializer/BatchInformationSerializerTest.java
@@ -32,11 +32,13 @@ import org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation;
import org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
public class BatchInformationSerializerTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testSpanBatchInformationSerialization() {
@@ -54,8 +56,8 @@ public class BatchInformationSerializerTest {
public void testJoinBatchInformationSerialization() {
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("a", new URIImpl("urn:123"));
- bs.addBinding("b", new URIImpl("urn:456"));
+ bs.addBinding("a", VF.createIRI("urn:123"));
+ bs.addBinding("b", VF.createIRI("urn:456"));
VisibilityBindingSet vBis = new VisibilityBindingSet(bs, "FOUO");
JoinBatchInformation batch = JoinBatchInformation.builder().setBatchSize(1000).setTask(Task.Update)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryUtilTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryUtilTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryUtilTest.java
index 55455a7..3482e0d 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryUtilTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/PeriodicQueryUtilTest.java
@@ -31,34 +31,34 @@ import org.apache.rya.indexing.pcj.fluo.app.util.PeriodicQueryUtil;
import org.apache.rya.indexing.pcj.fluo.app.util.PeriodicQueryUtil.PeriodicQueryNodeRelocator;
import org.apache.rya.indexing.pcj.fluo.app.util.PeriodicQueryUtil.PeriodicQueryNodeVisitor;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class PeriodicQueryUtilTest {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void periodicNodeNotPresentTest() throws Exception {
- List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(vf.createLiteral(12.0)), new ValueConstant(vf.createLiteral(6.0)), new ValueConstant(vf.createURI(PeriodicQueryUtil.temporalNameSpace + "hours")));
+ List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(VF.createLiteral(12.0)), new ValueConstant(VF.createLiteral(6.0)), new ValueConstant(VF.createIRI(PeriodicQueryUtil.temporalNameSpace + "hours")));
FunctionCall func = new FunctionCall("uri:func", values);
Optional<PeriodicQueryNode> node1 = PeriodicQueryUtil.getPeriodicQueryNode(func, new Join());
Assert.assertEquals(false, node1.isPresent());
@@ -69,7 +69,7 @@ public class PeriodicQueryUtilTest {
@Test
public void periodicNodePresentTest() throws Exception {
- List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(vf.createLiteral(12.0)), new ValueConstant(vf.createLiteral(6.0)), new ValueConstant(vf.createURI(PeriodicQueryUtil.temporalNameSpace + "hours")));
+ List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(VF.createLiteral(12.0)), new ValueConstant(VF.createLiteral(6.0)), new ValueConstant(VF.createIRI(PeriodicQueryUtil.temporalNameSpace + "hours")));
FunctionCall func = new FunctionCall(PeriodicQueryUtil.PeriodicQueryURI, values);
Optional<PeriodicQueryNode> node1 = PeriodicQueryUtil.getPeriodicQueryNode(func, new Join());
Assert.assertEquals(true, node1.isPresent());
@@ -83,7 +83,7 @@ public class PeriodicQueryUtilTest {
@Test
public void periodicNodeFractionalDurationTest() throws Exception {
- List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(vf.createLiteral(1)), new ValueConstant(vf.createLiteral(.5)), new ValueConstant(vf.createURI(PeriodicQueryUtil.temporalNameSpace + "hours")));
+ List<ValueExpr> values = Arrays.asList(new Var("time"), new ValueConstant(VF.createLiteral(1)), new ValueConstant(VF.createLiteral(.5)), new ValueConstant(VF.createIRI(PeriodicQueryUtil.temporalNameSpace + "hours")));
FunctionCall func = new FunctionCall(PeriodicQueryUtil.PeriodicQueryURI, values);
Optional<PeriodicQueryNode> node1 = PeriodicQueryUtil.getPeriodicQueryNode(func, new Join());
Assert.assertEquals(true, node1.isPresent());
@@ -190,7 +190,7 @@ public class PeriodicQueryUtilTest {
.append(node1.getTemporalVariable(), node2.getTemporalVariable()).append(node1.getUnit(), node2.getUnit()).build();
}
- private static class PeriodicNodeCollector extends QueryModelVisitorBase<RuntimeException>{
+ private static class PeriodicNodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
private PeriodicQueryNode periodicNode;
int count = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunctionTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunctionTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunctionTest.java
index 2e09e4e..00f6433 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunctionTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/BindingHashShardingFunctionTest.java
@@ -25,22 +25,22 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.BindingSetRow;
import org.apache.rya.indexing.pcj.fluo.app.NodeType;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
public class BindingHashShardingFunctionTest {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void shardAddAndRemoveTest() {
String nodeId = NodeType.generateNewFluoIdForType(NodeType.STATEMENT_PATTERN);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("entity", vf.createURI("urn:entity"));
- bs.addBinding("location", vf.createLiteral("location_1"));
+ bs.addBinding("entity", VF.createIRI("urn:entity"));
+ bs.addBinding("location", VF.createLiteral("location_1"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
VariableOrder varOrder = new VariableOrder("entity","location");
Bytes row = RowKeyUtil.makeRowKey(nodeId, varOrder, vBs);
@@ -53,8 +53,8 @@ public class BindingHashShardingFunctionTest {
public void bindingSetRowTest() {
String nodeId = NodeType.generateNewFluoIdForType(NodeType.STATEMENT_PATTERN);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("entity", vf.createURI("urn:entity"));
- bs.addBinding("location", vf.createLiteral("location_1"));
+ bs.addBinding("entity", VF.createIRI("urn:entity"));
+ bs.addBinding("location", VF.createLiteral("location_1"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
VariableOrder varOrder = new VariableOrder("entity","location");
Bytes row = RowKeyUtil.makeRowKey(nodeId, varOrder, vBs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializerTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializerTest.java
index b2efa96..561a7cd 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializerTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/util/FilterSerializerTest.java
@@ -20,11 +20,11 @@ package org.apache.rya.indexing.pcj.fluo.app.util;
import static org.junit.Assert.assertEquals;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class FilterSerializerTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml b/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
index 418c195..403b4eb 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/pom.xml
@@ -60,21 +60,21 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<!-- Log4j 2 bridge, api, and core. -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/PcjAdminClient.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/PcjAdminClient.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/PcjAdminClient.java
index cc74f6b..99957bc 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/PcjAdminClient.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/PcjAdminClient.java
@@ -32,17 +32,19 @@ import java.util.List;
import java.util.Properties;
import java.util.Set;
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.ZooKeeperInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.fluo.api.client.FluoClient;
+import org.apache.fluo.api.client.FluoFactory;
+import org.apache.fluo.api.config.FluoConfiguration;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.indexing.pcj.fluo.app.query.UnsupportedQueryException;
import org.apache.rya.indexing.pcj.fluo.client.PcjAdminClientCommand.ArgumentsException;
import org.apache.rya.indexing.pcj.fluo.client.PcjAdminClientCommand.ExecutionException;
@@ -51,18 +53,15 @@ import org.apache.rya.indexing.pcj.fluo.client.command.ListQueriesCommand;
import org.apache.rya.indexing.pcj.fluo.client.command.LoadTriplesCommand;
import org.apache.rya.indexing.pcj.fluo.client.command.NewQueryCommand;
import org.apache.rya.indexing.pcj.fluo.client.command.QueryReportCommand;
-import org.openrdf.repository.RepositoryException;
+import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.repository.RepositoryException;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
-import org.apache.fluo.api.client.FluoClient;
-import org.apache.fluo.api.client.FluoFactory;
-import org.apache.fluo.api.config.FluoConfiguration;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.rya.rdftriplestore.RyaSailRepository;
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
/**
* An application that helps Rya PCJ administrators interact with the cluster.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/LoadTriplesCommand.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/LoadTriplesCommand.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/LoadTriplesCommand.java
index 42ac427..8913039 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/LoadTriplesCommand.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/LoadTriplesCommand.java
@@ -32,9 +32,9 @@ import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
import org.apache.rya.indexing.pcj.fluo.client.PcjAdminClientCommand;
import org.apache.rya.indexing.pcj.fluo.client.util.FluoLoader;
import org.apache.rya.rdftriplestore.RyaSailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.Rio;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
+import org.eclipse.rdf4j.rio.RDFParser;
+import org.eclipse.rdf4j.rio.Rio;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
@@ -98,7 +98,7 @@ public class LoadTriplesCommand implements PcjAdminClientCommand {
final Path triplesPath = Paths.get( params.nTriplesFile );
try {
- final RDFParser parser = Rio.createParser(RDFFormat.forFileName(triplesPath.getFileName().toString()));
+ final RDFParser parser = Rio.createParser(RdfFormatUtils.forFileName(triplesPath.getFileName().toString()));
final FluoLoader loader = new FluoLoader(fluo, new InsertTriples());
parser.setRDFHandler(loader);
parser.parse(Files.newInputStream(triplesPath), triplesPath.toUri().toString());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/NewQueryCommand.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/NewQueryCommand.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/NewQueryCommand.java
index 78515d9..806aa98 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/NewQueryCommand.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/command/NewQueryCommand.java
@@ -21,25 +21,15 @@ package org.apache.rya.indexing.pcj.fluo.client.command;
import static com.google.common.base.Preconditions.checkNotNull;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.List;
-import java.util.stream.Collectors;
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.security.Authorizations;
import org.apache.commons.io.IOUtils;
+import org.apache.fluo.api.client.FluoClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
import org.apache.rya.indexing.pcj.fluo.app.query.UnsupportedQueryException;
@@ -48,16 +38,15 @@ import org.apache.rya.indexing.pcj.fluo.client.util.ParsedQueryRequest;
import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.sail.SailException;
+import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
-import org.apache.fluo.api.client.FluoClient;
-import org.apache.rya.rdftriplestore.RyaSailRepository;
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
/**
* A command that creates a creates a new PCJ in the Fluo app and loads historic
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/FluoLoader.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/FluoLoader.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/FluoLoader.java
index 206cf9d..4b55608 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/FluoLoader.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/FluoLoader.java
@@ -22,25 +22,24 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
+import org.apache.fluo.api.client.FluoClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.helpers.RDFHandlerBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFParser;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
import com.google.common.base.Optional;
-import org.apache.fluo.api.client.FluoClient;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.resolver.RdfToRyaConversions;
-
/**
* When used as the handler of an {@link RDFParser}, instances of this class
* will batch load {@link Statement}s into the Fluo app 1000 statements at a time.
*/
-public class FluoLoader extends RDFHandlerBase {
+public class FluoLoader extends AbstractRDFHandler {
private static final Logger log = LogManager.getLogger(FluoLoader.class);
private static final int FLUSH_SIZE = 1000;
@@ -70,7 +69,7 @@ public class FluoLoader extends RDFHandlerBase {
// If the buffer is full, flush it to the Fluo table.
if(buff.size() == FLUSH_SIZE) {
log.trace("Flushing " + buff.size() + " Statements from the buffer to Fluo.");
- insertTriples.insert(fluoClient, buff, Optional.<String>absent());
+ insertTriples.insert(fluoClient, buff, Optional.absent());
buff.clear();
}
@@ -85,7 +84,7 @@ public class FluoLoader extends RDFHandlerBase {
if(!buff.isEmpty()) {
log.trace("Flushing the last " + buff.size() + " Statements from the buffer to Fluo.");
- insertTriples.insert(fluoClient, buff, Optional.<String>absent());
+ insertTriples.insert(fluoClient, buff, Optional.absent());
buff.clear();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/PcjMetadataRenderer.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/PcjMetadataRenderer.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/PcjMetadataRenderer.java
index 93570ea..42169ad 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/PcjMetadataRenderer.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/PcjMetadataRenderer.java
@@ -28,9 +28,9 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
/**
* Pretty renders the state of a query's {@link PcjMetadata}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/QueryReportRenderer.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/QueryReportRenderer.java b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/QueryReportRenderer.java
index d1b3e25..eaedd64 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/QueryReportRenderer.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.client/src/main/java/org/apache/rya/indexing/pcj/fluo/client/util/QueryReportRenderer.java
@@ -31,9 +31,9 @@ import org.apache.rya.indexing.pcj.fluo.app.query.ProjectionMetadata;
import org.apache.rya.indexing.pcj.fluo.app.query.QueryMetadata;
import org.apache.rya.indexing.pcj.fluo.app.query.StatementPatternMetadata;
import org.apache.rya.indexing.pcj.fluo.client.util.Report.ReportItem;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml b/extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml
index 3019c37..98cbdf2 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml
+++ b/extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml
@@ -47,8 +47,8 @@ under the License.
<!-- 3rd Party Runtime Dependencies. -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
</dependency>
<dependency>
<groupId>org.apache.fluo</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/Demo.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/Demo.java b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/Demo.java
index 1bc5f1b..dc0d90e 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/Demo.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/Demo.java
@@ -20,11 +20,10 @@ package org.apache.rya.indexing.pcj.fluo.demo;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.minicluster.MiniAccumuloCluster;
-import org.openrdf.repository.RepositoryConnection;
-
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.mini.MiniFluo;
import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
/**
* Represents a demonstration that uses Rya and Fluo on top of Accumulo.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/DemoDriver.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/DemoDriver.java b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/DemoDriver.java
index 1ae02dd..e194407 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/DemoDriver.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/DemoDriver.java
@@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -34,6 +33,7 @@ import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.ZooKeeperInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.fluo.api.client.FluoAdmin.AlreadyInitializedException;
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.config.FluoConfiguration;
@@ -56,7 +56,6 @@ import org.apache.rya.api.instance.RyaDetails.PCJIndexDetails;
import org.apache.rya.api.instance.RyaDetails.ProspectorDetails;
import org.apache.rya.api.instance.RyaDetails.TemporalIndexDetails;
import org.apache.rya.api.instance.RyaDetailsRepository;
-import org.apache.rya.api.instance.RyaDetailsRepository.AlreadyInitializedException;
import org.apache.rya.api.instance.RyaDetailsRepository.RyaDetailsRepositoryException;
import org.apache.rya.indexing.pcj.fluo.app.export.rya.RyaExportParameters;
import org.apache.rya.indexing.pcj.fluo.app.observers.FilterObserver;
@@ -67,8 +66,8 @@ import org.apache.rya.indexing.pcj.fluo.app.observers.TripleObserver;
import org.apache.rya.indexing.pcj.fluo.demo.Demo.DemoExecutionException;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
import com.google.common.base.Optional;
import com.google.common.io.Files;
@@ -277,8 +276,8 @@ public class DemoDriver {
.setPCJIndexDetails(
PCJIndexDetails.builder()
.setEnabled(true) )
- .setJoinSelectivityDetails( new JoinSelectivityDetails( Optional.<Date>absent() ) )
- .setProspectorDetails( new ProspectorDetails( Optional.<Date>absent() ))
+ .setJoinSelectivityDetails( new JoinSelectivityDetails( Optional.absent() ) )
+ .setProspectorDetails( new ProspectorDetails( Optional.absent() ))
.build();
detailsRepo.initialize(details);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
index 181f322..8ef6db3 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
@@ -41,14 +41,14 @@ import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.rdftriplestore.RyaSailRepository;
-import org.openrdf.model.Statement;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -287,7 +287,7 @@ public class FluoAndHistoricPcjsDemo implements Demo {
private static void loadDataIntoFluo(final FluoClient fluoClient, final Set<RyaStatement> statements) {
final InsertTriples insertTriples = new InsertTriples();
for(final RyaStatement statement : statements) {
- insertTriples.insert(fluoClient, statement, Optional.<String>absent());
+ insertTriples.insert(fluoClient, statement, Optional.absent());
}
}
[34/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
index d2db8b1..4ce6932 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlValueConverter.java
@@ -19,9 +19,7 @@ package org.apache.rya.api.date;
* under the License.
*/
-
-
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Value;
/**
* Class TimestampTtlValueConverter
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
index b850002..98ea208 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TtlValueConverter.java
@@ -19,11 +19,9 @@ package org.apache.rya.api.date;
* under the License.
*/
-
-
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* Class TtlValueConverter
@@ -31,7 +29,7 @@ import org.openrdf.model.impl.ValueFactoryImpl;
*/
public interface TtlValueConverter {
- ValueFactory vf = ValueFactoryImpl.getInstance();
+ ValueFactory vf = SimpleValueFactory.getInstance();
public void convert(String ttl, String startTime);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
index a5c1a02..a1e1468 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/Node.java
@@ -21,14 +21,14 @@ package org.apache.rya.api.domain;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.impl.SimpleIRI;
/**
* A Node is an expected node in the global graph. This typing of the URI allows us to dictate the difference between a
* URI that is just an Attribute on the subject vs. a URI that is another subject Node in the global graph. It does not
* guarantee that the subject exists, just that there is an Edge to it.
*/
-public class Node extends URIImpl {
+public class Node extends SimpleIRI {
public Node() {
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
index 0623e51..d47ab5a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
@@ -21,8 +21,7 @@ package org.apache.rya.api.domain;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
/**
* Created by IntelliJ IDEA.
@@ -30,14 +29,14 @@ import org.openrdf.model.Value;
* Time: 1:03 PM
* To change this template use File | Settings | File Templates.
*/
-public class RangeURI extends RangeValue<URI> implements URI {
+public class RangeURI extends RangeValue<IRI> implements IRI {
- public RangeURI(URI start, URI end) {
+ public RangeURI(IRI start, IRI end) {
super(start, end);
}
public RangeURI(RangeValue rangeValue) {
- super((URI) rangeValue.getStart(), (URI) rangeValue.getEnd());
+ super((IRI) rangeValue.getStart(), (IRI) rangeValue.getEnd());
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeValue.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeValue.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeValue.java
index 7d9ed24..b92f8b6 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeValue.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeValue.java
@@ -19,9 +19,7 @@ package org.apache.rya.api.domain;
* under the License.
*/
-
-
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Value;
/**
* Created by IntelliJ IDEA.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaSchema.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaSchema.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaSchema.java
index adbad38..e181597 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaSchema.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaSchema.java
@@ -22,7 +22,7 @@ package org.apache.rya.api.domain;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Date: 7/16/12
@@ -35,9 +35,9 @@ public class RyaSchema {
public static final String BNODE_NAMESPACE = "urn:org.apache.rya/bnode/2012/07#";
//datatypes
- public static final URI NODE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "node");
- public static final URI LANGUAGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "lang");
+ public static final IRI NODE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createIRI(NAMESPACE, "node");
+ public static final IRI LANGUAGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createIRI(NAMESPACE, "lang");
//functions
- public static final URI RANGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createURI(NAMESPACE, "range");
+ public static final IRI RANGE = RdfCloudTripleStoreConstants.VALUE_FACTORY.createIRI(NAMESPACE, "range");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaType.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaType.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaType.java
index ab5306e..8de4667 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaType.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaType.java
@@ -18,8 +18,9 @@
*/
package org.apache.rya.api.domain;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Base Rya Type
@@ -28,7 +29,7 @@ import org.openrdf.model.vocabulary.XMLSchema;
*/
public class RyaType implements Comparable {
- private URI dataType;
+ private IRI dataType;
private String data;
public RyaType() {
@@ -40,17 +41,17 @@ public class RyaType implements Comparable {
}
- public RyaType(final URI dataType, final String data) {
+ public RyaType(final IRI dataType, final String data) {
setDataType(dataType);
setData(data);
}
/**
- * TODO: Can we get away without using the openrdf URI
+ * TODO: Can we get away without using the RDF4J IRI
*
* @return
*/
- public URI getDataType() {
+ public IRI getDataType() {
return dataType;
}
@@ -58,7 +59,7 @@ public class RyaType implements Comparable {
return data;
}
- public void setDataType(final URI dataType) {
+ public void setDataType(final IRI dataType) {
this.dataType = dataType;
}
@@ -89,14 +90,11 @@ public class RyaType implements Comparable {
if (o == null || !(o instanceof RyaType)) {
return false;
}
- final RyaType ryaType = (RyaType) o;
- if (data != null ? !data.equals(ryaType.data) : ryaType.data != null) {
- return false;
- }
- if (dataType != null ? !dataType.equals(ryaType.dataType) : ryaType.dataType != null) {
- return false;
- }
- return true;
+ final RyaType other = (RyaType) o;
+ final EqualsBuilder builder = new EqualsBuilder()
+ .append(getData(), other.getData())
+ .append(getDataType(), other.getDataType());
+ return builder.isEquals();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypePrefix.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypePrefix.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypePrefix.java
index dab53a6..d08bc5b 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypePrefix.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypePrefix.java
@@ -21,7 +21,7 @@ package org.apache.rya.api.domain;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.DELIM;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.LAST;
@@ -32,7 +32,7 @@ import static org.apache.rya.api.RdfCloudTripleStoreConstants.LAST;
*/
public class RyaTypePrefix extends RyaTypeRange {
- public RyaTypePrefix(URI datatype, String prefix) {
+ public RyaTypePrefix(IRI datatype, String prefix) {
super();
setPrefix(datatype, prefix);
}
@@ -47,7 +47,7 @@ public class RyaTypePrefix extends RyaTypeRange {
setStop(new RyaType(prefix + LAST));
}
- public void setPrefix(URI datatype, String prefix) {
+ public void setPrefix(IRI datatype, String prefix) {
setStart(new RyaType(datatype, prefix + DELIM));
setStop(new RyaType(datatype, prefix + LAST));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeRange.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeRange.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeRange.java
index badde87..38d57f5 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeRange.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeRange.java
@@ -21,7 +21,7 @@ package org.apache.rya.api.domain;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Date: 7/17/12
@@ -56,7 +56,7 @@ public class RyaTypeRange extends RyaType implements RyaRange {
}
@Override
- public URI getDataType() {
+ public IRI getDataType() {
return start.getDataType();
}
@@ -84,9 +84,7 @@ public class RyaTypeRange extends RyaType implements RyaRange {
RyaTypeRange that = (RyaTypeRange) o;
if (start != null ? !start.equals(that.start) : that.start != null) return false;
- if (stop != null ? !stop.equals(that.stop) : that.stop != null) return false;
-
- return true;
+ return stop != null ? stop.equals(that.stop) : that.stop == null;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
index 6f9902e..e7032e3 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
@@ -20,12 +20,12 @@ package org.apache.rya.api.domain;
import java.util.Date;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.impl.SimpleIRI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.ISODateTimeFormat;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.ImmutableMap;
@@ -45,8 +45,8 @@ public final class RyaTypeUtils {
.put(Long.class, (v) -> longRyaType((Long) v))
.put(Short.class, (v) -> shortRyaType((Short) v))
.put(String.class, (v) -> stringRyaType((String) v))
- .put(URI.class, (v) -> uriRyaType((URI) v))
- .put(URIImpl.class, (v) -> uriRyaType((URIImpl) v))
+ .put(IRI.class, (v) -> uriRyaType((IRI) v))
+ .put(SimpleIRI.class, (v) -> uriRyaType((SimpleIRI) v))
.build();
/**
@@ -182,11 +182,11 @@ public final class RyaTypeUtils {
/**
*
* Creates a URI {@link RyaType} object.
- * @param value the {@link URI} object.
+ * @param value the {@link IRI} object.
* @return the {@link RyaType} with the data type set to
* {@link XMLSchema#ANYURI} and the data set to the specified {@code value}.
*/
- public static RyaType uriRyaType(final URI value) {
+ public static RyaType uriRyaType(final IRI value) {
return new RyaType(XMLSchema.ANYURI, value.stringValue());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
index d90ba4b..1e948ae 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
@@ -19,11 +19,9 @@ package org.apache.rya.api.domain;
* under the License.
*/
-
-
-import org.openrdf.model.URI;
-import org.openrdf.model.util.URIUtil;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.util.URIUtil;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
@@ -44,7 +42,7 @@ public class RyaURI extends RyaType {
super(XMLSchema.ANYURI, namespace + data);
}
- protected RyaURI(URI datatype, String data) {
+ protected RyaURI(IRI datatype, String data) {
super(datatype, data);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
index 83612b7..23fe2d3 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
@@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.rya.api.persist.RdfDAOException;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.base.Preconditions;
import com.google.common.reflect.TypeToken;
@@ -42,7 +42,7 @@ import com.google.gson.JsonSerializer;
public class StatementMetadata {
private static Gson gson = new GsonBuilder().enableComplexMapKeySerialization()
- .registerTypeHierarchyAdapter(RyaType.class, new RyaTypeAdapter()).create();;
+ .registerTypeHierarchyAdapter(RyaType.class, new RyaTypeAdapter()).create();
public static StatementMetadata EMPTY_METADATA = new StatementMetadata();
private Map<RyaURI, RyaType> metadataMap = new HashMap<>();
@@ -127,7 +127,7 @@ public class StatementMetadata {
if(type.equals(RyaURI.class.getName())){
return new RyaURI(array[0]);
} else if(type.equals(RyaType.class.getName())){
- RyaType ryaType = new RyaType(new URIImpl(array[1]), array[0]);
+ RyaType ryaType = new RyaType(SimpleValueFactory.getInstance().createIRI(array[1]), array[0]);
return ryaType;
} else {
throw new IllegalArgumentException("Unparseable RyaType.");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
new file mode 100644
index 0000000..6f47e35
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/VarNameUtils.java
@@ -0,0 +1,202 @@
+/*
+ * 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.rya.api.domain;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.TupleExprs;
+
+/**
+ * Utility methods and constants for RDF {@link Var} names.
+ */
+public final class VarNameUtils {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
+ /**
+ * Prepended to the start of constant var names.
+ */
+ public static final String CONSTANT_PREFIX = "_const_";
+ private static final String LEGACY_CONSTANT_PREFIX = "-const-";
+
+ /**
+ * Prepended to the start of anonymous var names.
+ */
+ public static final String ANONYMOUS_PREFIX = "_anon_";
+ private static final String LEGACY_ANONYMOUS_PREFIX = "-anon-";
+
+ /**
+ * Private constructor to prevent instantiation.
+ */
+ private VarNameUtils() {
+ }
+
+ /**
+ * Prepends the constant prefix to the specified value.
+ * @param value the value to add the constant prefix to.
+ * @return the value with the constant prefix attached before it.
+ */
+ public static String prependConstant(final String value) {
+ if (value != null) {
+ return CONSTANT_PREFIX + value;
+ }
+ return null;
+ }
+
+ /**
+ * Checks if the var name has the constant prefix.
+ * @param name the var name to check.
+ * @return {@code true} if the name begins with the constant prefix.
+ * {@code false} otherwise.
+ */
+ public static boolean isConstant(final String name) {
+ if (name != null) {
+ return name.startsWith(CONSTANT_PREFIX) || name.startsWith(LEGACY_CONSTANT_PREFIX);
+ }
+ return false;
+ }
+
+ /**
+ * Removes the constant prefix from a string if it exists.
+ * @param name the name string to strip the constant prefix from.
+ * @return the string with the constant prefix removed. Otherwise returns
+ * the original string.
+ */
+ public static String removeConstant(final String name) {
+ if (isConstant(name)) {
+ String removed = StringUtils.removeStart(name, CONSTANT_PREFIX);
+ if (name.equals(removed)) {
+ removed = StringUtils.removeStart(name, LEGACY_CONSTANT_PREFIX);
+ }
+ return removed;
+ }
+ return name;
+ }
+
+ /**
+ * Prepends the anonymous prefix to the specified value.
+ * @param value the value to add the anonymous prefix to.
+ * @return the value with the anonymous prefix attached before it.
+ */
+ public static String prependAnonymous(final String value) {
+ if (value != null) {
+ return ANONYMOUS_PREFIX + value;
+ }
+ return null;
+ }
+
+ /**
+ * Checks if the var name has the anonymous prefix.
+ * @param name the var name to check.
+ * @return {@code true} if the name begins with the anonymous prefix.
+ * {@code false} otherwise.
+ */
+ public static boolean isAnonymous(final String name) {
+ if (name != null) {
+ return name.startsWith(ANONYMOUS_PREFIX) || name.startsWith(LEGACY_ANONYMOUS_PREFIX);
+ }
+ return false;
+ }
+
+ /**
+ * Removes the anonymous prefix from a string if it exists.
+ * @param name the name string to strip the anonymous prefix from.
+ * @return the string with the anonymous prefix removed. Otherwise returns
+ * the original string.
+ */
+ public static String removeAnonymous(final String name) {
+ if (isAnonymous(name)) {
+ String removed = StringUtils.removeStart(name, ANONYMOUS_PREFIX);
+ if (name.equals(removed)) {
+ removed = StringUtils.removeStart(name, LEGACY_ANONYMOUS_PREFIX);
+ }
+ }
+ return name;
+ }
+
+ /**
+ * Creates a unique constant name for the {@link Var} with the supplied
+ * {@link Value}.
+ * @param value the {@link Value}.
+ * @return the unique constant name for the {@link Var}.
+ */
+ public static String createUniqueConstVarName(final Value value) {
+ return TupleExprs.getConstVarName(value);
+ }
+
+ /**
+ * Creates a unique constant name for the {@link Var} with the supplied
+ * label.
+ * @param label the label for the {@code Literal}.
+ * @return the unique constant name for the {@link Var}.
+ */
+ public static String createUniqueConstVarNameLiteral(final String label) {
+ return createUniqueConstVarName(VF.createLiteral(label));
+ }
+
+ /**
+ * Creates a unique constant name for the {@link Var} with the supplied
+ * IRI string.
+ * @param iri the string-representation of the {@IRI}
+ * @return the unique constant name for the {@link Var}.
+ */
+ public static String createUniqueConstVarNameIri(final String iri) {
+ return createUniqueConstVarName(VF.createIRI(iri));
+ }
+
+ /**
+ * Creates a simple constant name for a {@link Var} to replace the unique
+ * hex string constant name. The simple constant name will be one of:
+ * <ul>
+ * <li>The var's original string value with "_const_" prepended to it if
+ * it's a constant (i.e. the constant var name was already likely
+ * derived from {@link TupleExprs#createConstVar(Value)})</li>
+ * <li>The original var name if it's not a constant or if it has no
+ * value to generate a simple constant name from</li>
+ * <li>{@code null} if {@code var} is {@code null}</li>
+ * </ul>
+ * @param var the {@link Var}.
+ * @return the simple constant var name.
+ */
+ public static String createSimpleConstVarName(final Var var) {
+ String varName = null;
+ if (var != null) {
+ if (var.getValue() != null && isConstant(var.getName())) {
+ // Replaces the unique constant hex string name with a simple
+ // readable constant name
+ varName = prependConstant(var.getValue().stringValue());
+ } else {
+ varName = var.getName();
+ }
+ }
+ return varName;
+ }
+
+ /**
+ * Creates a uniquely named constant {@link Var} with the supplied
+ * {@link Value}.
+ * @param value the {@link Value}.
+ * @return the uniquely named constant {@link Var}.
+ */
+ public static Var createUniqueConstVar(final Value value) {
+ return new Var(TupleExprs.getConstVarName(value), value);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
index 6c0efd2..69a09bb 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
@@ -17,26 +17,27 @@ package org.apache.rya.api.domain.serialization.kryo;
* specific language governing permissions and limitations
* under the License.
*/
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
+
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaURI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
-import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-
/**
* Kryo Serializer for {@link RyaStatement}s
*
*/
public class RyaStatementSerializer extends Serializer<RyaStatement> {
-
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
/**
* Uses Kryo to write RyaStatement to {@lin Output}
* @param kryo - writes statement to output
@@ -117,7 +118,7 @@ public class RyaStatementSerializer extends Serializer<RyaStatement> {
value = new RyaURI(objectValue);
}
else {
- value = new RyaType(new URIImpl(objectType), objectValue);
+ value = new RyaType(VF.createIRI(objectType), objectValue);
}
RyaStatement statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), value);
int length = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
index aedeea7..655425d 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/functions/DateTimeWithinPeriod.java
@@ -17,21 +17,21 @@
* under the License.
*/package org.apache.rya.api.functions;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
import java.time.Duration;
import java.time.Instant;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.datatypes.XMLDatatypeUtil;
-import org.openrdf.model.vocabulary.FN;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil;
+import org.eclipse.rdf4j.model.vocabulary.FN;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
/**
* This {@link Function} determines whether two {@link XMLSchema#DATETIME}s occur within a specified period of time of
@@ -83,11 +83,11 @@ public class DateTimeWithinPeriod implements Function {
checkArgument(values[0] instanceof Literal);
checkArgument(values[1] instanceof Literal);
checkArgument(values[2] instanceof Literal);
- checkArgument(values[3] instanceof URI);
+ checkArgument(values[3] instanceof IRI);
Instant dateTime1 = convertToInstant((Literal) values[0]);
Instant dateTime2 = convertToInstant((Literal) values[1]);
- long periodMillis = convertPeriodToMillis((Literal) values[2], (URI) values[3]);
+ long periodMillis = convertPeriodToMillis((Literal) values[2], (IRI) values[3]);
long timeBetween = Math.abs(Duration.between(dateTime1, dateTime2).toMillis());
return valueFactory.createLiteral(timeBetween < periodMillis);
@@ -98,16 +98,16 @@ public class DateTimeWithinPeriod implements Function {
private Instant convertToInstant(Literal literal) {
String stringVal = literal.getLabel();
- URI dataType = literal.getDatatype();
+ IRI dataType = literal.getDatatype();
checkArgument(dataType.equals(XMLSchema.DATETIME) || dataType.equals(XMLSchema.DATE),
String.format("Invalid data type for date time. Data Type must be of type %s or %s .", XMLSchema.DATETIME, XMLSchema.DATE));
checkArgument(XMLDatatypeUtil.isValidDateTime(stringVal) || XMLDatatypeUtil.isValidDate(stringVal), "Invalid date time value.");
return literal.calendarValue().toGregorianCalendar().toInstant();
}
- private long convertPeriodToMillis(Literal literal, URI unit) {
+ private long convertPeriodToMillis(Literal literal, IRI unit) {
String stringVal = literal.getLabel();
- URI dataType = literal.getDatatype();
+ IRI dataType = literal.getDatatype();
checkArgument(dataType.equals(XMLSchema.INTEGER) || dataType.equals(XMLSchema.INT), String
.format("Invalid data type for period duration. Data Type must be of type %s or %s .", XMLSchema.INTEGER, XMLSchema.INT));
checkArgument(XMLDatatypeUtil.isValidInteger(stringVal) || XMLDatatypeUtil.isValidInt(stringVal), "Invalid duration value.");
@@ -122,7 +122,7 @@ public class DateTimeWithinPeriod implements Function {
* indicated by the namespace <http://www.w3.org/2006/time#>)
* @return - duration in milliseconds
*/
- private long convertToMillis(int duration, URI unit) {
+ private long convertToMillis(int duration, IRI unit) {
checkArgument(duration > 0);
return OWLTime.getMillis(duration, unit);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java b/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
index 5ffc4ee..48649d1 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/functions/OWLTime.java
@@ -26,9 +26,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* Constants for OWL-Time primitives in the OWL-Time namespace.
@@ -36,7 +36,7 @@ import org.openrdf.model.impl.ValueFactoryImpl;
*/
public class OWLTime {
- private static final ValueFactory FACTORY = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* Indicates namespace of OWL-Time ontology
@@ -45,25 +45,25 @@ public class OWLTime {
/**
* Seconds class of type DurationDescription in OWL-Time ontology
*/
- public static final URI SECONDS_URI = FACTORY.createURI(NAMESPACE, "seconds");
+ public static final IRI SECONDS_URI = VF.createIRI(NAMESPACE, "seconds");
/**
* Minutes class of type DurationDescription in OWL-Time ontology
*/
- public static final URI MINUTES_URI = FACTORY.createURI(NAMESPACE, "minutes");
+ public static final IRI MINUTES_URI = VF.createIRI(NAMESPACE, "minutes");
/**
* Hours class of type DurationDescription in OWL-Time ontology
*/
- public static final URI HOURS_URI = FACTORY.createURI(NAMESPACE, "hours");
+ public static final IRI HOURS_URI = VF.createIRI(NAMESPACE, "hours");
/**
* Days class of type DurationDescription in OWL-Time ontology
*/
- public static final URI DAYS_URI = FACTORY.createURI(NAMESPACE, "days");
+ public static final IRI DAYS_URI = VF.createIRI(NAMESPACE, "days");
/**
* Weeks class of type DurationDescription in OWL-Time ontology
*/
- public static final URI WEEKS_URI = FACTORY.createURI(NAMESPACE, "weeks");
+ public static final IRI WEEKS_URI = VF.createIRI(NAMESPACE, "weeks");
- private static final Map<URI, ChronoUnit> DURATION_MAP = new HashMap<>();
+ private static final Map<IRI, ChronoUnit> DURATION_MAP = new HashMap<>();
static {
DURATION_MAP.put(SECONDS_URI, ChronoUnit.SECONDS);
@@ -78,7 +78,7 @@ public class OWLTime {
* @param durationURI - OWLTime URI indicating the time unit (not null)
* @return - {@code true} if this URI indicates a supported OWLTime time unit
*/
- public static boolean isValidDurationType(URI durationURI) {
+ public static boolean isValidDurationType(IRI durationURI) {
checkNotNull(durationURI);
return DURATION_MAP.containsKey(durationURI);
}
@@ -89,9 +89,9 @@ public class OWLTime {
* @param duration - amount of time in the units indicated by the provided {@link OWLTime} URI
* @param uri - OWLTime URI indicating the time unit of duration (not null)
* @return - the amount of time in milliseconds
- * @throws IllegalArgumentException if provided {@link URI} is not a valid, supported OWL-Time time unit.
+ * @throws IllegalArgumentException if provided {@link IRI} is not a valid, supported OWL-Time time unit.
*/
- public static long getMillis(int duration, URI uri) throws IllegalArgumentException {
+ public static long getMillis(int duration, IRI uri) throws IllegalArgumentException {
Optional<ChronoUnit> unit = getChronoUnitFromURI(uri);
checkArgument(unit.isPresent(),
String.format("URI %s does not indicate a valid OWLTime time unit. URI must of be of type %s, %s, %s, %s, or %s .", uri,
@@ -105,7 +105,7 @@ public class OWLTime {
* @param durationURI - OWLTime time unit URI (not null)
* @return - corresponding ChronoUnit time unit
*/
- public static Optional<ChronoUnit> getChronoUnitFromURI(URI durationURI) {
+ public static Optional<ChronoUnit> getChronoUnitFromURI(IRI durationURI) {
return Optional.ofNullable(DURATION_MAP.get(durationURI));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/path/PathUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/path/PathUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/path/PathUtils.java
index 8f46977..ae47b3f 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/path/PathUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/path/PathUtils.java
@@ -202,7 +202,7 @@ public final class PathUtils {
final UserPrincipal owner = Files.getOwner(partialPath);
if (!user.equals(owner) && !root.equals(owner)) {
// dir owned by someone else, not secure
- return false;
+ return SystemUtils.IS_OS_UNIX ? false : Files.isWritable(partialPath);
}
}
} catch (final IOException x) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/RdfEvalStatsDAO.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/RdfEvalStatsDAO.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/RdfEvalStatsDAO.java
index 0b63d58..b91a137 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/RdfEvalStatsDAO.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/RdfEvalStatsDAO.java
@@ -19,13 +19,11 @@ package org.apache.rya.api.persist;
* under the License.
*/
-
-
import java.util.List;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
/**
* Class RdfEvalStatsDAO
@@ -45,7 +43,7 @@ public interface RdfEvalStatsDAO<C extends RdfCloudTripleStoreConfiguration> {
// XXX returns -1 if no cardinality could be found.
public double getCardinality(C conf, CARDINALITY_OF card, List<Value> val) throws RdfDAOException;
- public double getCardinality(C conf, CARDINALITY_OF card, List<Value> val, Resource context) throws RdfDAOException;
+ public double getCardinality(C conf, CARDINALITY_OF card, List<Value> val, Resource context) throws RdfDAOException;
public void setConf(C conf);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaNamespaceManager.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaNamespaceManager.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaNamespaceManager.java
index 8415edd..83d90a5 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaNamespaceManager.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaNamespaceManager.java
@@ -19,11 +19,9 @@ package org.apache.rya.api.persist;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.Namespace;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Namespace;
/**
* Date: 7/17/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
index ef21f1f..1bdc95b 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
@@ -19,7 +19,6 @@ package org.apache.rya.api.persist.index;
* under the License.
*/
-
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
@@ -27,23 +26,22 @@ import java.util.Collection;
import java.util.Set;
import org.apache.hadoop.conf.Configurable;
-import org.openrdf.model.URI;
-
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
+import org.eclipse.rdf4j.model.IRI;
public interface RyaSecondaryIndexer extends Closeable, Flushable, Configurable {
/**
* initialize after setting configuration.
*/
- public void init();
+ public void init();
/**
* Returns the table name if the implementation supports it.
* Note that some indexers use multiple tables, this only returns one.
* TODO recommend that we deprecate this method because it's a leaky interface.
* @return table name as a string.
*/
- public String getTableName();
+ public String getTableName();
public void storeStatements(Collection<RyaStatement> statements) throws IOException;
@@ -56,11 +54,11 @@ public interface RyaSecondaryIndexer extends Closeable, Flushable, Configurable
/**
* @return the set of predicates indexed by the indexer.
*/
- public abstract Set<URI> getIndexablePredicates();
+ public Set<IRI> getIndexablePredicates();
@Override
- public abstract void flush() throws IOException;
+ public void flush() throws IOException;
@Override
- public abstract void close() throws IOException;
+ public void close() throws IOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/joinselect/SelectivityEvalDAO.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/joinselect/SelectivityEvalDAO.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/joinselect/SelectivityEvalDAO.java
index af2a5d8..5ebe7fb 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/joinselect/SelectivityEvalDAO.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/joinselect/SelectivityEvalDAO.java
@@ -19,12 +19,10 @@ package org.apache.rya.api.persist.joinselect;
* under the License.
*/
-
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface SelectivityEvalDAO<C extends RdfCloudTripleStoreConfiguration> extends RdfEvalStatsDAO<C> {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/BatchRyaQuery.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/BatchRyaQuery.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/BatchRyaQuery.java
index 2cef5a1..5630289 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/BatchRyaQuery.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/BatchRyaQuery.java
@@ -23,7 +23,6 @@ package org.apache.rya.api.persist.query;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
/**
@@ -92,9 +91,7 @@ public class BatchRyaQuery extends RyaQueryOptions {
BatchRyaQuery that = (BatchRyaQuery) o;
- if (queries != null ? !queries.equals(that.queries) : that.queries != null) return false;
-
- return true;
+ return queries != null ? queries.equals(that.queries) : that.queries == null;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryEngine.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryEngine.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryEngine.java
index 5404804..1e027ec 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryEngine.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryEngine.java
@@ -19,10 +19,6 @@ package org.apache.rya.api.persist.query;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.io.Closeable;
import java.util.Collection;
import java.util.Map;
@@ -31,9 +27,9 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaConfigured;
import org.apache.rya.api.persist.RyaDAOException;
-
import org.calrissian.mango.collect.CloseableIterable;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Rya Query Engine to perform queries against the Rya triple store.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryOptions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryOptions.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryOptions.java
index 01a2b0d..5ddc19d 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryOptions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/RyaQueryOptions.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.persist.query;
* under the License.
*/
-
+import java.util.Arrays;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-
/**
*/
public class RyaQueryOptions {
@@ -225,9 +223,7 @@ public class RyaQueryOptions {
if (regexPredicate != null ? !regexPredicate.equals(that.regexPredicate) : that.regexPredicate != null)
return false;
if (regexSubject != null ? !regexSubject.equals(that.regexSubject) : that.regexSubject != null) return false;
- if (ttl != null ? !ttl.equals(that.ttl) : that.ttl != null) return false;
-
- return true;
+ return ttl != null ? ttl.equals(that.ttl) : that.ttl == null;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
index 353d1ee..65c01a7 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
@@ -19,9 +19,10 @@ package org.apache.rya.api.persist.query.join;
* under the License.
*/
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
@@ -31,10 +32,7 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.utils.EnumerationWrapper;
-
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Use HashTable to do a HashJoin.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
index 965251b..9bf216c 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
@@ -19,22 +19,23 @@ package org.apache.rya.api.persist.query.join;
* under the License.
*/
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
-
-import com.google.common.base.Preconditions;
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.ConvertingIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
-import org.apache.rya.api.domain.*;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.ConvertingIteration;
+import org.eclipse.rdf4j.query.BindingSet;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
+import com.google.common.base.Preconditions;
/**
* Date: 7/24/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
index f0d9f57..3334cd8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
@@ -19,16 +19,14 @@ package org.apache.rya.api.persist.query.join;
* under the License.
*/
+import java.util.Map;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
-
-import java.util.Map;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Date: 7/24/12
@@ -36,9 +34,9 @@ import java.util.Map;
*/
public interface Join<C extends RdfCloudTripleStoreConfiguration> {
- CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds)
+ public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds)
throws RyaDAOException;
- CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs)
+ public CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs)
throws RyaDAOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
index 767f61f..c858327 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
@@ -19,21 +19,24 @@ package org.apache.rya.api.persist.query.join;
* under the License.
*/
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
-
-import com.google.common.base.Preconditions;
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.EmptyIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.*;
+import org.apache.rya.api.domain.RyaRange;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaURIRange;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.utils.PeekingCloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.EmptyIteration;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import com.google.common.base.Preconditions;
/**
* Date: 7/24/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDAOHelper.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDAOHelper.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDAOHelper.java
index 06fe88b..5b5978a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDAOHelper.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDAOHelper.java
@@ -19,9 +19,11 @@ package org.apache.rya.api.persist.utils;
* under the License.
*/
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.NoSuchElementException;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
@@ -30,17 +32,13 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.utils.NullableStatementImpl;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-import java.util.NoSuchElementException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
/**
* Date: 7/20/12
@@ -48,7 +46,7 @@ import java.util.NoSuchElementException;
*/
public class RyaDAOHelper {
- public static CloseableIteration<Statement, QueryEvaluationException> query(RyaDAO ryaDAO, Resource subject, URI predicate, Value object, RdfCloudTripleStoreConfiguration conf, Resource... contexts) throws QueryEvaluationException {
+ public static CloseableIteration<Statement, QueryEvaluationException> query(RyaDAO ryaDAO, Resource subject, IRI predicate, Value object, RdfCloudTripleStoreConfiguration conf, Resource... contexts) throws QueryEvaluationException {
return query(ryaDAO, new NullableStatementImpl(subject, predicate, object, contexts), conf);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDaoQueryWrapper.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDaoQueryWrapper.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDaoQueryWrapper.java
index af7af8a..2122f53 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDaoQueryWrapper.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/utils/RyaDaoQueryWrapper.java
@@ -24,14 +24,13 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAO;
import org.apache.rya.api.resolver.RyaToRdfConversions;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.rio.RDFHandler;
-
-import info.aduna.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.rio.RDFHandler;
/**
* Wraps Rya DAO queries into a simpler interface that just passes in the
@@ -66,14 +65,14 @@ public class RyaDaoQueryWrapper {
/**
* Handles all results of a query. Closes the query iterator when done.
* @param subject the subject {@link Resource} to query for.
- * @param predicate the predicate {@link URI} to query for.
+ * @param predicate the predicate {@link IRI} to query for.
* @param object the object {@link Value} to query for.
* @param rdfStatementHandler the {@link RDFHandler} to use for handling
* each statement returned. (not {@code null})
* @param contexts the context {@link Resource}s to query for.
* @throws QueryEvaluationException
*/
- public void queryAll(final Resource subject, final URI predicate, final Value object, final RDFHandler rdfStatementHandler, final Resource... contexts) throws QueryEvaluationException {
+ public void queryAll(final Resource subject, final IRI predicate, final Value object, final RDFHandler rdfStatementHandler, final Resource... contexts) throws QueryEvaluationException {
checkNotNull(rdfStatementHandler);
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDao, subject, predicate, object, conf, contexts);
try {
@@ -101,7 +100,7 @@ public class RyaDaoQueryWrapper {
*/
public void queryAll(final Statement statement, final RDFHandler rdfStatementHandler) throws QueryEvaluationException {
final Resource subject = statement.getSubject();
- final URI predicate = statement.getPredicate();
+ final IRI predicate = statement.getPredicate();
final Value object = statement.getObject();
final Resource context = statement.getContext();
queryAll(subject, predicate, object, rdfStatementHandler, context);
@@ -125,14 +124,14 @@ public class RyaDaoQueryWrapper {
* Handles only the first result of a query. Closes the query iterator when
* done.
* @param subject the subject {@link Resource} to query for.
- * @param predicate the predicate {@link URI} to query for.
+ * @param predicate the predicate {@link IRI} to query for.
* @param object the object {@link Value} to query for.
* @param rdfStatementHandler the {@link RDFHandler} to use for handling the
* first statement returned. (not {@code null})
* @param contexts the context {@link Resource}s to query for.
* @throws QueryEvaluationException
*/
- public void queryFirst(final Resource subject, final URI predicate, final Value object, final RDFHandler rdfStatementHandler, final Resource... contexts) throws QueryEvaluationException {
+ public void queryFirst(final Resource subject, final IRI predicate, final Value object, final RDFHandler rdfStatementHandler, final Resource... contexts) throws QueryEvaluationException {
checkNotNull(rdfStatementHandler);
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDao, subject, predicate, object, conf, contexts);
try {
@@ -162,7 +161,7 @@ public class RyaDaoQueryWrapper {
public void queryFirst(final Statement statement, final RDFHandler rdfStatementHandler) throws QueryEvaluationException {
checkNotNull(statement);
final Resource subject = statement.getSubject();
- final URI predicate = statement.getPredicate();
+ final IRI predicate = statement.getPredicate();
final Value object = statement.getObject();
final Resource context = statement.getContext();
queryFirst(subject, predicate, object, rdfStatementHandler, context);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
index 7d61312..15a3a88 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
@@ -19,18 +19,15 @@ package org.apache.rya.api.query.strategy;
* under the License.
*/
-
+import java.io.IOException;
+import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.triple.TripleRowRegex;
-import java.io.IOException;
-import java.util.Map;
-
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
-
/**
* Date: 7/14/12
* Time: 7:21 AM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
index 314ce91..5398fc0 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
@@ -19,10 +19,12 @@ package org.apache.rya.api.query.strategy.wholerow;
* under the License.
*/
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.LAST_BYTES;
+
import java.io.IOException;
import java.util.Map;
+
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.*;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaType;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/CustomRyaTypeResolverMapping.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/CustomRyaTypeResolverMapping.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/CustomRyaTypeResolverMapping.java
index 44f77bd..b6d2758 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/CustomRyaTypeResolverMapping.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/CustomRyaTypeResolverMapping.java
@@ -21,7 +21,7 @@ package org.apache.rya.api.resolver;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Date: 7/16/12
@@ -29,24 +29,24 @@ import org.openrdf.model.URI;
*/
public class CustomRyaTypeResolverMapping extends RyaTypeResolverMapping {
- protected URI ryaDataType;
+ protected IRI ryaDataType;
protected byte markerByte;
public CustomRyaTypeResolverMapping() {
}
- public CustomRyaTypeResolverMapping(URI ryaDataType, byte markerByte) {
+ public CustomRyaTypeResolverMapping(IRI ryaDataType, byte markerByte) {
this(null, ryaDataType, markerByte);
}
- public CustomRyaTypeResolverMapping(RyaTypeResolver ryaTypeResolver, URI ryaDataType, byte markerByte) {
+ public CustomRyaTypeResolverMapping(RyaTypeResolver ryaTypeResolver, IRI ryaDataType, byte markerByte) {
super(ryaTypeResolver);
this.ryaDataType = ryaDataType;
this.markerByte = markerByte;
}
@Override
- public URI getRyaDataType() {
+ public IRI getRyaDataType() {
return ryaDataType;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
index 61c2b4d..6cd27b7 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
@@ -19,10 +19,20 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-
-
-import org.apache.rya.api.domain.*;
-import org.openrdf.model.*;
+import org.apache.rya.api.domain.RangeURI;
+import org.apache.rya.api.domain.RangeValue;
+import org.apache.rya.api.domain.RyaSchema;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaTypeRange;
+import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaURIRange;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
/**
* Date: 7/17/12
@@ -30,7 +40,7 @@ import org.openrdf.model.*;
*/
public class RdfToRyaConversions {
- public static RyaURI convertURI(URI uri) {
+ public static RyaURI convertURI(IRI uri) {
if (uri == null) return null;
if (uri instanceof RangeURI) {
RangeURI ruri = (RangeURI) uri;
@@ -59,8 +69,8 @@ public class RdfToRyaConversions {
}
if (value instanceof RangeValue) {
RangeValue rv = (RangeValue) value;
- if (rv.getStart() instanceof URI) {
- return new RyaURIRange(convertURI((URI) rv.getStart()), convertURI((URI) rv.getEnd()));
+ if (rv.getStart() instanceof IRI) {
+ return new RyaURIRange(convertURI((IRI) rv.getStart()), convertURI((IRI) rv.getEnd()));
} else {
//literal
return new RyaTypeRange(convertLiteral((Literal) rv.getStart()), convertLiteral((Literal) rv.getEnd()));
@@ -74,13 +84,13 @@ public class RdfToRyaConversions {
if (subject instanceof BNode) {
return new RyaURI(RyaSchema.BNODE_NAMESPACE + ((BNode) subject).getID());
}
- return convertURI((URI) subject);
+ return convertURI((IRI) subject);
}
public static RyaStatement convertStatement(Statement statement) {
if (statement == null) return null;
Resource subject = statement.getSubject();
- URI predicate = statement.getPredicate();
+ IRI predicate = statement.getPredicate();
Value object = statement.getObject();
Resource context = statement.getContext();
return new RyaStatement(
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
index 49fc5d1..237a228 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
@@ -19,8 +19,6 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-
-
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,8 +37,8 @@ import org.apache.rya.api.resolver.impl.RyaTypeResolverImpl;
import org.apache.rya.api.resolver.impl.RyaURIResolver;
import org.apache.rya.api.resolver.impl.ServiceBackedRyaTypeResolverMappings;
import org.apache.rya.api.resolver.impl.ShortRyaTypeResolver;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +50,7 @@ public class RyaContext {
public Logger logger = LoggerFactory.getLogger(RyaContext.class);
- private final Map<URI, RyaTypeResolver> uriToResolver = new HashMap<URI, RyaTypeResolver>();
+ private final Map<IRI, RyaTypeResolver> uriToResolver = new HashMap<IRI, RyaTypeResolver>();
private final Map<Byte, RyaTypeResolver> byteToResolver = new HashMap<Byte, RyaTypeResolver>();
private RyaTypeResolver defaultResolver = new CustomDatatypeResolver();
@@ -93,7 +91,7 @@ public class RyaContext {
//need to go from datatype->resolver
- public RyaTypeResolver retrieveResolver(final URI datatype) {
+ public RyaTypeResolver retrieveResolver(final IRI datatype) {
final RyaTypeResolver ryaTypeResolver = uriToResolver.get(datatype);
if (ryaTypeResolver == null) {
return defaultResolver;
@@ -152,7 +150,7 @@ public class RyaContext {
}
}
- public RyaTypeResolver removeRyaTypeResolver(final URI dataType) {
+ public RyaTypeResolver removeRyaTypeResolver(final IRI dataType) {
final RyaTypeResolver ryaTypeResolver = uriToResolver.remove(dataType);
if (ryaTypeResolver != null) {
if (logger.isDebugEnabled()) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
index 51062c9..102db46 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
@@ -19,40 +19,37 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-
-
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/17/12
* Time: 8:34 AM
*/
public class RyaToRdfConversions {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- public static URI convertURI(RyaURI uri) {
- return new URIImpl(uri.getData());
+ public static IRI convertURI(RyaURI uri) {
+ return VF.createIRI(uri.getData());
}
- private static URI convertURI(RyaType value) {
- return new URIImpl(value.getData());
+ private static IRI convertURI(RyaType value) {
+ return VF.createIRI(value.getData());
}
public static Literal convertLiteral(RyaType literal) {
if (XMLSchema.STRING.equals(literal.getDataType())) {
- return new LiteralImpl(literal.getData());
+ return VF.createLiteral(literal.getData());
} else {
- return new LiteralImpl(literal.getData(), literal.getDataType());
+ return VF.createLiteral(literal.getData(), literal.getDataType());
}
//TODO: No Language support yet
}
@@ -65,12 +62,12 @@ public class RyaToRdfConversions {
public static Statement convertStatement(RyaStatement statement) {
assert statement != null;
if (statement.getContext() != null) {
- return new ContextStatementImpl(convertURI(statement.getSubject()),
+ return VF.createStatement(convertURI(statement.getSubject()),
convertURI(statement.getPredicate()),
convertValue(statement.getObject()),
convertURI(statement.getContext()));
} else {
- return new StatementImpl(convertURI(statement.getSubject()),
+ return VF.createStatement(convertURI(statement.getSubject()),
convertURI(statement.getPredicate()),
convertValue(statement.getObject()));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
index 17fab47..f3f5925 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
@@ -19,15 +19,12 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolver.java
index 98e2f82..4e061ea 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolver.java
@@ -23,8 +23,7 @@ package org.apache.rya.api.resolver;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaTypeRange;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Date: 7/16/12
@@ -44,9 +43,9 @@ public interface RyaTypeResolver {
*/
public boolean deserializable(byte[] bytes);
- public URI getRyaDataType();
+ public IRI getRyaDataType();
- byte getMarkerByte();
+ public byte getMarkerByte();
/**
* This will allow a resolver to modify a range. For example, a date time resolver, with a reverse index,
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolverMapping.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolverMapping.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolverMapping.java
index 82502ff..ca2c81a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolverMapping.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTypeResolverMapping.java
@@ -21,7 +21,7 @@ package org.apache.rya.api.resolver;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Date: 7/16/12
@@ -46,7 +46,7 @@ public class RyaTypeResolverMapping {
return ryaTypeResolver;
}
- public URI getRyaDataType() {
+ public IRI getRyaDataType() {
return ryaTypeResolver.getRyaDataType();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/BooleanRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/BooleanRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/BooleanRyaTypeResolver.java
index 1727944..c45efe8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/BooleanRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/BooleanRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
public class BooleanRyaTypeResolver extends RyaTypeResolverImpl {
public static final int BOOLEAN_LITERAL_MARKER = 10;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ByteRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ByteRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ByteRyaTypeResolver.java
index 5de72fc..0503e76 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ByteRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ByteRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
public class ByteRyaTypeResolver extends RyaTypeResolverImpl {
public static final int LITERAL_MARKER = 9;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolver.java
index 3b4dcfa..075b3f8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolver.java
@@ -25,7 +25,7 @@ import java.nio.charset.StandardCharsets;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RyaTypeResolverException;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.primitives.Bytes;
@@ -64,7 +64,7 @@ public class CustomDatatypeResolver extends RyaTypeResolverImpl {
throw new RyaTypeResolverException("Not a datatype literal");
}
final String label = deserializeData(new String(bytes, 0, indexOfType, StandardCharsets.UTF_8));
- rt.setDataType(new URIImpl(new String(bytes, indexOfType + 1, (length - indexOfType) - 3, StandardCharsets.UTF_8)));
+ rt.setDataType(SimpleValueFactory.getInstance().createIRI(new String(bytes, indexOfType + 1, (length - indexOfType) - 3, StandardCharsets.UTF_8)));
rt.setData(label);
return rt;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolver.java
index c244b9e..8167401 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolver.java
@@ -19,20 +19,18 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
+import java.util.Date;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import java.util.Date;
/**
* Reverse index xml datetime strings
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolver.java
index de8f753..42f81ed 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolver.java
@@ -19,16 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import java.text.DecimalFormat;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/20/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/FloatRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/FloatRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/FloatRyaTypeResolver.java
index 851b32c..18467f6 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/FloatRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/FloatRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolver.java
index 12705d8..344406a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/20/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolver.java
index 3b700d7..9dfe488 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/20/12
[47/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategy.java
index 98861c0..a9706dc 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategy.java
@@ -30,7 +30,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.AbstractTriplePatternStrategy;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
@@ -51,8 +51,8 @@ public class OspWholeRowTriplePatternStrategy extends AbstractTriplePatternStrat
@Override
public Map.Entry<TABLE_LAYOUT,
- ByteRange> defineRange(final RyaURI subject, final RyaURI predicate, final RyaType object,
- final RyaURI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
+ ByteRange> defineRange(final RyaIRI subject, final RyaIRI predicate, final RyaType object,
+ final RyaIRI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
try {
//os(ng)
//o_r(s)(ng)
@@ -103,7 +103,7 @@ public class OspWholeRowTriplePatternStrategy extends AbstractTriplePatternStrat
}
@Override
- public boolean handles(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public boolean handles(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
//os(ng)
//o_r(s)(ng)
//o(ng)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategy.java
index e09e5d0..dbf8023 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategy.java
@@ -31,7 +31,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.AbstractTriplePatternStrategy;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
@@ -52,8 +52,8 @@ public class PoWholeRowTriplePatternStrategy extends AbstractTriplePatternStrate
@Override
public Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT,
- ByteRange> defineRange(final RyaURI subject, final RyaURI predicate, final RyaType object,
- final RyaURI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
+ ByteRange> defineRange(final RyaIRI subject, final RyaIRI predicate, final RyaType object,
+ final RyaIRI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
try {
//po(ng)
//po_r(s)(ng)
@@ -116,7 +116,7 @@ public class PoWholeRowTriplePatternStrategy extends AbstractTriplePatternStrate
}
@Override
- public boolean handles(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public boolean handles(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
//po(ng)
//p_r(o)(ng)
//po_r(s)(ng)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java
index b2c29bb..eed3ab0 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java
@@ -31,8 +31,8 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.apache.rya.api.query.strategy.AbstractTriplePatternStrategy;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
@@ -52,8 +52,8 @@ public class SpoWholeRowTriplePatternStrategy extends AbstractTriplePatternStrat
}
@Override
- public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(final RyaURI subject, final RyaURI predicate, final RyaType object,
- final RyaURI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
+ public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(final RyaIRI subject, final RyaIRI predicate, final RyaType object,
+ final RyaIRI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
try {
//spo(ng)
//sp(ng)
@@ -127,8 +127,8 @@ public class SpoWholeRowTriplePatternStrategy extends AbstractTriplePatternStrat
}
@Override
- public boolean handles(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public boolean handles(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
//if subject is not null and (if predicate is null then object must be null)
- return (subject != null && !(subject instanceof RyaURIRange && predicate != null)) && !((predicate == null || predicate instanceof RyaURIRange) && (object != null));
+ return (subject != null && !(subject instanceof RyaIRIRange && predicate != null)) && !((predicate == null || predicate instanceof RyaIRIRange) && (object != null));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
index fca31e4..0618c82 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RdfToRyaConversions.java
@@ -19,14 +19,14 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-import org.apache.rya.api.domain.RangeURI;
+import org.apache.rya.api.domain.RangeIRI;
import org.apache.rya.api.domain.RangeValue;
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaTypeRange;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.eclipse.rdf4j.model.BNode;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Literal;
@@ -40,13 +40,13 @@ import org.eclipse.rdf4j.model.Value;
*/
public class RdfToRyaConversions {
- public static RyaURI convertURI(IRI iri) {
+ public static RyaIRI convertIRI(IRI iri) {
if (iri == null) return null;
- if (iri instanceof RangeURI) {
- RangeURI riri = (RangeURI) iri;
- return new RyaURIRange(convertURI(riri.getStart()), convertURI(riri.getEnd()));
+ if (iri instanceof RangeIRI) {
+ RangeIRI riri = (RangeIRI) iri;
+ return new RyaIRIRange(convertIRI(riri.getStart()), convertIRI(riri.getEnd()));
}
- return new RyaURI(iri.stringValue());
+ return new RyaIRI(iri.stringValue());
}
public static RyaType convertLiteral(Literal literal) {
@@ -70,7 +70,7 @@ public class RdfToRyaConversions {
if (value instanceof RangeValue) {
RangeValue<?> rv = (RangeValue<?>) value;
if (rv.getStart() instanceof IRI) {
- return new RyaURIRange(convertURI((IRI) rv.getStart()), convertURI((IRI) rv.getEnd()));
+ return new RyaIRIRange(convertIRI((IRI) rv.getStart()), convertIRI((IRI) rv.getEnd()));
} else {
//literal
return new RyaTypeRange(convertLiteral((Literal) rv.getStart()), convertLiteral((Literal) rv.getEnd()));
@@ -79,12 +79,12 @@ public class RdfToRyaConversions {
return null;
}
- public static RyaURI convertResource(Resource subject) {
+ public static RyaIRI convertResource(Resource subject) {
if(subject == null) return null;
if (subject instanceof BNode) {
- return new RyaURI(RyaSchema.BNODE_NAMESPACE + ((BNode) subject).getID());
+ return new RyaIRI(RyaSchema.BNODE_NAMESPACE + ((BNode) subject).getID());
}
- return convertURI((IRI) subject);
+ return convertIRI((IRI) subject);
}
public static RyaStatement convertStatement(Statement statement) {
@@ -95,7 +95,7 @@ public class RdfToRyaConversions {
Resource context = statement.getContext();
return new RyaStatement(
convertResource(subject),
- convertURI(predicate),
+ convertIRI(predicate),
convertValue(object),
convertResource(context));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
index 237a228..bc0c6df 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaContext.java
@@ -34,7 +34,7 @@ import org.apache.rya.api.resolver.impl.FloatRyaTypeResolver;
import org.apache.rya.api.resolver.impl.IntegerRyaTypeResolver;
import org.apache.rya.api.resolver.impl.LongRyaTypeResolver;
import org.apache.rya.api.resolver.impl.RyaTypeResolverImpl;
-import org.apache.rya.api.resolver.impl.RyaURIResolver;
+import org.apache.rya.api.resolver.impl.RyaIRIResolver;
import org.apache.rya.api.resolver.impl.ServiceBackedRyaTypeResolverMappings;
import org.apache.rya.api.resolver.impl.ShortRyaTypeResolver;
import org.eclipse.rdf4j.model.IRI;
@@ -64,7 +64,7 @@ public class RyaContext {
logger.debug("Adding default mappings");
}
addRyaTypeResolverMapping(new RyaTypeResolverMapping(new RyaTypeResolverImpl())); // plain string
- addRyaTypeResolverMapping(new RyaTypeResolverMapping(new RyaURIResolver())); // uri
+ addRyaTypeResolverMapping(new RyaTypeResolverMapping(new RyaIRIResolver())); // iri
addRyaTypeResolverMapping(new RyaTypeResolverMapping(new DateTimeRyaTypeResolver())); // dateTime
addRyaTypeResolverMapping(new RyaTypeResolverMapping(new DoubleRyaTypeResolver())); // double
addRyaTypeResolverMapping(new RyaTypeResolverMapping(new FloatRyaTypeResolver())); // float
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
index b43bdaa..88b79bf 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaToRdfConversions.java
@@ -21,7 +21,7 @@ package org.apache.rya.api.resolver;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Literal;
import org.eclipse.rdf4j.model.Statement;
@@ -37,11 +37,11 @@ import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
public class RyaToRdfConversions {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
- public static IRI convertURI(RyaURI iri) {
+ public static IRI convertIRI(RyaIRI iri) {
return VF.createIRI(iri.getData());
}
- private static IRI convertURI(RyaType value) {
+ private static IRI convertIRI(RyaType value) {
return VF.createIRI(value.getData());
}
@@ -56,19 +56,19 @@ public class RyaToRdfConversions {
public static Value convertValue(RyaType value) {
//assuming either IRI or Literal here
- return (value instanceof RyaURI || value.getDataType().equals(XMLSchema.ANYURI)) ? convertURI(value) : convertLiteral(value);
+ return (value instanceof RyaIRI || value.getDataType().equals(XMLSchema.ANYURI)) ? convertIRI(value) : convertLiteral(value);
}
public static Statement convertStatement(RyaStatement statement) {
assert statement != null;
if (statement.getContext() != null) {
- return VF.createStatement(convertURI(statement.getSubject()),
- convertURI(statement.getPredicate()),
+ return VF.createStatement(convertIRI(statement.getSubject()),
+ convertIRI(statement.getPredicate()),
convertValue(statement.getObject()),
- convertURI(statement.getContext()));
+ convertIRI(statement.getContext()));
} else {
- return VF.createStatement(convertURI(statement.getSubject()),
- convertURI(statement.getPredicate()),
+ return VF.createStatement(convertIRI(statement.getSubject()),
+ convertIRI(statement.getPredicate()),
convertValue(statement.getObject()));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
index f3f5925..dc4a42e 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/RyaTripleContext.java
@@ -30,7 +30,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.TriplePatternStrategy;
import org.apache.rya.api.query.strategy.wholerow.HashedPoWholeRowTriplePatternStrategy;
import org.apache.rya.api.query.strategy.wholerow.HashedSpoWholeRowTriplePatternStrategy;
@@ -101,7 +101,7 @@ public class RyaTripleContext {
}
//retrieve triple pattern strategy
- public TriplePatternStrategy retrieveStrategy(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public TriplePatternStrategy retrieveStrategy(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
for (final TriplePatternStrategy strategy : triplePatternStrategyList) {
if (strategy.handles(subject, predicate, object, context)) {
return strategy;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaIRIResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaIRIResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaIRIResolver.java
new file mode 100644
index 0000000..0e4df4d
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaIRIResolver.java
@@ -0,0 +1,42 @@
+package org.apache.rya.api.resolver.impl;
+
+/*
+ * 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.
+ */
+
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaIRI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+
+/**
+ * Date: 7/16/12
+ * Time: 12:41 PM
+ */
+public class RyaIRIResolver extends RyaTypeResolverImpl {
+
+ public static final int URI_MARKER = 2;
+
+ public RyaIRIResolver() {
+ super((byte) URI_MARKER, XMLSchema.ANYURI);
+ }
+
+ @Override
+ public RyaType newInstance() {
+ return new RyaIRI();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
deleted file mode 100644
index c7ac82c..0000000
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.rya.api.resolver.impl;
-
-/*
- * 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.
- */
-
-import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
-
-/**
- * Date: 7/16/12
- * Time: 12:41 PM
- */
-public class RyaURIResolver extends RyaTypeResolverImpl {
-
- public static final int URI_MARKER = 2;
-
- public RyaURIResolver() {
- super((byte) URI_MARKER, XMLSchema.ANYURI);
- }
-
- @Override
- public RyaType newInstance() {
- return new RyaURI();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/TripleRowResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/TripleRowResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/TripleRowResolver.java
index 62ac2b5..fd91751 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/TripleRowResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/TripleRowResolver.java
@@ -24,7 +24,7 @@ package org.apache.rya.api.resolver.triple;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import java.util.Map;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowHashedTripleResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowHashedTripleResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowHashedTripleResolver.java
index 5907b5b..701ff02 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowHashedTripleResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowHashedTripleResolver.java
@@ -34,7 +34,7 @@ import org.apache.commons.codec.binary.Hex;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.api.resolver.triple.TripleRow;
@@ -53,10 +53,10 @@ public class WholeRowHashedTripleResolver implements TripleRowResolver {
@Override
public Map<TABLE_LAYOUT, TripleRow> serialize(final RyaStatement stmt) throws TripleRowResolverException {
try {
- final RyaURI subject = stmt.getSubject();
- final RyaURI predicate = stmt.getPredicate();
+ final RyaIRI subject = stmt.getSubject();
+ final RyaIRI predicate = stmt.getPredicate();
final RyaType object = stmt.getObject();
- final RyaURI context = stmt.getContext();
+ final RyaIRI context = stmt.getContext();
final Long timestamp = stmt.getTimestamp();
final byte[] columnVisibility = stmt.getColumnVisibility();
final String qualifer = stmt.getQualifer();
@@ -115,7 +115,7 @@ public class WholeRowHashedTripleResolver implements TripleRowResolver {
final byte[] type = Arrays.copyOfRange(row, typeIndex, row.length);
final byte[] columnFamily = tripleRow.getColumnFamily();
final boolean contextExists = columnFamily != null && columnFamily.length > 0;
- final RyaURI context = (contextExists) ? (new RyaURI(new String(columnFamily, StandardCharsets.UTF_8))) : null;
+ final RyaIRI context = (contextExists) ? (new RyaIRI(new String(columnFamily, StandardCharsets.UTF_8))) : null;
final byte[] columnQualifier = tripleRow.getColumnQualifier();
final String qualifier = columnQualifier != null && columnQualifier.length > 0 ? new String(columnQualifier, StandardCharsets.UTF_8) : null;
final Long timestamp = tripleRow.getTimestamp();
@@ -126,24 +126,24 @@ public class WholeRowHashedTripleResolver implements TripleRowResolver {
case SPO: {
final byte[] obj = Bytes.concat(third, type);
return new RyaStatement(
- new RyaURI(new String(first, StandardCharsets.UTF_8)),
- new RyaURI(new String(second, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(first, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(second, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
case PO: {
final byte[] obj = Bytes.concat(second, type);
return new RyaStatement(
- new RyaURI(new String(third, StandardCharsets.UTF_8)),
- new RyaURI(new String(first, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(third, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(first, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
case OSP: {
final byte[] obj = Bytes.concat(first, type);
return new RyaStatement(
- new RyaURI(new String(second, StandardCharsets.UTF_8)),
- new RyaURI(new String(third, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(second, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(third, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolver.java
index cbd65b6..994347f 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolver.java
@@ -31,7 +31,7 @@ import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.api.resolver.triple.TripleRow;
@@ -50,10 +50,10 @@ public class WholeRowTripleResolver implements TripleRowResolver {
@Override
public Map<TABLE_LAYOUT, TripleRow> serialize(final RyaStatement stmt) throws TripleRowResolverException {
try {
- final RyaURI subject = stmt.getSubject();
- final RyaURI predicate = stmt.getPredicate();
+ final RyaIRI subject = stmt.getSubject();
+ final RyaIRI predicate = stmt.getPredicate();
final RyaType object = stmt.getObject();
- final RyaURI context = stmt.getContext();
+ final RyaIRI context = stmt.getContext();
final Long timestamp = stmt.getTimestamp();
final byte[] columnVisibility = stmt.getColumnVisibility();
final String qualifer = stmt.getQualifer();
@@ -100,7 +100,7 @@ public class WholeRowTripleResolver implements TripleRowResolver {
final byte[] type = Arrays.copyOfRange(row, typeIndex, row.length);
final byte[] columnFamily = tripleRow.getColumnFamily();
final boolean contextExists = columnFamily != null && columnFamily.length > 0;
- final RyaURI context = (contextExists) ? (new RyaURI(new String(columnFamily, StandardCharsets.UTF_8))) : null;
+ final RyaIRI context = (contextExists) ? (new RyaIRI(new String(columnFamily, StandardCharsets.UTF_8))) : null;
final byte[] columnQualifier = tripleRow.getColumnQualifier();
final String qualifier = columnQualifier != null && columnQualifier.length > 0 ? new String(columnQualifier, StandardCharsets.UTF_8) : null;
final Long timestamp = tripleRow.getTimestamp();
@@ -111,24 +111,24 @@ public class WholeRowTripleResolver implements TripleRowResolver {
case SPO: {
final byte[] obj = Bytes.concat(third, type);
return new RyaStatement(
- new RyaURI(new String(first, StandardCharsets.UTF_8)),
- new RyaURI(new String(second, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(first, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(second, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
case PO: {
final byte[] obj = Bytes.concat(second, type);
return new RyaStatement(
- new RyaURI(new String(third, StandardCharsets.UTF_8)),
- new RyaURI(new String(first, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(third, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(first, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
case OSP: {
final byte[] obj = Bytes.concat(first, type);
return new RyaStatement(
- new RyaURI(new String(second, StandardCharsets.UTF_8)),
- new RyaURI(new String(third, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(second, StandardCharsets.UTF_8)),
+ new RyaIRI(new String(third, StandardCharsets.UTF_8)),
RyaContext.getInstance().deserialize(obj),
context, qualifier, columnVisibility, value, timestamp);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaIRIPrefixTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaIRIPrefixTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaIRIPrefixTest.java
new file mode 100644
index 0000000..ab32406
--- /dev/null
+++ b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaIRIPrefixTest.java
@@ -0,0 +1,37 @@
+package org.apache.rya.api.domain;
+
+/*
+ * 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.
+ */
+
+
+
+import junit.framework.TestCase;
+
+/**
+ * Date: 7/24/12
+ * Time: 3:30 PM
+ */
+public class RyaIRIPrefixTest extends TestCase {
+
+ public void testPrefix() throws Exception {
+ String prefix = "urn:test#";
+ RyaIRIPrefix iriPrefix = new RyaIRIPrefix(prefix);
+ assertEquals(prefix, iriPrefix.getPrefix());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
index fe1216a..7cfc77b 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
@@ -27,8 +27,8 @@ public class RyaTypeTest {
static RyaType a = new RyaType(XMLSchema.STRING, "http://www.example.com/Alice");
static RyaType b = new RyaType(XMLSchema.STRING, "http://www.example.com/Bob");
static RyaType c = new RyaType(XMLSchema.STRING, "http://www.example.com/Carol");
- static RyaType aUri = new RyaType(XMLSchema.ANYURI, "http://www.example.com/Alice");
- static RyaType bUri = new RyaType(XMLSchema.ANYURI, "http://www.example.com/Bob");
+ static RyaType aIri = new RyaType(XMLSchema.ANYURI, "http://www.example.com/Alice");
+ static RyaType bIri = new RyaType(XMLSchema.ANYURI, "http://www.example.com/Bob");
RyaType nullData = new RyaType(XMLSchema.STRING, null);
RyaType nullType = new RyaType(null, "http://www.example.com/Alice");
RyaType nullBoth = new RyaType(null, null);
@@ -36,10 +36,10 @@ public class RyaTypeTest {
@Test
public void testCompareTo() throws Exception {
- Assert.assertEquals("compareTo(self) should return zero.", 0, aUri.compareTo(aUri));
- Assert.assertFalse("compareTo should return nonzero for different data and type.", aUri.compareTo(b) == 0);
- Assert.assertFalse("compareTo should return nonzero for same data and different datatypes.", a.compareTo(aUri) == 0);
- Assert.assertFalse("compareTo should return nonzero for same datatype and different data.", bUri.compareTo(aUri) == 0);
+ Assert.assertEquals("compareTo(self) should return zero.", 0, aIri.compareTo(aIri));
+ Assert.assertFalse("compareTo should return nonzero for different data and type.", aIri.compareTo(b) == 0);
+ Assert.assertFalse("compareTo should return nonzero for same data and different datatypes.", a.compareTo(aIri) == 0);
+ Assert.assertFalse("compareTo should return nonzero for same datatype and different data.", bIri.compareTo(aIri) == 0);
Assert.assertEquals("compareTo should return zero for different objects with matching data and datatype.",
0, a.compareTo(same));
}
@@ -60,11 +60,11 @@ public class RyaTypeTest {
int forward = Integer.signum(a.compareTo(b));
int backward = Integer.signum(b.compareTo(a));
Assert.assertEquals("Comparison of different values with same type should yield opposite signs.", forward, backward * -1);
- forward = Integer.signum(bUri.compareTo(b));
- backward = Integer.signum(b.compareTo(bUri));
+ forward = Integer.signum(bIri.compareTo(b));
+ backward = Integer.signum(b.compareTo(bIri));
Assert.assertEquals("Comparison of same values with different types should yield opposite signs.", forward, backward*-1);
- forward = Integer.signum(aUri.compareTo(b));
- backward = Integer.signum(b.compareTo(aUri));
+ forward = Integer.signum(aIri.compareTo(b));
+ backward = Integer.signum(b.compareTo(aIri));
Assert.assertEquals("Comparison of different values with different types should yield opposite signs.",
forward, backward * -1);
}
@@ -80,7 +80,7 @@ public class RyaTypeTest {
@Test
public void testEquals() throws Exception {
Assert.assertTrue("Same data and datatype should be equal.", a.equals(same));
- Assert.assertFalse("Same data, different datatype should be unequal.", a.equals(aUri));
+ Assert.assertFalse("Same data, different datatype should be unequal.", a.equals(aIri));
Assert.assertFalse("Same datatype, different data should be unequal.", a.equals(b));
}
@@ -100,9 +100,9 @@ public class RyaTypeTest {
Assert.assertEquals("equals and compareTo inconsistent for different values with same types.",
a.equals(b), a.compareTo(b) == 0);
Assert.assertEquals("equals and compareTo inconsistent for same values having different types.",
- a.equals(aUri), a.compareTo(aUri) == 0);
+ a.equals(aIri), a.compareTo(aIri) == 0);
Assert.assertEquals("equals and compareTo inconsistent for different values and different types.",
- a.equals(bUri), a.compareTo(bUri) == 0);
+ a.equals(bIri), a.compareTo(bIri) == 0);
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaURIPrefixTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaURIPrefixTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaURIPrefixTest.java
deleted file mode 100644
index dee896b..0000000
--- a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaURIPrefixTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.rya.api.domain;
-
-/*
- * 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.
- */
-
-
-
-import junit.framework.TestCase;
-
-/**
- * Date: 7/24/12
- * Time: 3:30 PM
- */
-public class RyaURIPrefixTest extends TestCase {
-
- public void testPrefix() throws Exception {
- String prefix = "urn:test#";
- RyaURIPrefix uriPrefix = new RyaURIPrefix(prefix);
- assertEquals(prefix, uriPrefix.getPrefix());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
index c316b50..fd7cb2a 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
@@ -31,7 +31,7 @@ public class StatementMetadataTest {
StatementMetadata single = new StatementMetadata();
- single.addMetadata(new RyaURI("http://uri"), new RyaType("http://type"));
+ single.addMetadata(new RyaIRI("http://uri"), new RyaType("http://type"));
byte[] singleData = single.toBytes();
Assert.assertArrayEquals(singleData, new StatementMetadata(singleData).toBytes());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/persist/query/RyaQueryTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/persist/query/RyaQueryTest.java b/common/rya.api/src/test/java/org/apache/rya/api/persist/query/RyaQueryTest.java
index 967c6dc..b2c535d 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/persist/query/RyaQueryTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/persist/query/RyaQueryTest.java
@@ -22,7 +22,7 @@ package org.apache.rya.api.persist.query;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.junit.Test;
import java.util.Arrays;
@@ -37,9 +37,9 @@ public class RyaQueryTest {
@Test
public void testBuildQueryWithOptions() {
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
RyaStatement ryaStatement = new RyaStatement(subj, pred, obj);
String[] auths = {"U,FOUO"};
long currentTime = System.currentTimeMillis();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
index bd96436..66ca868 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
@@ -31,7 +31,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.wholerow.OspWholeRowTriplePatternStrategy;
import org.apache.rya.api.query.strategy.wholerow.PoWholeRowTriplePatternStrategy;
import org.apache.rya.api.query.strategy.wholerow.SpoWholeRowTriplePatternStrategy;
@@ -59,9 +59,9 @@ public class AbstractTriplePatternStrategyTest extends TestCase {
}
public void testRegex() throws Exception {
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
RyaStatement ryaStatement = new RyaStatement(subj, pred, obj);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = new WholeRowTripleResolver().serialize(ryaStatement);
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
@@ -117,8 +117,8 @@ public class AbstractTriplePatternStrategyTest extends TestCase {
}
public void testObjectTypeInfo() throws Exception {
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
RyaType obj = new RyaType(XMLSchema.LONG, "10");
RyaStatement ryaStatement = new RyaStatement(subj, pred, obj);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = RyaTripleContext.getInstance(new MockRdfConfiguration()).serializeTriple(ryaStatement);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
index 0775dfa..fe2c20c 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
@@ -27,8 +27,8 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaTypeRange;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.query.strategy.TriplePatternStrategy;
import org.apache.rya.api.resolver.RyaContext;
@@ -49,10 +49,10 @@ import junit.framework.TestCase;
public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
- RyaURI uri = new RyaURI("urn:test#1234");
- RyaURI uri2 = new RyaURI("urn:test#1235");
- RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
- RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
+ RyaIRI uri = new RyaIRI("urn:test#1234");
+ RyaIRI uri2 = new RyaIRI("urn:test#1235");
+ RyaIRIRange rangeIRI = new RyaIRIRange(uri, uri2);
+ RyaIRIRange rangeIRI2 = new RyaIRIRange(new RyaIRI("urn:test#1235"), new RyaIRI("urn:test#1236"));
HashedPoWholeRowTriplePatternStrategy strategy = new HashedPoWholeRowTriplePatternStrategy();
RyaContext ryaContext = RyaContext.getInstance();
RyaTripleContext ryaTripleContext;
@@ -72,9 +72,9 @@ public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
public void testRegex() throws Exception {
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
RyaStatement ryaStatement = new RyaStatement(subj, pred, obj);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = new WholeRowHashedTripleResolver().serialize(ryaStatement);
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
@@ -135,10 +135,10 @@ public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
new RyaStatement(uri, uri, uri, null));
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO);
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(null, uri, rangeURI, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(null, uri, rangeIRI, null, null);
assertContains(entry.getValue(), tripleRow.getRow());
- entry = strategy.defineRange(null, uri, rangeURI2, null, null);
+ entry = strategy.defineRange(null, uri, rangeIRI2, null, null);
assertContainsFalse(entry.getValue(), tripleRow.getRow());
}
@@ -197,15 +197,15 @@ public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
new RyaStatement(uri, uri, uri, null));
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO);
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(rangeURI, uri, uri, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(rangeIRI, uri, uri, null, null);
assertContains(entry.getValue(), tripleRow.getRow());
- entry = strategy.defineRange(rangeURI2, uri, uri, null, null);
+ entry = strategy.defineRange(rangeIRI2, uri, uri, null, null);
assertContainsFalse(entry.getValue(), tripleRow.getRow());
}
public void testPRange() throws Exception {
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(null, rangeURI, null, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(null, rangeIRI, null, null, null);
assertNull(entry);
}
@@ -222,22 +222,22 @@ public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
assertTrue(strategy.handles(null, uri, uri, null));
assertTrue(strategy.handles(null, uri, uri, uri));
//po_r(s)(ng)
- assertTrue(strategy.handles(rangeURI, uri, uri, null));
- assertTrue(strategy.handles(rangeURI, uri, uri, uri));
+ assertTrue(strategy.handles(rangeIRI, uri, uri, null));
+ assertTrue(strategy.handles(rangeIRI, uri, uri, uri));
//p(ng)
assertTrue(strategy.handles(null, uri, null, null));
assertTrue(strategy.handles(null, uri, null, uri));
//p_r(o)(ng)
- assertTrue(strategy.handles(null, uri, rangeURI, null));
- assertTrue(strategy.handles(null, uri, rangeURI, uri));
+ assertTrue(strategy.handles(null, uri, rangeIRI, null));
+ assertTrue(strategy.handles(null, uri, rangeIRI, uri));
//r(p)(ng)
- assertFalse(strategy.handles(null, rangeURI, null, null));
- assertFalse(strategy.handles(null, rangeURI, null, uri));
+ assertFalse(strategy.handles(null, rangeIRI, null, null));
+ assertFalse(strategy.handles(null, rangeIRI, null, uri));
//false cases
//sp..
assertFalse(strategy.handles(uri, uri, null, null));
//r(s)_p
- assertFalse(strategy.handles(rangeURI, uri, null, null));
+ assertFalse(strategy.handles(rangeIRI, uri, null, null));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
index d71e4e8..763c0d1 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
@@ -26,8 +26,8 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaTypeRange;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTripleContext;
@@ -45,10 +45,10 @@ import junit.framework.TestCase;
public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
- RyaURI uri = new RyaURI("urn:test#1234");
- RyaURI uri2 = new RyaURI("urn:test#1235");
- RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
- RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
+ RyaIRI uri = new RyaIRI("urn:test#1234");
+ RyaIRI uri2 = new RyaIRI("urn:test#1235");
+ RyaIRIRange rangeIRI = new RyaIRIRange(uri, uri2);
+ RyaIRIRange rangeIRI2 = new RyaIRIRange(new RyaIRI("urn:test#1235"), new RyaIRI("urn:test#1236"));
HashedSpoWholeRowTriplePatternStrategy strategy = new HashedSpoWholeRowTriplePatternStrategy();
RyaContext ryaContext = RyaContext.getInstance();
RyaTripleContext ryaTripleContext;
@@ -110,10 +110,10 @@ public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
new RyaStatement(uri, uri, uri, null));
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(uri, uri, rangeURI, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(uri, uri, rangeIRI, null, null);
assertContains(entry.getValue(), tripleRow.getRow());
- entry = strategy.defineRange(uri, uri, rangeURI2, null, null);
+ entry = strategy.defineRange(uri, uri, rangeIRI2, null, null);
assertContainsFalse(entry.getValue(), tripleRow.getRow());
}
@@ -145,9 +145,9 @@ public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
new RyaStatement(uri, uri, uri, null));
TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(uri, rangeURI, null, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(uri, rangeIRI, null, null, null);
assertContains(entry.getValue(), tripleRow.getRow());
- entry = strategy.defineRange(uri, rangeURI2, null, null, null);
+ entry = strategy.defineRange(uri, rangeIRI2, null, null, null);
assertContainsFalse(entry.getValue(), tripleRow.getRow());
}
@@ -165,7 +165,7 @@ public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
public void testSRange() throws Exception {
- Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(rangeURI, null, null, null, null);
+ Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> entry = strategy.defineRange(rangeIRI, null, null, null, null);
assertNull(entry);
}
@@ -180,20 +180,20 @@ public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
assertTrue(strategy.handles(uri, null, null, null));
assertTrue(strategy.handles(uri, null, null, uri));
//sp_r(o)(ng)
- assertTrue(strategy.handles(uri, uri, rangeURI, null));
- assertTrue(strategy.handles(uri, uri, rangeURI, uri));
+ assertTrue(strategy.handles(uri, uri, rangeIRI, null));
+ assertTrue(strategy.handles(uri, uri, rangeIRI, uri));
//s_r(p)(ng)
- assertTrue(strategy.handles(uri, rangeURI, null, null));
- assertTrue(strategy.handles(uri, rangeURI, null, uri));
+ assertTrue(strategy.handles(uri, rangeIRI, null, null));
+ assertTrue(strategy.handles(uri, rangeIRI, null, uri));
//fail
//s_r(p)_r(o)
- assertFalse(strategy.handles(uri, rangeURI, rangeURI, null));
+ assertFalse(strategy.handles(uri, rangeIRI, rangeIRI, null));
//s==null
assertFalse(strategy.handles(null, uri, uri, null));
//s_r(o)
- assertFalse(strategy.handles(uri, null, rangeURI, null));
+ assertFalse(strategy.handles(uri, null, rangeIRI, null));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
index 9bac95a..be607a8 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
@@ -30,7 +30,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.ByteRange;
import org.junit.After;
import org.junit.AfterClass;
@@ -85,10 +85,10 @@ public class NullRowTriplePatternStrategyTest {
*/
@Test
public void testDefineRange() throws Exception {
- RyaURI subject = null;
- RyaURI predicate = null;
+ RyaIRI subject = null;
+ RyaIRI predicate = null;
RyaType object = null;
- RyaURI context = null;
+ RyaIRI context = null;
RdfCloudTripleStoreConfiguration conf = new MockRdfConfiguration();
NullRowTriplePatternStrategy instance = new NullRowTriplePatternStrategy();
Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, ByteRange> expResult = new RdfCloudTripleStoreUtils.CustomEntry<>(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO, new ByteRange(new byte[]{}, LAST_BYTES));
@@ -103,14 +103,14 @@ public class NullRowTriplePatternStrategyTest {
*/
@Test
public void testHandles() {
- RyaURI subject = null;
- RyaURI predicate = null;
+ RyaIRI subject = null;
+ RyaIRI predicate = null;
RyaType object = null;
- RyaURI context = null;
+ RyaIRI context = null;
NullRowTriplePatternStrategy instance = new NullRowTriplePatternStrategy();
assertTrue(instance.handles(subject, predicate, object, context));
- RyaURI uri = new RyaURI("urn:test#1234");
+ RyaIRI uri = new RyaIRI("urn:test#1234");
assertFalse(instance.handles(uri, predicate, object, context));
assertFalse(instance.handles(subject, uri, object, context));
assertFalse(instance.handles(subject, predicate, uri, context));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
index a3a467d..e1e9dc6 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
@@ -40,10 +40,10 @@
//public class OspWholeRowTriplePatternStrategyTest extends TestCase {
// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
-// RyaURI uri = new RyaURI("urn:test#1234");
-// RyaURI uri2 = new RyaURI("urn:test#1235");
-// RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
-// RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
+// RyaIRI uri = new RyaIRI("urn:test#1234");
+// RyaIRI uri2 = new RyaIRI("urn:test#1235");
+// RyaIRIRange rangeIRI = new RyaIRIRange(uri, uri2);
+// RyaIRIRange rangeIRI2 = new RyaIRIRange(new RyaIRI("urn:test#1235"), new RyaIRI("urn:test#1236"));
//
// RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
// RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
@@ -72,10 +72,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, null, rangeURI, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, null, rangeIRI, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(null, null, rangeURI2, null, null);
+// entry = strategy.defineRange(null, null, rangeIRI2, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -98,10 +98,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeURI, null, uri, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeIRI, null, uri, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(rangeURI2, null, uri, null, null);
+// entry = strategy.defineRange(rangeIRI2, null, uri, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -111,10 +111,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeURI, null, customType1, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeIRI, null, customType1, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(rangeURI2, null, customType2, null, null);
+// entry = strategy.defineRange(rangeIRI2, null, customType2, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -123,16 +123,16 @@
// assertTrue(strategy.handles(uri, null, uri, null));
// assertTrue(strategy.handles(uri, null, uri, uri));
// //o_r(s)(ng)
-// assertTrue(strategy.handles(rangeURI, null, uri, null));
-// assertTrue(strategy.handles(rangeURI, null, uri, uri));
+// assertTrue(strategy.handles(rangeIRI, null, uri, null));
+// assertTrue(strategy.handles(rangeIRI, null, uri, uri));
// //o(ng)
// assertTrue(strategy.handles(null, null, uri, null));
// assertTrue(strategy.handles(null, null, uri, uri));
// //r(o)
-// assertTrue(strategy.handles(null, null, rangeURI, null));
-// assertTrue(strategy.handles(null, null, rangeURI, uri));
+// assertTrue(strategy.handles(null, null, rangeIRI, null));
+// assertTrue(strategy.handles(null, null, rangeIRI, uri));
//
// //false
-// assertFalse(strategy.handles(uri, null, rangeURI, null));
+// assertFalse(strategy.handles(uri, null, rangeIRI, null));
// }
//}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
index 7060457..6fe7540 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
@@ -40,10 +40,10 @@
//public class PoWholeRowTriplePatternStrategyTest extends TestCase {
// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
-// RyaURI uri = new RyaURI("urn:test#1234");
-// RyaURI uri2 = new RyaURI("urn:test#1235");
-// RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
-// RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
+// RyaIRI uri = new RyaIRI("urn:test#1234");
+// RyaIRI uri2 = new RyaIRI("urn:test#1235");
+// RyaIRIRange rangeIRI = new RyaIRIRange(uri, uri2);
+// RyaIRIRange rangeIRI2 = new RyaIRIRange(new RyaIRI("urn:test#1235"), new RyaIRI("urn:test#1236"));
// PoWholeRowTriplePatternStrategy strategy = new PoWholeRowTriplePatternStrategy();
// RyaContext ryaContext = RyaContext.getInstance();
//
@@ -59,10 +59,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, uri, rangeURI, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, uri, rangeIRI, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(null, uri, rangeURI2, null, null);
+// entry = strategy.defineRange(null, uri, rangeIRI2, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -111,15 +111,15 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeURI, uri, uri, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeIRI, uri, uri, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(rangeURI2, uri, uri, null, null);
+// entry = strategy.defineRange(rangeIRI2, uri, uri, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
// public void testPRange() throws Exception {
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, rangeURI, null, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(null, rangeIRI, null, null, null);
// Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = ryaContext.serializeTriple(new RyaStatement(uri, uri, uri, null));
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO);
// Key key = new Key(new Text(tripleRow.getRow()));
@@ -140,22 +140,22 @@
// assertTrue(strategy.handles(null, uri, uri, null));
// assertTrue(strategy.handles(null, uri, uri, uri));
// //po_r(s)(ng)
-// assertTrue(strategy.handles(rangeURI, uri, uri, null));
-// assertTrue(strategy.handles(rangeURI, uri, uri, uri));
+// assertTrue(strategy.handles(rangeIRI, uri, uri, null));
+// assertTrue(strategy.handles(rangeIRI, uri, uri, uri));
// //p(ng)
// assertTrue(strategy.handles(null, uri, null, null));
// assertTrue(strategy.handles(null, uri, null, uri));
// //p_r(o)(ng)
-// assertTrue(strategy.handles(null, uri, rangeURI, null));
-// assertTrue(strategy.handles(null, uri, rangeURI, uri));
+// assertTrue(strategy.handles(null, uri, rangeIRI, null));
+// assertTrue(strategy.handles(null, uri, rangeIRI, uri));
// //r(p)(ng)
-// assertTrue(strategy.handles(null, rangeURI, null, null));
-// assertTrue(strategy.handles(null, rangeURI, null, uri));
+// assertTrue(strategy.handles(null, rangeIRI, null, null));
+// assertTrue(strategy.handles(null, rangeIRI, null, uri));
//
// //false cases
// //sp..
// assertFalse(strategy.handles(uri, uri, null, null));
// //r(s)_p
-// assertFalse(strategy.handles(rangeURI, uri, null, null));
+// assertFalse(strategy.handles(rangeIRI, uri, null, null));
// }
//}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
index 2c40053..9fb0793 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
@@ -40,10 +40,10 @@
//public class SpoWholeRowTriplePatternStrategyTest extends TestCase {
// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
-// RyaURI uri = new RyaURI("urn:test#1234");
-// RyaURI uri2 = new RyaURI("urn:test#1235");
-// RyaURIRange rangeURI = new RyaURIRange(uri, uri2);
-// RyaURIRange rangeURI2 = new RyaURIRange(new RyaURI("urn:test#1235"), new RyaURI("urn:test#1236"));
+// RyaIRI uri = new RyaIRI("urn:test#1234");
+// RyaIRI uri2 = new RyaIRI("urn:test#1235");
+// RyaIRIRange rangeIRI = new RyaIRIRange(uri, uri2);
+// RyaIRIRange rangeIRI2 = new RyaIRIRange(new RyaIRI("urn:test#1235"), new RyaIRI("urn:test#1236"));
// SpoWholeRowTriplePatternStrategy strategy = new SpoWholeRowTriplePatternStrategy();
// RyaContext ryaContext = RyaContext.getInstance();
//
@@ -85,10 +85,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(uri, uri, rangeURI, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(uri, uri, rangeIRI, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(uri, uri, rangeURI2, null, null);
+// entry = strategy.defineRange(uri, uri, rangeIRI2, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -123,9 +123,9 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(uri, rangeURI, null, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(uri, rangeIRI, null, null, null);
// assertTrue(entry.getValue().contains(key));
-// entry = strategy.defineRange(uri, rangeURI2, null, null, null);
+// entry = strategy.defineRange(uri, rangeIRI2, null, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -148,10 +148,10 @@
// TripleRow tripleRow = serialize.get(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO);
// Key key = new Key(new Text(tripleRow.getRow()));
//
-// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeURI, null, null, null, null);
+// Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Range> entry = strategy.defineRange(rangeIRI, null, null, null, null);
// assertTrue(entry.getValue().contains(key));
//
-// entry = strategy.defineRange(rangeURI2, null, null, null, null);
+// entry = strategy.defineRange(rangeIRI2, null, null, null, null);
// assertFalse(entry.getValue().contains(key));
// }
//
@@ -166,22 +166,22 @@
// assertTrue(strategy.handles(uri, null, null, null));
// assertTrue(strategy.handles(uri, null, null, uri));
// //sp_r(o)(ng)
-// assertTrue(strategy.handles(uri, uri, rangeURI, null));
-// assertTrue(strategy.handles(uri, uri, rangeURI, uri));
+// assertTrue(strategy.handles(uri, uri, rangeIRI, null));
+// assertTrue(strategy.handles(uri, uri, rangeIRI, uri));
// //s_r(p)(ng)
-// assertTrue(strategy.handles(uri, rangeURI, null, null));
-// assertTrue(strategy.handles(uri, rangeURI, null, uri));
+// assertTrue(strategy.handles(uri, rangeIRI, null, null));
+// assertTrue(strategy.handles(uri, rangeIRI, null, uri));
// //r(s)
-// assertTrue(strategy.handles(rangeURI, null, null, null));
+// assertTrue(strategy.handles(rangeIRI, null, null, null));
//
// //fail
// //s_r(p)_r(o)
-// assertFalse(strategy.handles(uri, rangeURI, rangeURI, null));
+// assertFalse(strategy.handles(uri, rangeIRI, rangeIRI, null));
//
// //s==null
// assertFalse(strategy.handles(null, uri, uri, null));
//
// //s_r(o)
-// assertFalse(strategy.handles(uri, null, rangeURI, null));
+// assertFalse(strategy.handles(uri, null, rangeIRI, null));
// }
//}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
index ade343f..d4b5f5c 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
@@ -24,7 +24,7 @@ import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.wholerow.MockRdfConfiguration;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
@@ -42,11 +42,11 @@ public class RyaContextTest extends TestCase {
byte[] serialize = instance.serialize(ryaType);
assertEquals(ryaType, instance.deserialize(serialize));
- //uri
- RyaURI ryaURI = new RyaURI("urn:test#1234");
- serialize = instance.serialize(ryaURI);
+ //iri
+ RyaIRI ryaIRI = new RyaIRI("urn:test#1234");
+ serialize = instance.serialize(ryaIRI);
RyaType deserialize = instance.deserialize(serialize);
- assertEquals(ryaURI, deserialize);
+ assertEquals(ryaIRI, deserialize);
//custom type
ryaType = new RyaType(SimpleValueFactory.getInstance().createIRI("urn:test#customDataType"), "mydata");
@@ -55,8 +55,8 @@ public class RyaContextTest extends TestCase {
}
public void testTripleRowSerialization() throws Exception {
- RyaURI subj = new RyaURI("urn:test#subj");
- RyaURI pred = new RyaURI("urn:test#pred");
+ RyaIRI subj = new RyaIRI("urn:test#subj");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
RyaType obj = new RyaType("mydata");
RyaStatement statement = new RyaStatement(subj, pred, obj);
RyaTripleContext instance = RyaTripleContext.getInstance(new MockRdfConfiguration());
@@ -67,8 +67,8 @@ public class RyaContextTest extends TestCase {
}
public void testHashedTripleRowSerialization() throws Exception {
- RyaURI subj = new RyaURI("urn:test#subj");
- RyaURI pred = new RyaURI("urn:test#pred");
+ RyaIRI subj = new RyaIRI("urn:test#subj");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
RyaType obj = new RyaType("mydata");
RyaStatement statement = new RyaStatement(subj, pred, obj);
MockRdfConfiguration config = new MockRdfConfiguration();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaIRIResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaIRIResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaIRIResolverTest.java
new file mode 100644
index 0000000..40c58e0
--- /dev/null
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaIRIResolverTest.java
@@ -0,0 +1,40 @@
+package org.apache.rya.api.resolver.impl;
+
+/*
+ * 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.
+ */
+
+
+
+import junit.framework.TestCase;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaIRI;
+
+/**
+ * Date: 7/16/12
+ * Time: 2:51 PM
+ */
+public class RyaIRIResolverTest extends TestCase {
+
+ public void testSerialization() throws Exception {
+ RyaIRI ryaIRI = new RyaIRI("urn:testdata#data");
+ byte[] serialize = new RyaIRIResolver().serialize(ryaIRI);
+ RyaType deserialize = new RyaIRIResolver().deserialize(serialize);
+ assertEquals(ryaIRI, deserialize);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaURIResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaURIResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaURIResolverTest.java
deleted file mode 100644
index 811961a..0000000
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/RyaURIResolverTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.rya.api.resolver.impl;
-
-/*
- * 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.
- */
-
-
-
-import junit.framework.TestCase;
-import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-
-/**
- * Date: 7/16/12
- * Time: 2:51 PM
- */
-public class RyaURIResolverTest extends TestCase {
-
- public void testSerialization() throws Exception {
- RyaURI ryaURI = new RyaURI("urn:testdata#data");
- byte[] serialize = new RyaURIResolver().serialize(ryaURI);
- RyaType deserialize = new RyaURIResolver().deserialize(serialize);
- assertEquals(ryaURI, deserialize);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/HashedWholeRowTripleResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/HashedWholeRowTripleResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/HashedWholeRowTripleResolverTest.java
index f57b5d1..2dcb362 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/HashedWholeRowTripleResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/HashedWholeRowTripleResolverTest.java
@@ -26,7 +26,7 @@ import java.util.Map;
import junit.framework.TestCase;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.triple.TripleRow;
/**
@@ -39,10 +39,10 @@ public class HashedWholeRowTripleResolverTest extends TestCase {
public void testSerialize() throws Exception {
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
@@ -61,10 +61,10 @@ public class HashedWholeRowTripleResolverTest extends TestCase {
public void testSerializePO() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
@@ -82,10 +82,10 @@ public class HashedWholeRowTripleResolverTest extends TestCase {
public void testSerializeOSP() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
@@ -103,10 +103,10 @@ public class HashedWholeRowTripleResolverTest extends TestCase {
public void testSerializeOSPCustomType() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
[19/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AntecedentVisitor.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AntecedentVisitor.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AntecedentVisitor.java
index 1f2cbba..766b001 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AntecedentVisitor.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AntecedentVisitor.java
@@ -21,8 +21,8 @@ package org.apache.rya.forwardchain.rule;
import java.util.HashSet;
import java.util.Set;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Query visitor that identifies all triple patterns represented as
@@ -33,7 +33,7 @@ import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
* This means relying on this analysis to determine whether a fact can be part
* of a solution can yield false positives, but not false negatives.
*/
-class AntecedentVisitor extends QueryModelVisitorBase<RuntimeException> {
+class AntecedentVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<StatementPattern> antecedentStatementPatterns = new HashSet<>();
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitor.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitor.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitor.java
index e28dbe3..cd002da 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitor.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitor.java
@@ -25,18 +25,18 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.BNodeGenerator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.BNodeGenerator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Query visitor that identifies all triple patterns produced by a "CONSTRUCT"
@@ -53,7 +53,7 @@ import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
* this analysis may produce an overly broad set of possible consequents
* compared to some more sophisticated method.
*/
-public class ConstructConsequentVisitor extends QueryModelVisitorBase<RuntimeException> {
+public class ConstructConsequentVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<StatementPattern> consequentStatementPatterns = new HashSet<>();
private static final String SUBJECT_VAR_NAME = "subject";
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Rule.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Rule.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Rule.java
index 74004b9..89e3bc7 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Rule.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Rule.java
@@ -23,7 +23,7 @@ import java.util.Collection;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.strategy.AbstractRuleExecutionStrategy;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
/**
* Represents a forward-chaining inference rule. A rule is triggered by some
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Ruleset.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Ruleset.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Ruleset.java
index 965d2d3..484fc8a 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Ruleset.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/Ruleset.java
@@ -25,7 +25,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
index 44e15e6..114d88e 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/SpinConstructRule.java
@@ -26,42 +26,43 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.StatementMetadata;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.forwardchain.ForwardChainConstants;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.strategy.AbstractRuleExecutionStrategy;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SP;
-import org.openrdf.model.vocabulary.SPIN;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandlerBase;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.SingletonSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedGraphQuery;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SP;
+import org.eclipse.rdf4j.model.vocabulary.SPIN;
+import org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.SingletonSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedGraphQuery;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
@@ -176,8 +177,8 @@ public class SpinConstructRule extends AbstractConstructRule {
return var == null ? null : var.getValue();
}
- private static class TypeRequirementVisitor extends QueryModelVisitorBase<RuntimeException> {
- private static final Var RDF_TYPE_VAR = new Var("-const-" + RDF.TYPE.stringValue(), RDF.TYPE);
+ private static class TypeRequirementVisitor extends AbstractQueryModelVisitor<RuntimeException> {
+ private static final Var RDF_TYPE_VAR = VarNameUtils.createUniqueConstVar(RDF.TYPE);
private static final Set<Resource> BASE_TYPES = Sets.newHashSet(RDFS.RESOURCE, OWL.THING);
static {
RDF_TYPE_VAR.setConstant(true);
@@ -186,7 +187,7 @@ public class SpinConstructRule extends AbstractConstructRule {
private final String varName;
private final StatementPattern typeRequirement;
public TypeRequirementVisitor(String varName, Resource requiredType) {
- final Var typeVar = new Var("-const-" + requiredType.stringValue(), requiredType);
+ final Var typeVar = VarNameUtils.createUniqueConstVar(requiredType);
typeVar.setConstant(true);
this.varName = varName;
if (BASE_TYPES.contains(requiredType)) {
@@ -285,7 +286,7 @@ public class SpinConstructRule extends AbstractConstructRule {
try {
conn = repository.getConnection();
TupleQuery ruleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, ruleQueryString);
- ruleQuery.evaluate(new TupleQueryResultHandlerBase() {
+ ruleQuery.evaluate(new AbstractTupleQueryResultHandler() {
@Override
public void handleSolution(BindingSet bs) throws TupleQueryResultHandlerException {
// For each rule identifier found, instantiate a SpinRule
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/MongoPipelineStrategy.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/MongoPipelineStrategy.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/MongoPipelineStrategy.java
index c095122..95ad841 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/MongoPipelineStrategy.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/MongoPipelineStrategy.java
@@ -46,8 +46,8 @@ import org.apache.rya.mongodb.dao.SimpleMongoDBStorageStrategy;
import org.apache.rya.sail.config.RyaSailFactory;
import org.bson.Document;
import org.bson.conversions.Bson;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.base.Preconditions;
import com.mongodb.Block;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/RoundRobinStrategy.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/RoundRobinStrategy.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/RoundRobinStrategy.java
index eb044fc..9d54f93 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/RoundRobinStrategy.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/RoundRobinStrategy.java
@@ -32,7 +32,7 @@ import org.apache.rya.forwardchain.ForwardChainConstants;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.rule.Rule;
import org.apache.rya.forwardchain.rule.Ruleset;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/SailExecutionStrategy.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/SailExecutionStrategy.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/SailExecutionStrategy.java
index d09c50c..86e04eb 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/SailExecutionStrategy.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/strategy/SailExecutionStrategy.java
@@ -36,16 +36,16 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.sail.config.RyaSailFactory;
import org.calrissian.mango.collect.CloseableIterable;
-import org.openrdf.model.Statement;
-import org.openrdf.query.GraphQuery;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.parser.ParsedGraphQuery;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailGraphQuery;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.helpers.RDFHandlerBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.GraphQuery;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.parser.ParsedGraphQuery;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailGraphQuery;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
import com.google.common.base.Preconditions;
@@ -186,7 +186,7 @@ public class SailExecutionStrategy extends AbstractRuleExecutionStrategy {
}
}
- private static class InferredStatementHandler<T extends RdfCloudTripleStoreConfiguration> extends RDFHandlerBase {
+ private static class InferredStatementHandler<T extends RdfCloudTripleStoreConfiguration> extends AbstractRDFHandler {
private RyaDAO<T> dao;
private RyaQueryEngine<T> engine;
private long numStatementsAdded = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/batch/MongoSpinIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/batch/MongoSpinIT.java b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/batch/MongoSpinIT.java
index c70a025..72fb085 100644
--- a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/batch/MongoSpinIT.java
+++ b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/batch/MongoSpinIT.java
@@ -20,6 +20,7 @@ package org.apache.rya.forwardchain.batch;
import java.io.BufferedReader;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.URL;
import java.util.Arrays;
import java.util.HashSet;
@@ -34,29 +35,30 @@ import org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexin
import org.apache.rya.mongodb.EmbeddedMongoFactory;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.ListBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.Rio;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.ListBindingSet;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.Rio;
+import com.google.common.base.Charsets;
import com.google.common.io.Resources;
import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
public class MongoSpinIT {
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String EX = "http://example.org/";
private MongoDBRdfConfiguration conf;
@@ -94,9 +96,11 @@ public class MongoSpinIT {
ToolRunner.run(conf, tool, new String[] {});
solutions = executeQuery(Resources.getResource("query.sparql"));
expected.add(new ListBindingSet(Arrays.asList("X", "Y"),
- VF.createURI(EX, "Alice"), VF.createURI(EX, "Department1")));
+ VF.createIRI(EX, "Alice"), VF.createIRI(EX, "Department1")));
Assert.assertEquals(expected, solutions);
- Assert.assertEquals(24, tool.getNumInferences());
+ // TODO: Check if spin rules with empty WHERE clauses, such as
+ // rl:scm-cls in the owlrl.ttl test file, should be included.
+ Assert.assertEquals(48, tool.getNumInferences());
}
@Test
@@ -112,13 +116,15 @@ public class MongoSpinIT {
ToolRunner.run(conf, tool, new String[] {});
solutions = executeQuery(Resources.getResource("query.sparql"));
expected.add(new ListBindingSet(Arrays.asList("X", "Y"),
- VF.createURI(EX, "Alice"), VF.createURI(EX, "Department1")));
+ VF.createIRI(EX, "Alice"), VF.createIRI(EX, "Department1")));
Assert.assertEquals(expected, solutions);
- Assert.assertEquals(24, tool.getNumInferences());
+ // TODO: Check if spin rules with empty WHERE clauses, such as
+ // rl:scm-cls in the owlrl.ttl test file, should be included.
+ Assert.assertEquals(41, tool.getNumInferences());
}
private void insertDataFile(URL dataFile, String defaultNamespace) throws Exception {
- RDFFormat format = Rio.getParserFormatForFileName(dataFile.getFile());
+ RDFFormat format = Rio.getParserFormatForFileName(dataFile.getFile()).get();
SailRepositoryConnection conn = repository.getConnection();
try {
conn.add(dataFile, defaultNamespace, format);
@@ -127,20 +133,22 @@ public class MongoSpinIT {
}
}
- Set<BindingSet> executeQuery(URL queryFile) throws Exception {
+ private Set<BindingSet> executeQuery(URL queryFile) throws Exception {
SailRepositoryConnection conn = repository.getConnection();
try {
- InputStream queryIS = queryFile.openStream();
- BufferedReader br = new BufferedReader(new java.io.InputStreamReader(queryIS, "UTF-8"));
- String query = br.lines().collect(Collectors.joining("\n"));
- br.close();
- TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
- TupleQueryResult result = tupleQuery.evaluate();
- Set<BindingSet> solutions = new HashSet<>();
- while (result.hasNext()) {
- solutions.add(result.next());
+ try(
+ final InputStream queryIS = queryFile.openStream();
+ final BufferedReader br = new BufferedReader(new InputStreamReader(queryIS, Charsets.UTF_8));
+ ) {
+ final String query = br.lines().collect(Collectors.joining("\n"));
+ final TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
+ final TupleQueryResult result = tupleQuery.evaluate();
+ final Set<BindingSet> solutions = new HashSet<>();
+ while (result.hasNext()) {
+ solutions.add(result.next());
+ }
+ return solutions;
}
- return solutions;
} finally {
closeQuietly(conn);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/AntecedentVisitorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/AntecedentVisitorTest.java b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/AntecedentVisitorTest.java
index 7761a1a..ca9df6e 100644
--- a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/AntecedentVisitorTest.java
+++ b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/AntecedentVisitorTest.java
@@ -20,34 +20,35 @@ package org.apache.rya.forwardchain.rule;
import java.util.Set;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.StatementPattern.Scope;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.StatementPattern.Scope;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
public class AntecedentVisitorTest {
private static Var c(Value val) {
- Var v = new Var("-const-" + val.stringValue(), val);
+ final Var v = VarNameUtils.createUniqueConstVar(val);
v.setAnonymous(true);
return v;
}
- private static ValueFactory VF = ValueFactoryImpl.getInstance();
- private static String EX = "http://example.org/";
- private static URI G1 = VF.createURI(EX, "Graph1");
- private static URI G2 = VF.createURI(EX, "Graph2");
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final String EX = "http://example.org/";
+ private static final IRI G1 = VF.createIRI(EX, "Graph1");
+ private static final IRI G2 = VF.createIRI(EX, "Graph2");
@Test
public void testSelectQuery() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitorTest.java b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitorTest.java
index 0865ef8..9acdbff 100644
--- a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitorTest.java
+++ b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/ConstructConsequentVisitorTest.java
@@ -21,23 +21,23 @@ package org.apache.rya.forwardchain.rule;
import java.util.Arrays;
import java.util.Set;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.BNodeGenerator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.SingletonSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.BNodeGenerator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.SingletonSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/RulesetTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/RulesetTest.java b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/RulesetTest.java
index adb851b..13ea873 100644
--- a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/RulesetTest.java
+++ b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/RulesetTest.java
@@ -22,21 +22,22 @@ import java.util.Collection;
import java.util.Set;
import org.apache.rya.api.domain.StatementMetadata;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.strategy.AbstractRuleExecutionStrategy;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.Sets;
public class RulesetTest {
private static Var c(Value val) {
- Var v = new Var("-const-" + val.stringValue(), val);
+ final Var v = VarNameUtils.createUniqueConstVar(val);
v.setAnonymous(true);
return v;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/SpinConstructRuleTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/SpinConstructRuleTest.java b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/SpinConstructRuleTest.java
index 9bbcce0..5e525bc 100644
--- a/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/SpinConstructRuleTest.java
+++ b/extras/rya.forwardchain/src/test/java/org/apache/rya/forwardchain/rule/SpinConstructRuleTest.java
@@ -20,35 +20,36 @@ package org.apache.rya.forwardchain.rule;
import java.util.Arrays;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.parser.ParsedGraphQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.parser.ParsedGraphQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
public class SpinConstructRuleTest {
- private static ValueFactory VF = ValueFactoryImpl.getInstance();
- private static SPARQLParser PARSER = new SPARQLParser();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final SPARQLParser PARSER = new SPARQLParser();
- private static URI RL_CAX_SCO = VF.createURI("http://example.org/rl/cax-sco");
- private static URI RL_SCM_CLS = VF.createURI("http://example.org/rl/scm-cls");
- private static URI RL_PRP_SPO1 = VF.createURI("http://example.org/rl/prp-spo");
- private static URI LIVING_THING = VF.createURI("http://example.org/LivingThing");
+ private static final IRI RL_CAX_SCO = VF.createIRI("http://example.org/rl/cax-sco");
+ private static final IRI RL_SCM_CLS = VF.createIRI("http://example.org/rl/scm-cls");
+ private static final IRI RL_PRP_SPO1 = VF.createIRI("http://example.org/rl/prp-spo");
+ private static final IRI LIVING_THING = VF.createIRI("http://example.org/LivingThing");
private static Var c(Value val) {
- return new Var("-const-" + val.stringValue(), val);
+ return VarNameUtils.createUniqueConstVar(val);
}
private static Var ac(Value val) {
Var v = c(val);
@@ -62,7 +63,7 @@ public class SpinConstructRuleTest {
+ " ?this a <" + LIVING_THING.stringValue() + "> .\n"
+ "} WHERE { }";
ParsedGraphQuery query = (ParsedGraphQuery) PARSER.parseQuery(text, null);
- SpinConstructRule rule = new SpinConstructRule(FOAF.PERSON, VF.createURI("urn:person-is-living"), query);
+ SpinConstructRule rule = new SpinConstructRule(FOAF.PERSON, VF.createIRI("urn:person-is-living"), query);
Multiset<StatementPattern> expectedAntecedents = HashMultiset.create(Arrays.asList(
new StatementPattern(new Var("this"), c(RDF.TYPE), c(FOAF.PERSON))));
Multiset<StatementPattern> expectedConsequents = HashMultiset.create(Arrays.asList(
@@ -120,6 +121,8 @@ public class SpinConstructRuleTest {
String text = "CONSTRUCT {\n"
// actual rule is "?this subClassOf ?this", but reflexive construct patterns produce
// bnodes due to an openrdf bug, resulting in incorrect matches
+ // TODO: is the above comment still a concern with RDF4J? bnodes
+ // don't appear to be produced with RDF4J
+ " ?this rdfs:subClassOf ?something .\n"
+ " ?this owl:equivalentClass ?something .\n"
+ " ?this rdfs:subClassOf owl:Thing .\n"
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
index a425ce4..bd82c21 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoEnabledFilterFunctionOptimizer.java
@@ -43,31 +43,30 @@ import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
import org.apache.rya.mongodb.MongoSecondaryIndex;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.And;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.And;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Lists;
public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Configurable {
private static final Logger LOG = Logger.getLogger(GeoEnabledFilterFunctionOptimizer.class);
- private final ValueFactory valueFactory = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private Configuration conf;
private GeoIndexer geoIndexer;
@@ -190,12 +189,12 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
}
//find vars contained in filters
- private static class SearchVarVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class SearchVarVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final Collection<Var> searchProperties = new ArrayList<>();
@Override
public void meet(final FunctionCall fn) {
- final URI fun = new URIImpl(fn.getURI());
+ final IRI fun = VF.createIRI(fn.getURI());
final Var result = IndexingFunctionRegistry.getResultVarFromFunctionCall(fun, fn.getArgs());
if (result != null && !searchProperties.contains(result)) {
searchProperties.add(result);
@@ -204,7 +203,7 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
}
//find StatementPatterns containing filter variables
- private static class MatchStatementVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class MatchStatementVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final Collection<Var> propertyVars;
private final Collection<Var> usedVars = new ArrayList<>();
private final List<StatementPattern> matchStatements = new ArrayList<>();
@@ -226,16 +225,16 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
}
}
- private abstract class AbstractEnhanceVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private abstract class AbstractEnhanceVisitor extends AbstractQueryModelVisitor<RuntimeException> {
final String matchVar;
- List<URI> func = Lists.newArrayList();
+ List<IRI> func = Lists.newArrayList();
List<Object[]> args = Lists.newArrayList();
public AbstractEnhanceVisitor(final String matchVar) {
this.matchVar = matchVar;
}
- protected void addFilter(final URI uri, final Object[] values) {
+ protected void addFilter(final IRI uri, final Object[] values) {
func.add(uri);
args.add(values);
}
@@ -250,12 +249,12 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
@Override
public void meet(final FunctionCall call) {
- final URI fnUri = valueFactory.createURI(call.getURI());
+ final IRI fnUri = VF.createIRI(call.getURI());
final Var resultVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(fnUri, call.getArgs());
if (resultVar != null && resultVar.getName().equals(matchVar)) {
- addFilter(valueFactory.createURI(call.getURI()), GeoParseUtils.extractArguments(matchVar, call));
+ addFilter(VF.createIRI(call.getURI()), GeoParseUtils.extractArguments(matchVar, call));
if (call.getParentNode() instanceof Filter || call.getParentNode() instanceof And || call.getParentNode() instanceof LeftJoin) {
- call.replaceWith(new ValueConstant(valueFactory.createLiteral(true)));
+ call.replaceWith(new ValueConstant(VF.createLiteral(true)));
} else {
throw new IllegalArgumentException("Query error: Found " + call + " as part of an expression that is too complex");
}
@@ -299,7 +298,7 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
public IndexerExprReplacer(final List<IndexingExpr> indxExpr) {
this.indxExpr = indxExpr;
- final URI func = indxExpr.get(0).getFunction();
+ final IRI func = indxExpr.get(0).getFunction();
type = IndexingFunctionRegistry.getFunctionType(func);
}
@@ -329,7 +328,7 @@ public class GeoEnabledFilterFunctionOptimizer implements QueryOptimizer, Config
}
}
- private static class VarExchangeVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class VarExchangeVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final StatementPattern exchangeVar;
public VarExchangeVisitor(final StatementPattern sp) {
exchangeVar = sp;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexer.java
index d091d32..2a20cc2 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexer.java
@@ -1,10 +1,3 @@
-package org.apache.rya.indexing;
-
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
-
-import com.vividsolutions.jts.geom.Geometry;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,12 +16,15 @@ import com.vividsolutions.jts.geom.Geometry;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing;
-
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
import org.apache.rya.indexing.accumulo.geo.GeoTupleSet.GeoSearchFunctionFactory.NearQuery;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+
+import com.vividsolutions.jts.geom.Geometry;
/**
* A repository to store, index, and retrieve {@link Statement}s based on geospatial features.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexingTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexingTestUtils.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexingTestUtils.java
index b0c636d..223a9e2 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexingTestUtils.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoIndexingTestUtils.java
@@ -21,7 +21,7 @@ package org.apache.rya.indexing;
import java.util.HashSet;
import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Utility methods to help test geo indexing methods.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoRyaSailFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoRyaSailFactory.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoRyaSailFactory.java
index c53fea1..24cba6a 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoRyaSailFactory.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/GeoRyaSailFactory.java
@@ -48,8 +48,8 @@ import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoParseUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoParseUtils.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoParseUtils.java
index 779a61e..3f8f1e8 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoParseUtils.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoParseUtils.java
@@ -28,13 +28,13 @@ import javax.xml.parsers.ParserConfigurationException;
import org.apache.log4j.Logger;
import org.apache.rya.indexing.GeoConstants;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.xml.sax.SAXException;
import com.vividsolutions.jts.geom.Geometry;
@@ -67,7 +67,7 @@ public class GeoParseUtils {
}
public static Literal getLiteral(final Statement statement) throws ParseException {
- final org.openrdf.model.Value v = statement.getObject();
+ final Value v = statement.getObject();
if (!(v instanceof Literal)) {
throw new ParseException("Statement does not contain Literal: " + statement.toString());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java
index 888c099..87f6a9b 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java
@@ -1,3 +1,21 @@
+/*
+ * 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.rya.indexing.accumulo.geo;
import java.util.ArrayList;
@@ -15,12 +33,13 @@ import org.apache.rya.indexing.IteratorFactory;
import org.apache.rya.indexing.SearchFunction;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.base.Joiner;
import com.google.common.collect.Maps;
@@ -28,28 +47,6 @@ import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
-/*
- * 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.
- */
-
-
-import info.aduna.iteration.CloseableIteration;
-
//Indexing Node for geo expressions to be inserted into execution plan
//to delegate geo portion of query to geo index
public class GeoTupleSet extends ExternalTupleSet {
@@ -120,7 +117,7 @@ public class GeoTupleSet extends ExternalTupleSet {
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final BindingSet bindings)
throws QueryEvaluationException {
- final URI funcURI = filterInfo.getFunction();
+ final IRI funcURI = filterInfo.getFunction();
final SearchFunction searchFunction = new GeoSearchFunctionFactory(conf, geoIndexer).getSearchFunction(funcURI);
String queryText;
@@ -170,7 +167,7 @@ public class GeoTupleSet extends ExternalTupleSet {
Configuration conf;
- private final Map<URI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
+ private final Map<IRI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
private final GeoIndexer geoIndexer;
@@ -186,7 +183,7 @@ public class GeoTupleSet extends ExternalTupleSet {
* @param searchFunction
* @return
*/
- public SearchFunction getSearchFunction(final URI searchFunction) {
+ public SearchFunction getSearchFunction(final IRI searchFunction) {
SearchFunction geoFunc = null;
@@ -199,7 +196,7 @@ public class GeoTupleSet extends ExternalTupleSet {
return geoFunc;
}
- private SearchFunction getSearchFunctionInternal(final URI searchFunction) throws QueryEvaluationException {
+ private SearchFunction getSearchFunctionInternal(final IRI searchFunction) throws QueryEvaluationException {
final SearchFunction sf = SEARCH_FUNCTION_MAP.get(searchFunction);
if (sf != null) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/OptionalConfigUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/OptionalConfigUtils.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/OptionalConfigUtils.java
index bfd39d0..42331ea 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/OptionalConfigUtils.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/accumulo/geo/OptionalConfigUtils.java
@@ -22,7 +22,6 @@ import java.util.List;
import java.util.Set;
import org.apache.hadoop.conf.Configuration;
-import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
@@ -32,8 +31,7 @@ import org.apache.rya.indexing.GeoEnabledFilterFunctionOptimizer;
import org.apache.rya.indexing.GeoIndexerType;
import org.apache.rya.indexing.GeoTemporalIndexerType;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.apache.rya.indexing.geotemporal.GeoTemporalOptimizer;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
import com.google.common.collect.Lists;
@@ -60,7 +58,7 @@ public class OptionalConfigUtils extends ConfigUtils {
public static final String GEO_PREDICATES_LIST = "sc.geo.predicates";
public static final String GEO_INDEXER_TYPE = "sc.geo.geo_indexer_type";
- public static Set<URI> getGeoPredicates(final Configuration conf) {
+ public static Set<IRI> getGeoPredicates(final Configuration conf) {
return getPredicates(conf, GEO_PREDICATES_LIST);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexSetProvider.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexSetProvider.java
index bf12f26..bae2326 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexSetProvider.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexSetProvider.java
@@ -39,13 +39,14 @@ import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.geotemporal.model.EventQueryNode;
import org.apache.rya.indexing.geotemporal.model.EventQueryNode.EventQueryNodeBuilder;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -55,6 +56,7 @@ import com.google.common.collect.Multimap;
*/
public class GeoTemporalIndexSetProvider implements ExternalSetProvider<EventQueryNode> {
private static final Logger LOG = Logger.getLogger(GeoTemporalIndexSetProvider.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
//organzied by object var. Each object is a filter, or set of filters
private Multimap<Var, IndexingExpr> filterMap;
@@ -71,7 +73,7 @@ public class GeoTemporalIndexSetProvider implements ExternalSetProvider<EventQue
private Map<Var, StatementPattern> objectPatterns;
- private static URI filterURI;
+ private static IRI filterURI;
private final EventStorage eventStorage;
@@ -117,7 +119,7 @@ public class GeoTemporalIndexSetProvider implements ExternalSetProvider<EventQue
for(final StatementPattern sp : patterns) {
final Var obj = sp.getObjectVar();
- ///filter map does not have -const-
+ ///filter map does not have _const_
if(filterMap.containsKey(obj)) {
@@ -211,7 +213,7 @@ public class GeoTemporalIndexSetProvider implements ExternalSetProvider<EventQue
}
private void addFilter(final FunctionCall call) {
- filterURI = new URIImpl(call.getURI());
+ filterURI = VF.createIRI(call.getURI());
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, call.getArgs());
filterMap.put(objVar, new IndexingExpr(filterURI, objectPatterns.get(objVar), GeoParseUtils.extractArguments(objVar.getName(), call)));
}
@@ -220,10 +222,10 @@ public class GeoTemporalIndexSetProvider implements ExternalSetProvider<EventQue
* Finds the object/function in a Filter. If the associated statement pattern
* has been found, creates the {@link IndexingExpr} and adds it to the map.
*/
- private class FilterVisitor extends QueryModelVisitorBase<Exception> {
+ private class FilterVisitor extends AbstractQueryModelVisitor<Exception> {
@Override
public void meet(final FunctionCall call) throws Exception {
- filterURI = new URIImpl(call.getURI());
+ filterURI = VF.createIRI(call.getURI());
final FUNCTION_TYPE type = IndexingFunctionRegistry.getFunctionType(filterURI);
if(type == FUNCTION_TYPE.GEO || type == FUNCTION_TYPE.TEMPORAL) {
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, call.getArgs());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
index d74dca6..9db4bd7 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalIndexer.java
@@ -21,9 +21,10 @@ package org.apache.rya.indexing.geotemporal;
import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* A repository to store, index, and retrieve {@link Statement}s based on geotemporal features.
@@ -88,17 +89,17 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
*/
OVERLAPS(GeoConstants.GEO_SF_OVERLAPS);
- private final URI uri;
+ private final IRI uri;
- private GeoPolicy(final URI uri) {
+ private GeoPolicy(final IRI uri) {
this.uri = uri;
}
- public URI getURI() {
+ public IRI getURI() {
return uri;
}
- public static GeoPolicy fromURI(final URI uri) {
+ public static GeoPolicy fromURI(final IRI uri) {
for(final GeoPolicy policy : GeoPolicy.values()) {
if(policy.getURI().equals(uri)) {
return policy;
@@ -109,6 +110,7 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
}
static final String TEMPORAL_NS = "tag:rya-rdf.org,2015:temporal#";
+
/**
* Used to indicate which temporal filter functions to use in a query.
*/
@@ -116,62 +118,62 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
/**
* The provided instant in time equals the instant the event took place.
*/
- INSTANT_EQUALS_INSTANT(true, new URIImpl(TEMPORAL_NS+"equals")),
+ INSTANT_EQUALS_INSTANT(true, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"equals")),
/**
* The provided instant in time was before when the event took place.
*/
- INSTANT_BEFORE_INSTANT(true, new URIImpl(TEMPORAL_NS+"before")),
+ INSTANT_BEFORE_INSTANT(true, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"before")),
/**
* The provided instant in time was after when the event took place.
*/
- INSTANT_AFTER_INSTANT(true, new URIImpl(TEMPORAL_NS+"after")),
+ INSTANT_AFTER_INSTANT(true, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"after")),
/**
* The provided instant in time was before a time period.
*/
- INSTANT_BEFORE_INTERVAL(false, new URIImpl(TEMPORAL_NS+"beforeInterval")),
+ INSTANT_BEFORE_INTERVAL(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"beforeInterval")),
/**
* The provided instant in time took place within a set of time.
*/
- INSTANT_IN_INTERVAL(false, new URIImpl(TEMPORAL_NS+"insideInterval")),
+ INSTANT_IN_INTERVAL(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"insideInterval")),
/**
* The provided instant in time took place after a time period.
*/
- INSTANT_AFTER_INTERVAL(false, new URIImpl(TEMPORAL_NS+"afterInterval")),
+ INSTANT_AFTER_INTERVAL(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"afterInterval")),
/**
* The provided instant in time equals the start of the interval in which the event took place.
*/
- INSTANT_START_INTERVAL(false, new URIImpl(TEMPORAL_NS+"hasBeginningInterval")),
+ INSTANT_START_INTERVAL(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"hasBeginningInterval")),
/**
* The provided instant in time equals the end of the interval in which the event took place.
*/
- INSTANT_END_INTERVAL(false, new URIImpl(TEMPORAL_NS+"hasEndInterval")),
+ INSTANT_END_INTERVAL(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"hasEndInterval")),
/**
* The provided interval equals the interval in which the event took place.
*/
- INTERVAL_EQUALS(false, new URIImpl(TEMPORAL_NS+"intervalEquals")),
+ INTERVAL_EQUALS(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"intervalEquals")),
/**
* The provided interval is before the interval in which the event took place.
*/
- INTERVAL_BEFORE(false, new URIImpl(TEMPORAL_NS+"intervalBefore")),
+ INTERVAL_BEFORE(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"intervalBefore")),
/**
* The provided interval is after the interval in which the event took place.
*/
- INTERVAL_AFTER(false, new URIImpl(TEMPORAL_NS+"intervalAfter"));
+ INTERVAL_AFTER(false, SimpleValueFactory.getInstance().createIRI(TEMPORAL_NS+"intervalAfter"));
private final boolean isInstant;
- private final URI uri;
+ private final IRI uri;
- TemporalPolicy(final boolean isInstant, final URI uri) {
+ TemporalPolicy(final boolean isInstant, final IRI uri) {
this.isInstant = isInstant;
this.uri = uri;
}
@@ -180,11 +182,11 @@ public interface GeoTemporalIndexer extends RyaSecondaryIndexer {
return isInstant;
}
- public URI getURI() {
+ public IRI getURI() {
return uri;
}
- public static TemporalPolicy fromURI(final URI uri) {
+ public static TemporalPolicy fromURI(final IRI uri) {
for(final TemporalPolicy policy : TemporalPolicy.values()) {
if(policy.getURI().equals(uri)) {
return policy;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalToSegmentConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalToSegmentConverter.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalToSegmentConverter.java
index 22bfdb1..df9dac9 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalToSegmentConverter.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/GeoTemporalToSegmentConverter.java
@@ -28,9 +28,9 @@ import org.apache.rya.indexing.external.matching.ExternalSetConverter;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.geotemporal.model.EventQueryNode;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
index 104fca8..53d4b74 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
@@ -38,24 +38,26 @@ import org.apache.rya.indexing.entity.query.EntityQueryNode;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.apache.rya.indexing.mongodb.update.RyaObjectStorage.ObjectStorageException;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.iterator.CollectionIteration;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.evaluation.iterator.CollectionIteration;
-import org.openrdf.query.impl.MapBindingSet;
import com.vividsolutions.jts.geom.Geometry;
-import info.aduna.iteration.CloseableIteration;
-
public class EventQueryNode extends ExternalSet implements ExternalBatchingIterator {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private final Collection<FunctionCall> usedFilters;
private final Collection<IndexingExpr> geoFilters;
private final Collection<IndexingExpr> temporalFilters;
@@ -186,7 +188,7 @@ public class EventQueryNode extends ExternalSet implements ExternalBatchingItera
final MapBindingSet resultSet = new MapBindingSet();
if(event.getGeometry().isPresent()) {
final Geometry geo = event.getGeometry().get();
- final Value geoValue = ValueFactoryImpl.getInstance().createLiteral(geo.toText());
+ final Value geoValue = VF.createLiteral(geo.toText());
final Var geoObj = geoPattern.getObjectVar();
resultSet.addBinding(geoObj.getName(), geoValue);
}
@@ -197,9 +199,9 @@ public class EventQueryNode extends ExternalSet implements ExternalBatchingItera
DateTime dt = opt.get().getAsDateTime();
dt = dt.toDateTime(DateTimeZone.UTC);
final String str = dt.toString(TemporalInstantRfc3339.FORMATTER);
- temporalValue = ValueFactoryImpl.getInstance().createLiteral(str);
+ temporalValue = VF.createLiteral(str);
} else if(event.getInterval().isPresent()) {
- temporalValue = ValueFactoryImpl.getInstance().createLiteral(event.getInterval().get().getAsPair());
+ temporalValue = VF.createLiteral(event.getInterval().get().getAsPair());
} else {
temporalValue = null;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
index b029b02..2771749 100644
--- a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
+++ b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoMesaGeoIndexer.java
@@ -49,6 +49,11 @@ import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.StatementSerializer;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.GeoTupleSet.GeoSearchFunctionFactory.NearQuery;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.geotools.data.DataStore;
import org.geotools.data.DataStoreFinder;
import org.geotools.data.DataUtilities;
@@ -71,16 +76,10 @@ import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory;
import org.opengis.filter.identity.Identifier;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
-import info.aduna.iteration.CloseableIteration;
-
/**
* A {@link GeoIndexer} wrapper around a GeoMesa {@link AccumuloDataStore}. This class configures and connects to the Datastore, creates the
* RDF Feature Type, and interacts with the Datastore.
@@ -136,7 +135,7 @@ public class GeoMesaGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
private static final String CONTEXT_ATTRIBUTE = "C";
private static final String GEOMETRY_ATTRIBUTE = Constants.SF_PROPERTY_GEOMETRY;
- private Set<URI> validPredicates;
+ private Set<IRI> validPredicates;
private Configuration conf;
private FeatureStore<SimpleFeatureType, SimpleFeature> featureStore;
private FeatureSource<SimpleFeatureType, SimpleFeature> featureSource;
@@ -306,7 +305,7 @@ public class GeoMesaGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
if (contraints.hasPredicates()) {
final List<String> predicates = new ArrayList<String>();
- for (final URI u : contraints.getPredicates()) {
+ for (final IRI u : contraints.getPredicates()) {
predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + u.stringValue() + "') ");
}
filterParms.add("(" + StringUtils.join(predicates, " OR ") + ")");
@@ -420,7 +419,7 @@ public class GeoMesaGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return validPredicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/geoExamples/RyaGeoDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/geoExamples/RyaGeoDirectExample.java b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/geoExamples/RyaGeoDirectExample.java
index 664bbee..37a008b 100644
--- a/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/geoExamples/RyaGeoDirectExample.java
+++ b/extras/rya.geoindexing/geo.geomesa/src/main/java/org/apache/rya/indexing/geoExamples/RyaGeoDirectExample.java
@@ -28,20 +28,20 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
public class RyaGeoDirectExample {
private static final Logger log = Logger.getLogger(RyaGeoDirectExample.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerSfTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerSfTest.java b/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerSfTest.java
index 4eba96a..b033b03 100644
--- a/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerSfTest.java
+++ b/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerSfTest.java
@@ -36,6 +36,13 @@ import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.GeoIndexerType;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.geotools.geometry.jts.Geometries;
import org.junit.Assert;
import org.junit.Before;
@@ -44,14 +51,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
@@ -67,14 +66,14 @@ import com.vividsolutions.jts.geom.impl.PackedCoordinateSequence;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.gml2.GMLWriter;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Tests all of the "simple functions" of the geoindexer specific to GML.
* Parameterized so that each test is run for WKT and for GML.
*/
@RunWith(value = Parameterized.class)
public class GeoIndexerSfTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private static AccumuloRdfConfiguration conf;
private static GeometryFactory gf = new GeometryFactory(new PrecisionModel(), 4326);
private static GeoMesaGeoIndexer g;
@@ -121,24 +120,24 @@ public class GeoIndexerSfTest {
* JUnit 4 parameterized iterates thru this list and calls the constructor with each.
* For each test, Call the constructor three times, for WKT and for GML encoding 1, and GML encoding 2
*/
- private static final URI USE_JTS_LIB_ENCODING = new URIImpl("uri:useLib") ;
- private static final URI USE_ROUGH_ENCODING = new URIImpl("uri:useRough") ;
+ private static final IRI USE_JTS_LIB_ENCODING = VF.createIRI("uri:useLib") ;
+ private static final IRI USE_ROUGH_ENCODING = VF.createIRI("uri:useRough") ;
@Parameters
- public static Collection<URI[]> constructorData() {
- final URI[][] data = new URI[][] { { GeoConstants.XMLSCHEMA_OGC_WKT, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_ROUGH_ENCODING } };
+ public static Collection<IRI[]> constructorData() {
+ final IRI[][] data = new IRI[][] { { GeoConstants.XMLSCHEMA_OGC_WKT, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_ROUGH_ENCODING } };
return Arrays.asList(data);
}
- private final URI schemaToTest;
- private final URI encodeMethod;
+ private final IRI schemaToTest;
+ private final IRI encodeMethod;
/**
* Constructor required by JUnit parameterized runner. See {@link #constructorData()} for constructor values.
- * @param schemaToTest the schema to test {@link URI}.
- * @param encodeMethod the encode method {@link URI}.
+ * @param schemaToTest the schema to test {@link IRI}.
+ * @param encodeMethod the encode method {@link IRI}.
*/
- public GeoIndexerSfTest(final URI schemaToTest, final URI encodeMethod) {
+ public GeoIndexerSfTest(final IRI schemaToTest, final IRI encodeMethod) {
this.schemaToTest = schemaToTest;
this.encodeMethod = encodeMethod;
}
@@ -185,11 +184,11 @@ public class GeoIndexerSfTest {
g.storeStatement(createRyaStatement(G, schemaToTest, encodeMethod));
}
- private static RyaStatement createRyaStatement(final Geometry geo, final URI schema, final URI encodingMethod) {
+ private static RyaStatement createRyaStatement(final Geometry geo, final IRI schema, final IRI encodingMethod) {
return RdfToRyaConversions.convertStatement(genericStatement(geo,schema,encodingMethod));
}
- private static Statement genericStatement(final Geometry geo, final URI schema, final URI encodingMethod) {
+ private static Statement genericStatement(final Geometry geo, final IRI schema, final IRI encodingMethod) {
if (schema.equals(GeoConstants.XMLSCHEMA_OGC_WKT)) {
return genericStatementWkt(geo);
} else if (schema.equals(GeoConstants.XMLSCHEMA_OGC_GML)) {
@@ -199,17 +198,15 @@ public class GeoIndexerSfTest {
}
private static Statement genericStatementWkt(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:" + NAMES.get(geo));
- final URI predicate = GeoConstants.GEO_AS_WKT;
- final Value object = vf.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
- return new StatementImpl(subject, predicate, object);
+ final Resource subject = VF.createIRI("uri:" + NAMES.get(geo));
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
+ final Value object = VF.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
+ return VF.createStatement(subject, predicate, object);
}
- private static Statement genericStatementGml(final Geometry geo, final URI encodingMethod) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:" + NAMES.get(geo));
- final URI predicate = GeoConstants.GEO_AS_GML;
+ private static Statement genericStatementGml(final Geometry geo, final IRI encodingMethod) {
+ final Resource subject = VF.createIRI("uri:" + NAMES.get(geo));
+ final IRI predicate = GeoConstants.GEO_AS_GML;
final String gml ;
if (encodingMethod == USE_JTS_LIB_ENCODING) {
@@ -224,8 +221,8 @@ public class GeoIndexerSfTest {
// System.out.println("========== GML====");
}
- final Value object = vf.createLiteral(gml, GeoConstants.XMLSCHEMA_OGC_GML);
- return new StatementImpl(subject, predicate, object);
+ final Value object = VF.createLiteral(gml, GeoConstants.XMLSCHEMA_OGC_GML);
+ return VF.createStatement(subject, predicate, object);
}
/**
[04/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
index 45f74ed..666bbd8 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/TransitivePropertyVisitor.java
@@ -20,12 +20,12 @@ package org.apache.rya.rdftriplestore.inference;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.rdftriplestore.utils.TransitivePropertySP;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -45,7 +45,7 @@ public class TransitivePropertyVisitor extends AbstractInferVisitor {
final StatementPattern sp = node.clone();
final Var predVar = sp.getPredicateVar();
- final URI pred = (URI) predVar.getValue();
+ final IRI pred = (IRI) predVar.getValue();
final String predNamespace = pred.getNamespace();
final Var objVar = sp.getObjectVar();
@@ -56,7 +56,7 @@ public class TransitivePropertyVisitor extends AbstractInferVisitor {
!RDFS.NAMESPACE.equals(predNamespace)
&& !EXPANDED.equals(cntxtVar)) {
- final URI transPropUri = (URI) predVar.getValue();
+ final IRI transPropUri = (IRI) predVar.getValue();
if (inferenceEngine.isTransitiveProperty(transPropUri)) {
node.replaceWith(new TransitivePropertySP(sp.getSubjectVar(), sp.getPredicateVar(), sp.getObjectVar(), sp.getContextVar()));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/namespace/NamespaceManager.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/namespace/NamespaceManager.java b/sail/src/main/java/org/apache/rya/rdftriplestore/namespace/NamespaceManager.java
index 3d8526f..86cc991 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/namespace/NamespaceManager.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/namespace/NamespaceManager.java
@@ -1,14 +1,3 @@
-package org.apache.rya.rdftriplestore.namespace;
-
-import java.io.InputStream;
-
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.persist.RdfDAOException;
-import org.apache.rya.api.persist.RyaDAO;
-import org.apache.rya.api.persist.RyaNamespaceManager;
-import org.openrdf.model.Namespace;
-import org.openrdf.sail.SailException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -27,10 +16,18 @@ import org.openrdf.sail.SailException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.rdftriplestore.namespace;
+import java.io.InputStream;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.persist.RdfDAOException;
+import org.apache.rya.api.persist.RyaDAO;
+import org.apache.rya.api.persist.RyaNamespaceManager;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.sail.SailException;
-import info.aduna.iteration.CloseableIteration;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/utils/CombineContextsRdfInserter.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/CombineContextsRdfInserter.java b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/CombineContextsRdfInserter.java
index 6a61201..8a9b9a1 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/CombineContextsRdfInserter.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/CombineContextsRdfInserter.java
@@ -1,5 +1,3 @@
-package org.apache.rya.rdftriplestore.utils;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,19 +16,22 @@ package org.apache.rya.rdftriplestore.utils;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-
-import org.openrdf.OpenRDFUtil;
-import org.openrdf.model.*;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.helpers.RDFHandlerBase;
+package org.apache.rya.rdftriplestore.utils;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.rdf4j.OpenRDFUtil;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
+
/**
* Created by IntelliJ IDEA.
* User: RoshanP
@@ -38,7 +39,7 @@ import java.util.Map;
* Time: 9:50 AM
* To change this template use File | Settings | File Templates.
*/
-public class CombineContextsRdfInserter extends RDFHandlerBase {
+public class CombineContextsRdfInserter extends AbstractRDFHandler {
private final RepositoryConnection con;
private Resource[] contexts = new Resource[0];
@@ -108,7 +109,7 @@ public class CombineContextsRdfInserter extends RDFHandlerBase {
public void handleStatement(Statement st)
throws RDFHandlerException {
Resource subj = st.getSubject();
- URI pred = st.getPredicate();
+ IRI pred = st.getPredicate();
Value obj = st.getObject();
Resource ctxt = st.getContext();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/utils/DefaultStatistics.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/DefaultStatistics.java b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/DefaultStatistics.java
index 94c32d2..a23920a 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/DefaultStatistics.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/DefaultStatistics.java
@@ -19,10 +19,8 @@ package org.apache.rya.rdftriplestore.utils;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
/**
* Class DefaultStatistics
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/utils/FixedStatementPattern.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/FixedStatementPattern.java b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/FixedStatementPattern.java
index ee63213..bcd46fd 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/FixedStatementPattern.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/FixedStatementPattern.java
@@ -21,9 +21,9 @@ package org.apache.rya.rdftriplestore.utils;
import java.util.ArrayList;
import java.util.Collection;
-import org.openrdf.model.Statement;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* StatementPattern gives fixed statements back
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/utils/RdfFormatUtils.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/RdfFormatUtils.java b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/RdfFormatUtils.java
new file mode 100644
index 0000000..78f2335
--- /dev/null
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/RdfFormatUtils.java
@@ -0,0 +1,101 @@
+/*
+ * 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.rya.rdftriplestore.utils;
+
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.eclipse.rdf4j.common.lang.FileFormat;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParserRegistry;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Utility methods for {@link RDFFormat}.
+ */
+public final class RdfFormatUtils {
+ /**
+ * Holds all supported {@link RDFFormat} types.
+ */
+ public static final Set<RDFFormat> RDF_FORMATS = RDFParserRegistry.getInstance().getKeys();
+
+ /**
+ * The set of all supported file extensions from {@link #RDF_FORMATS}.
+ */
+ public static final Set<String> SUPPORTED_FILE_EXTENSIONS = buildSupportedFileExtensions();
+
+ /**
+ * Private constructor to prevent instantiation.
+ */
+ private RdfFormatUtils() {
+ }
+
+ /**
+ * Gets the RDF format whose name matches the specified name.
+ * @param formatName The format name.
+ * @return The {@link RDFFormat} whose name matches the specified name, or
+ * {@code null} if there is no such format.
+ */
+ public static RDFFormat getRdfFormatFromName(final String formatName) {
+ for (final RDFFormat rdfFormat : RDF_FORMATS) {
+ if (rdfFormat.getName().equalsIgnoreCase(formatName)) {
+ return rdfFormat;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Tries to determine the appropriate RDF file format based on the extension
+ * of a file name.
+ * @param fileName A file name.
+ * @return An {@link RDFFormat} object if the file extension was recognized,
+ * or {@code null} otherwise.
+ */
+ public static RDFFormat forFileName(final String fileName) {
+ return forFileName(fileName, null);
+ }
+
+ /**
+ * Tries to determine the appropriate RDF file format based on the extension
+ * of a file name. The supplied fallback format will be returned when the
+ * file name extension was not recognized.
+ * @param fileName A file name.
+ * @return An {@link RDFFormat} that matches the file name extension, or the
+ * fallback format if the extension was not recognized.
+ */
+ public static RDFFormat forFileName(final String fileName, final RDFFormat fallback) {
+ final Optional<RDFFormat> match = FileFormat.matchFileName(fileName, RDF_FORMATS);
+ if (match.isPresent()) {
+ return match.get();
+ } else {
+ return fallback;
+ }
+ }
+
+ /**
+ * @return the set of all supported file extensions from
+ * {@link #RDF_FORMATS}.
+ */
+ private static Set<String> buildSupportedFileExtensions() {
+ return ImmutableSet.copyOf(RDF_FORMATS.stream().flatMap(rdfFormat -> rdfFormat.getFileExtensions().stream()).collect(Collectors.toList()));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/utils/TransitivePropertySP.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/TransitivePropertySP.java b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/TransitivePropertySP.java
index 9cdb113..89e2d90 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/utils/TransitivePropertySP.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/utils/TransitivePropertySP.java
@@ -19,10 +19,8 @@ package org.apache.rya.rdftriplestore.utils;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Class TransitivePropertySP
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/ArbitraryLengthQueryTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/ArbitraryLengthQueryTest.java b/sail/src/test/java/org/apache/rya/ArbitraryLengthQueryTest.java
index 3b6056f..e4e3fb6 100644
--- a/sail/src/test/java/org/apache/rya/ArbitraryLengthQueryTest.java
+++ b/sail/src/test/java/org/apache/rya/ArbitraryLengthQueryTest.java
@@ -19,8 +19,6 @@ package org.apache.rya;
* under the License.
*/
-
-
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -28,25 +26,23 @@ import java.io.InputStream;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.mock.MockInstance;
-import org.openrdf.model.Resource;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.resultio.text.tsv.SPARQLResultsTSVWriter;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParseException;
+
import junit.framework.TestCase;
/**
@@ -160,12 +156,12 @@ public class ArbitraryLengthQueryTest extends TestCase {
// T-Box
String ttlString = MODEL_TTL;
InputStream stringInput = new ByteArrayInputStream(ttlString.getBytes());
- conn.add(stringInput, "http://dragon-research.com/cham/model/model1", RDFFormat.TURTLE, new Resource[]{});
+ conn.add(stringInput, "http://dragon-research.com/cham/model/model1", RDFFormat.TURTLE);
// A-Box
ttlString = BUCKET_TTL;
stringInput = new ByteArrayInputStream(ttlString.getBytes());
- conn.add(stringInput, "http://dragon-research.com/cham/bucket/bucket1", RDFFormat.TURTLE, new Resource[]{});
+ conn.add(stringInput, "http://dragon-research.com/cham/bucket/bucket1", RDFFormat.TURTLE);
conn.commit();
conn.close();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/HashJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/HashJoinTest.java b/sail/src/test/java/org/apache/rya/HashJoinTest.java
index f011d00..e0463c9 100644
--- a/sail/src/test/java/org/apache/rya/HashJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/HashJoinTest.java
@@ -19,10 +19,15 @@ package org.apache.rya;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import java.util.HashSet;
+import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
-import junit.framework.TestCase;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
@@ -31,19 +36,11 @@ import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.HashJoin;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.mock.MockInstance;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import java.util.HashSet;
-import java.util.Set;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
/**
* Date: 7/24/12
* Time: 5:51 PM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/IterativeJoinTest.java b/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
index c84919e..8e40e2d 100644
--- a/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/IterativeJoinTest.java
@@ -19,10 +19,15 @@ package org.apache.rya;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import java.util.HashSet;
+import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
-import junit.framework.TestCase;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
@@ -31,17 +36,11 @@ import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.IterativeJoin;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.mock.MockInstance;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import java.util.HashSet;
-import java.util.Set;
-
-import static junit.framework.Assert.*;
-
/**
* Date: 7/24/12
* Time: 5:51 PM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/MergeJoinTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/MergeJoinTest.java b/sail/src/test/java/org/apache/rya/MergeJoinTest.java
index d7ac948..efc44c3 100644
--- a/sail/src/test/java/org/apache/rya/MergeJoinTest.java
+++ b/sail/src/test/java/org/apache/rya/MergeJoinTest.java
@@ -19,29 +19,28 @@ package org.apache.rya;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import java.util.HashSet;
+import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreUtils.CustomEntry;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.join.MergeJoin;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.mock.MockInstance;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
-import java.util.HashSet;
-import java.util.Set;
-
-import static junit.framework.Assert.*;
-import static org.apache.rya.api.RdfCloudTripleStoreUtils.CustomEntry;
-
/**
* TODO: Move to rya.api when we have proper mock ryaDao
*
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
index 8c926db..d40972c 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreConnectionTest.java
@@ -34,31 +34,28 @@ import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Model;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryResult;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.Rio;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Model;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryResult;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.Rio;
import junit.framework.TestCase;
@@ -69,11 +66,11 @@ import junit.framework.TestCase;
*/
public class RdfCloudTripleStoreConnectionTest extends TestCase {
private Repository repository;
- ValueFactoryImpl vf = new ValueFactoryImpl();
+ private static final SimpleValueFactory VF = SimpleValueFactory.getInstance();
private InferenceEngine internalInferenceEngine;
static String litdupsNS = "urn:test:litdups#";
- URI cpu = vf.createURI(litdupsNS, "cpu");
+ IRI cpu = VF.createIRI(litdupsNS, "cpu");
protected RdfCloudTripleStore store;
@Override
@@ -97,8 +94,8 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testAddStatement() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
@@ -115,7 +112,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
conn.remove(cpu, loadPerc, uri1);
// //test removal
- result = conn.getStatements(cpu, loadPerc, null, true, new Resource[0]);
+ result = conn.getStatements(cpu, loadPerc, null, true);
count = 0;
while (result.hasNext()) {
count++;
@@ -129,14 +126,14 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
// public void testAddAuth() throws Exception {
// RepositoryConnection conn = repository.getConnection();
-// URI cpu = vf.createURI(litdupsNS, "cpu");
-// URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-// URI uri1 = vf.createURI(litdupsNS, "uri1");
-// URI uri2 = vf.createURI(litdupsNS, "uri2");
-// URI uri3 = vf.createURI(litdupsNS, "uri3");
-// URI auth1 = vf.createURI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
-// URI auth2 = vf.createURI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "2");
-// URI auth3 = vf.createURI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "3");
+// URI cpu = vf.createIRI(litdupsNS, "cpu");
+// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// URI uri1 = vf.createIRI(litdupsNS, "uri1");
+// URI uri2 = vf.createIRI(litdupsNS, "uri2");
+// URI uri3 = vf.createIRI(litdupsNS, "uri3");
+// URI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
+// URI auth2 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "2");
+// URI auth3 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "3");
// conn.add(cpu, loadPerc, uri1, auth1, auth2, auth3);
// conn.add(cpu, loadPerc, uri2, auth2, auth3);
// conn.add(cpu, loadPerc, uri3, auth3);
@@ -166,8 +163,8 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testEvaluate() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
@@ -183,10 +180,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testEvaluateMultiLine() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
- URI pred2 = vf.createURI(litdupsNS, "pred2");
- URI uri2 = vf.createURI(litdupsNS, "uri2");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
+ IRI pred2 = VF.createIRI(litdupsNS, "pred2");
+ IRI uri2 = VF.createIRI(litdupsNS, "uri2");
conn.add(cpu, loadPerc, uri1);
conn.add(cpu, pred2, uri2);
conn.commit();
@@ -205,10 +202,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testPOObjRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc, sev);
conn.add(cpu, loadPerc, ten);
@@ -228,13 +225,13 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testPOPredRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc1");
- URI loadPerc2 = vf.createURI(litdupsNS, "loadPerc2");
- URI loadPerc3 = vf.createURI(litdupsNS, "loadPerc3");
- URI loadPerc4 = vf.createURI(litdupsNS, "loadPerc4");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc1");
+ IRI loadPerc2 = VF.createIRI(litdupsNS, "loadPerc2");
+ IRI loadPerc3 = VF.createIRI(litdupsNS, "loadPerc3");
+ IRI loadPerc4 = VF.createIRI(litdupsNS, "loadPerc4");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc2, sev);
conn.add(cpu, loadPerc4, ten);
@@ -254,13 +251,13 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testSPOPredRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc1");
- URI loadPerc2 = vf.createURI(litdupsNS, "loadPerc2");
- URI loadPerc3 = vf.createURI(litdupsNS, "loadPerc3");
- URI loadPerc4 = vf.createURI(litdupsNS, "loadPerc4");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc1");
+ IRI loadPerc2 = VF.createIRI(litdupsNS, "loadPerc2");
+ IRI loadPerc3 = VF.createIRI(litdupsNS, "loadPerc3");
+ IRI loadPerc4 = VF.createIRI(litdupsNS, "loadPerc4");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc2, sev);
conn.add(cpu, loadPerc4, ten);
@@ -280,12 +277,12 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testSPOSubjRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI cpu2 = vf.createURI(litdupsNS, "cpu2");
- URI cpu3 = vf.createURI(litdupsNS, "cpu3");
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI cpu2 = VF.createIRI(litdupsNS, "cpu2");
+ IRI cpu3 = VF.createIRI(litdupsNS, "cpu3");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu2, loadPerc, sev);
conn.add(cpu3, loadPerc, ten);
@@ -305,10 +302,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testSPOObjRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc, sev);
conn.add(cpu, loadPerc, ten);
@@ -328,10 +325,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testOSPObjRange() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc, sev);
conn.add(cpu, loadPerc, ten);
@@ -351,11 +348,11 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testRegexFilter() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI testClass = vf.createURI(litdupsNS, "test");
- Literal six = vf.createLiteral("6");
- Literal sev = vf.createLiteral("7");
- Literal ten = vf.createLiteral("10");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI testClass = VF.createIRI(litdupsNS, "test");
+ Literal six = VF.createLiteral("6");
+ Literal sev = VF.createLiteral("7");
+ Literal ten = VF.createLiteral("10");
conn.add(cpu, loadPerc, six);
conn.add(cpu, loadPerc, sev);
conn.add(cpu, loadPerc, ten);
@@ -376,12 +373,12 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testMMRTS152() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "testPred");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
+ IRI loadPerc = VF.createIRI(litdupsNS, "testPred");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
- RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, false, new Resource[0]);
+ RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, false);
// RdfCloudTripleStoreCollectionStatementsIterator iterator = new RdfCloudTripleStoreCollectionStatementsIterator(
// cpu, loadPerc, null, store.connector,
// vf, new Configuration(), null);
@@ -397,17 +394,17 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testDuplicateLiterals() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- Literal lit1 = vf.createLiteral(0.0);
- Literal lit2 = vf.createLiteral(0.0);
- Literal lit3 = vf.createLiteral(0.0);
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ Literal lit1 = VF.createLiteral(0.0);
+ Literal lit2 = VF.createLiteral(0.0);
+ Literal lit3 = VF.createLiteral(0.0);
conn.add(cpu, loadPerc, lit1);
conn.add(cpu, loadPerc, lit2);
conn.add(cpu, loadPerc, lit3);
conn.commit();
- RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, true, new Resource[0]);
+ RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, true);
int count = 0;
while (result.hasNext()) {
count++;
@@ -424,17 +421,17 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testNotDuplicateUris() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
- URI uri2 = vf.createURI(litdupsNS, "uri1");
- URI uri3 = vf.createURI(litdupsNS, "uri1");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
+ IRI uri2 = VF.createIRI(litdupsNS, "uri1");
+ IRI uri3 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.add(cpu, loadPerc, uri2);
conn.add(cpu, loadPerc, uri3);
conn.commit();
- RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, true, new Resource[0]);
+ RepositoryResult<Statement> result = conn.getStatements(cpu, loadPerc, null, true);
int count = 0;
while (result.hasNext()) {
count++;
@@ -451,8 +448,8 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
public void testNamespaceUsage() throws Exception {
RepositoryConnection conn = repository.getConnection();
conn.setNamespace("lit", litdupsNS);
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- final URI uri1 = vf.createURI(litdupsNS, "uri1");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ final IRI uri1 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
@@ -493,13 +490,13 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "degreeFrom")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "degreeFrom")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "memberOf")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "associatedWith")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), vf.createURI(litdupsNS, "undergradDegreeFrom"), vf.createURI(litdupsNS, "Harvard")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradB"), vf.createURI(litdupsNS, "gradDegreeFrom"), vf.createURI(litdupsNS, "Yale")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "ProfessorC"), vf.createURI(litdupsNS, "memberOf"), vf.createURI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, VF.createIRI(litdupsNS, "degreeFrom")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, VF.createIRI(litdupsNS, "degreeFrom")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, VF.createIRI(litdupsNS, "memberOf")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, VF.createIRI(litdupsNS, "associatedWith")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "UgradA"), VF.createIRI(litdupsNS, "undergradDegreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "GradB"), VF.createIRI(litdupsNS, "gradDegreeFrom"), VF.createIRI(litdupsNS, "Yale")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "ProfessorC"), VF.createIRI(litdupsNS, "memberOf"), VF.createIRI(litdupsNS, "Harvard")));
conn.commit();
conn.close();
@@ -557,10 +554,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "undergradDegreeFrom"), OWL.EQUIVALENTPROPERTY, vf.createURI(litdupsNS, "ugradDegreeFrom")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), vf.createURI(litdupsNS, "undergradDegreeFrom"), vf.createURI(litdupsNS, "Harvard")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradB"), vf.createURI(litdupsNS, "ugradDegreeFrom"), vf.createURI(litdupsNS, "Harvard")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradC"), vf.createURI(litdupsNS, "ugraduateDegreeFrom"), vf.createURI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "undergradDegreeFrom"), OWL.EQUIVALENTPROPERTY, VF.createIRI(litdupsNS, "ugradDegreeFrom")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "UgradA"), VF.createIRI(litdupsNS, "undergradDegreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "GradB"), VF.createIRI(litdupsNS, "ugradDegreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "GradC"), VF.createIRI(litdupsNS, "ugraduateDegreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
conn.commit();
conn.close();
@@ -588,9 +585,9 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "Bob"), vf.createURI(litdupsNS, "friendOf"), vf.createURI(litdupsNS, "Jeff")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "James"), vf.createURI(litdupsNS, "friendOf"), vf.createURI(litdupsNS, "Jeff")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "Bob"), VF.createIRI(litdupsNS, "friendOf"), VF.createIRI(litdupsNS, "Jeff")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "James"), VF.createIRI(litdupsNS, "friendOf"), VF.createIRI(litdupsNS, "Jeff")));
conn.commit();
conn.close();
@@ -638,12 +635,12 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "Queens"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NYC")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "NYC"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NY")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "NY"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "US")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "US"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NorthAmerica")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "NorthAmerica"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "World")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "Queens"), VF.createIRI(litdupsNS, "subRegionOf"), VF.createIRI(litdupsNS, "NYC")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "NYC"), VF.createIRI(litdupsNS, "subRegionOf"), VF.createIRI(litdupsNS, "NY")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "NY"), VF.createIRI(litdupsNS, "subRegionOf"), VF.createIRI(litdupsNS, "US")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "US"), VF.createIRI(litdupsNS, "subRegionOf"), VF.createIRI(litdupsNS, "NorthAmerica")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "NorthAmerica"), VF.createIRI(litdupsNS, "subRegionOf"), VF.createIRI(litdupsNS, "World")));
conn.commit();
conn.close();
@@ -701,10 +698,10 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, vf.createURI(litdupsNS, "hasAlumnus")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), vf.createURI(litdupsNS, "degreeFrom"), vf.createURI(litdupsNS, "Harvard")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradB"), vf.createURI(litdupsNS, "degreeFrom"), vf.createURI(litdupsNS, "Harvard")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "Harvard"), vf.createURI(litdupsNS, "hasAlumnus"), vf.createURI(litdupsNS, "AlumC")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, VF.createIRI(litdupsNS, "hasAlumnus")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "UgradA"), VF.createIRI(litdupsNS, "degreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "GradB"), VF.createIRI(litdupsNS, "degreeFrom"), VF.createIRI(litdupsNS, "Harvard")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "Harvard"), VF.createIRI(litdupsNS, "hasAlumnus"), VF.createIRI(litdupsNS, "AlumC")));
conn.commit();
conn.close();
@@ -742,11 +739,11 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, vf.createURI(litdupsNS, "Student")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "Student"), RDFS.SUBCLASSOF, vf.createURI(litdupsNS, "Person")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), RDF.TYPE, vf.createURI(litdupsNS, "UndergraduateStudent")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentB"), RDF.TYPE, vf.createURI(litdupsNS, "Student")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "PersonC"), RDF.TYPE, vf.createURI(litdupsNS, "Person")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, VF.createIRI(litdupsNS, "Student")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "Student"), RDFS.SUBCLASSOF, VF.createIRI(litdupsNS, "Person")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "UgradA"), RDF.TYPE, VF.createIRI(litdupsNS, "UndergraduateStudent")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentB"), RDF.TYPE, VF.createIRI(litdupsNS, "Student")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "PersonC"), RDF.TYPE, VF.createIRI(litdupsNS, "Person")));
conn.commit();
conn.close();
@@ -755,7 +752,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
conn = repository.getConnection();
//simple api first
- RepositoryResult<Statement> person = conn.getStatements(null, RDF.TYPE, vf.createURI(litdupsNS, "Person"), true);
+ RepositoryResult<Statement> person = conn.getStatements(null, RDF.TYPE, VF.createIRI(litdupsNS, "Person"), true);
int count = 0;
while (person.hasNext()) {
count++;
@@ -804,12 +801,12 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
}
RepositoryConnection conn = repository.getConnection();
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentA1"), OWL.SAMEAS, vf.createURI(litdupsNS, "StudentA2")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentA2"), OWL.SAMEAS, vf.createURI(litdupsNS, "StudentA3")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentB1"), OWL.SAMEAS, vf.createURI(litdupsNS, "StudentB2")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentB2"), OWL.SAMEAS, vf.createURI(litdupsNS, "StudentB3")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentA1"), vf.createURI(litdupsNS, "pred1"), vf.createURI(litdupsNS, "StudentB3")));
- conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentB1"), vf.createURI(litdupsNS, "pred2"), vf.createURI(litdupsNS, "StudentA3")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentA1"), OWL.SAMEAS, VF.createIRI(litdupsNS, "StudentA2")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentA2"), OWL.SAMEAS, VF.createIRI(litdupsNS, "StudentA3")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentB1"), OWL.SAMEAS, VF.createIRI(litdupsNS, "StudentB2")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentB2"), OWL.SAMEAS, VF.createIRI(litdupsNS, "StudentB3")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentA1"), VF.createIRI(litdupsNS, "pred1"), VF.createIRI(litdupsNS, "StudentB3")));
+ conn.add(VF.createStatement(VF.createIRI(litdupsNS, "StudentB1"), VF.createIRI(litdupsNS, "pred2"), VF.createIRI(litdupsNS, "StudentA3")));
conn.commit();
conn.close();
@@ -963,7 +960,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
conn.add(stream, "", RDFFormat.TRIG);
conn.commit();
- RepositoryResult<Statement> statements = conn.getStatements(null, vf.createURI("http://www.example.org/vocabulary#name"), null, true, vf.createURI("http://www.example.org/exampleDocument#G1"));
+ RepositoryResult<Statement> statements = conn.getStatements(null, VF.createIRI("http://www.example.org/vocabulary#name"), null, true, VF.createIRI("http://www.example.org/exampleDocument#G1"));
int count = 0;
while (statements.hasNext()) {
statements.next();
@@ -978,7 +975,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
// public void testNamedGraphLoadWInlineAuth() throws Exception {
// InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("namedgraphs.trig");
// assertNotNull(stream);
-// URI auth1 = vf.createURI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
+// URI auth1 = vf.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "1");
// RepositoryConnection conn = repository.getConnection();
// conn.add(stream, "", RDFFormat.TRIG, auth1);
// conn.commit();
@@ -1036,7 +1033,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
// }
private static String escape(Value r) {
- if (r instanceof URI) {
+ if (r instanceof IRI) {
return "<" + r.toString() +">";
}
return r.toString();
@@ -1107,7 +1104,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
" } .\n" +
"}";
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
- tupleQuery.setBinding(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, vf.createLiteral("2"));
+ tupleQuery.setBinding(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, VF.createLiteral("2"));
CountTupleHandler tupleHandler = new CountTupleHandler();
tupleQuery.evaluate(tupleHandler);
assertEquals(1, tupleHandler.getCount());
@@ -1157,7 +1154,7 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
" } .\n" +
"}";
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
- tupleQuery.setBinding(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, vf.createLiteral("2"));
+ tupleQuery.setBinding(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, VF.createLiteral("2"));
CountTupleHandler tupleHandler = new CountTupleHandler();
tupleQuery.evaluate(tupleHandler);
assertEquals(1, tupleHandler.getCount());
@@ -1287,12 +1284,12 @@ public class RdfCloudTripleStoreConnectionTest extends TestCase {
assertEquals(4, tupleHandler.getCount());
tupleHandler = new CountTupleHandler();
- conn.clear(new URIImpl("http://example/addresses#G2"));
+ conn.clear(VF.createIRI("http://example/addresses#G2"));
tupleQuery.evaluate(tupleHandler);
assertEquals(2, tupleHandler.getCount());
tupleHandler = new CountTupleHandler();
- conn.clear(new URIImpl("http://example/addresses#G1"));
+ conn.clear(VF.createIRI("http://example/addresses#G1"));
tupleQuery.evaluate(tupleHandler);
assertEquals(0, tupleHandler.getCount());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreTest.java
index fa8e6f5..99d400d 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,32 +16,36 @@ package org.apache.rya;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya;
+import java.util.GregorianCalendar;
+import java.util.List;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
-import junit.framework.TestCase;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.mock.MockInstance;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.*;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.RepositoryResult;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.RepositoryResult;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-import java.util.GregorianCalendar;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import junit.framework.TestCase;
/**
* Class PartitionConnectionTest
@@ -59,7 +61,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
private SailRepository repository;
private SailRepositoryConnection connection;
- ValueFactory vf = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private String objectUuid = "objectuuid1";
private String ancestor = "ancestor1";
@@ -90,113 +92,113 @@ public class RdfCloudTripleStoreTest extends TestCase {
}
private void loadData() throws RepositoryException, DatatypeConfigurationException {
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, objectUuid), vf.createURI(NAMESPACE, "name"), vf.createLiteral("objUuid")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, objectUuid), VF.createIRI(NAMESPACE, "name"), VF.createLiteral("objUuid")));
//created
String uuid = "uuid1";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Created")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "createdItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:A")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "stringLit"), vf.createLiteral("stringLit1")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "stringLit"), vf.createLiteral("stringLit2")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "stringLit"), vf.createLiteral("stringLit3")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "stringLit"), vf.createLiteral("stringLit4")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "strLit1"), vf.createLiteral("strLit1")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "strLit1"), vf.createLiteral("strLit2")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "strLit1"), vf.createLiteral("strLit3")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 0, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 1, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Created")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "createdItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:A")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "stringLit"), VF.createLiteral("stringLit1")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "stringLit"), VF.createLiteral("stringLit2")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "stringLit"), VF.createLiteral("stringLit3")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "stringLit"), VF.createLiteral("stringLit4")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "strLit1"), VF.createLiteral("strLit1")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "strLit1"), VF.createLiteral("strLit2")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "strLit1"), VF.createLiteral("strLit3")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 0, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 1, 0, 0, 0))));
//clicked
uuid = "uuid2";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Clicked")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "clickedItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:B")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 2, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 3, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Clicked")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "clickedItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:B")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 2, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 3, 0, 0, 0))));
//deleted
uuid = "uuid3";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Deleted")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "deletedItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:C")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 4, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 5, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Deleted")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "deletedItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:C")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 4, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 5, 0, 0, 0))));
//dropped
uuid = "uuid4";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Dropped")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "droppedItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:D")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 6, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 7, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Dropped")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "droppedItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:D")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 6, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 7, 0, 0, 0))));
//received
uuid = "uuid5";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Received")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "receivedItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:E")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 8, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 9, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Received")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "receivedItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:E")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 8, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 9, 0, 0, 0))));
//sent
uuid = "uuid6";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Sent")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "sentItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:F")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 10, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 11, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Sent")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "sentItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:F")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 10, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 11, 0, 0, 0))));
//stored
uuid = "uuid7";
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(RDF_NS, "type"), vf.createURI(NAMESPACE, "Stored")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "storedItem"), vf.createURI(NAMESPACE, objectUuid)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedBy"), vf.createURI("urn:system:G")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "performedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 12, 0, 0, 0))));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, uuid), vf.createURI(NAMESPACE, "reportedAt"), vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 13, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(NAMESPACE, "Stored")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "storedItem"), VF.createIRI(NAMESPACE, objectUuid)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedBy"), VF.createIRI("urn:system:G")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "performedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 12, 0, 0, 0))));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, uuid), VF.createIRI(NAMESPACE, "reportedAt"), VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(2011, 7, 12, 6, 13, 0, 0, 0))));
//derivedFrom
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, descendant), vf.createURI(NAMESPACE, "derivedFrom"), vf.createURI(NAMESPACE, ancestor)));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, descendant), vf.createURI(NAMESPACE, "name"), vf.createLiteral("descendantOne")));
- connection.add(new StatementImpl(vf.createURI(NAMESPACE, ancestor), vf.createURI(NAMESPACE, "name"), vf.createLiteral("ancestor1")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, descendant), VF.createIRI(NAMESPACE, "derivedFrom"), VF.createIRI(NAMESPACE, ancestor)));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, descendant), VF.createIRI(NAMESPACE, "name"), VF.createLiteral("descendantOne")));
+ connection.add(VF.createStatement(VF.createIRI(NAMESPACE, ancestor), VF.createIRI(NAMESPACE, "name"), VF.createLiteral("ancestor1")));
//heartbeats
String hbuuid = "hbuuid1";
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(RDF_NS, "type"), vf.createURI(HBNAMESPACE, "HeartbeatMeasurement")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HB_TIMESTAMP), vf.createLiteral((START + 1) + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "count"), vf.createLiteral(1 + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "systemName"), vf.createURI("urn:system:A")));
- connection.add(new StatementImpl(vf.createURI("urn:system:A"), vf.createURI(HBNAMESPACE, "heartbeat"), vf.createURI(HBNAMESPACE, hbuuid)));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(HBNAMESPACE, "HeartbeatMeasurement")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HB_TIMESTAMP), VF.createLiteral((START + 1) + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "count"), VF.createLiteral(1 + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "systemName"), VF.createIRI("urn:system:A")));
+ connection.add(VF.createStatement(VF.createIRI("urn:system:A"), VF.createIRI(HBNAMESPACE, "heartbeat"), VF.createIRI(HBNAMESPACE, hbuuid)));
hbuuid = "hbuuid2";
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(RDF_NS, "type"), vf.createURI(HBNAMESPACE, "HeartbeatMeasurement")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HB_TIMESTAMP), vf.createLiteral((START + 2) + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "count"), vf.createLiteral(2 + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "systemName"), vf.createURI("urn:system:B")));
- connection.add(new StatementImpl(vf.createURI("urn:system:B"), vf.createURI(HBNAMESPACE, "heartbeat"), vf.createURI(HBNAMESPACE, hbuuid)));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(HBNAMESPACE, "HeartbeatMeasurement")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HB_TIMESTAMP), VF.createLiteral((START + 2) + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "count"), VF.createLiteral(2 + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "systemName"), VF.createIRI("urn:system:B")));
+ connection.add(VF.createStatement(VF.createIRI("urn:system:B"), VF.createIRI(HBNAMESPACE, "heartbeat"), VF.createIRI(HBNAMESPACE, hbuuid)));
hbuuid = "hbuuid3";
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(RDF_NS, "type"), vf.createURI(HBNAMESPACE, "HeartbeatMeasurement")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HB_TIMESTAMP), vf.createLiteral((START + 3) + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "count"), vf.createLiteral(3 + "")));
- connection.add(new StatementImpl(vf.createURI(HBNAMESPACE, hbuuid), vf.createURI(HBNAMESPACE, "systemName"), vf.createURI("urn:system:C")));
- connection.add(new StatementImpl(vf.createURI("urn:system:C"), vf.createURI(HBNAMESPACE, "heartbeat"), vf.createURI(HBNAMESPACE, hbuuid)));
-
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral("obj1")));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral("obj2")));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral("obj3")));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral("obj4")));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral("obj1")));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral("obj2")));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral("obj3")));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral("obj4")));
- connection.add(new StatementImpl(vf.createURI("urn:subj3"), vf.createURI("urn:pred"), vf.createLiteral("obj1")));
- connection.add(new StatementImpl(vf.createURI("urn:subj3"), vf.createURI("urn:pred"), vf.createLiteral("obj4")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(RDF_NS, "type"), VF.createIRI(HBNAMESPACE, "HeartbeatMeasurement")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HB_TIMESTAMP), VF.createLiteral((START + 3) + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "count"), VF.createLiteral(3 + "")));
+ connection.add(VF.createStatement(VF.createIRI(HBNAMESPACE, hbuuid), VF.createIRI(HBNAMESPACE, "systemName"), VF.createIRI("urn:system:C")));
+ connection.add(VF.createStatement(VF.createIRI("urn:system:C"), VF.createIRI(HBNAMESPACE, "heartbeat"), VF.createIRI(HBNAMESPACE, hbuuid)));
+
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral("obj1")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral("obj2")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral("obj3")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral("obj4")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral("obj1")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral("obj2")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral("obj3")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral("obj4")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj3"), VF.createIRI("urn:pred"), VF.createLiteral("obj1")));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj3"), VF.createIRI("urn:pred"), VF.createLiteral("obj4")));
//Foreign Chars
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_SIM)));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_TRAD)));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral(FAN_TH)));
- connection.add(new StatementImpl(vf.createURI("urn:subj1"), vf.createURI("urn:pred"), vf.createLiteral(FAN_RN)));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_SIM)));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_TRAD)));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral(FAN_TH)));
- connection.add(new StatementImpl(vf.createURI("urn:subj2"), vf.createURI("urn:pred"), vf.createLiteral(FAN_RN)));
- connection.add(new StatementImpl(vf.createURI("urn:subj3"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_SIM)));
- connection.add(new StatementImpl(vf.createURI("urn:subj3"), vf.createURI("urn:pred"), vf.createLiteral(FAN_CH_TRAD)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_SIM)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_TRAD)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_TH)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj1"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_RN)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_SIM)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_TRAD)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_TH)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj2"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_RN)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj3"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_SIM)));
+ connection.add(VF.createStatement(VF.createIRI("urn:subj3"), VF.createIRI("urn:pred"), VF.createLiteral(FAN_CH_TRAD)));
connection.commit();
}
@@ -217,7 +219,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTimeInMillis(ts);
//"2011-07-12T05:12:00.000Z"^^xsd:dateTime
- return "\"" + vf.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar)).stringValue() + "\"^^xsd:dateTime";
+ return "\"" + VF.createLiteral(DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar)).stringValue() + "\"^^xsd:dateTime";
}
// public void testScanAll() throws Exception {
@@ -263,7 +265,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
}
public void testAddCommitStatement() throws Exception {
- StatementImpl stmt = new StatementImpl(vf.createURI("urn:namespace#subj"), vf.createURI("urn:namespace#pred"), vf.createLiteral("object"));
+ Statement stmt = VF.createStatement(VF.createIRI("urn:namespace#subj"), VF.createIRI("urn:namespace#pred"), VF.createLiteral("object"));
connection.add(stmt);
connection.commit();
}
@@ -404,7 +406,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
TupleQuery tupleQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, query);
// tupleQuery.setBinding(START_BINDING, vf.createLiteral(START));
// tupleQuery.setBinding(END_BINDING, vf.createLiteral(END));
-// tupleQuery.setBinding(TIME_PREDICATE, vf.createURI(NAMESPACE, "performedAt"));
+// tupleQuery.setBinding(TIME_PREDICATE, vf.createIRI(NAMESPACE, "performedAt"));
// tupleQuery.evaluate(new PrintTupleHandler());
CountTupleHandler tupleHandler = new CountTupleHandler();
tupleQuery.evaluate(tupleHandler);
@@ -464,7 +466,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
TupleQuery tupleQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, query);
// tupleQuery.setBinding(START_BINDING, vf.createLiteral(START));
// tupleQuery.setBinding(END_BINDING, vf.createLiteral(END));
-// tupleQuery.setBinding(TIME_PREDICATE, vf.createURI(NAMESPACE, "performedAt"));
+// tupleQuery.setBinding(TIME_PREDICATE, vf.createIRI(NAMESPACE, "performedAt"));
// tupleQuery.evaluate(new PrintTupleHandler());
CountTupleHandler tupleHandler = new CountTupleHandler();
tupleQuery.evaluate(tupleHandler);
@@ -494,7 +496,7 @@ public class RdfCloudTripleStoreTest extends TestCase {
TupleQuery tupleQuery = connection.prepareTupleQuery(QueryLanguage.SPARQL, query);
// tupleQuery.setBinding(START_BINDING, vf.createLiteral(START));
// tupleQuery.setBinding(END_BINDING, vf.createLiteral(END));
-// tupleQuery.setBinding(TIME_PREDICATE, vf.createURI(NAMESPACE, "performedAt"));
+// tupleQuery.setBinding(TIME_PREDICATE, vf.createIRI(NAMESPACE, "performedAt"));
// tupleQuery.evaluate(new PrintTupleHandler());
CountTupleHandler tupleHandler = new CountTupleHandler();
tupleQuery.evaluate(tupleHandler);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
index c80c6c4..b1ba3fc 100644
--- a/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
+++ b/sail/src/test/java/org/apache/rya/RdfCloudTripleStoreUtilsTest.java
@@ -24,11 +24,11 @@
//
//import junit.framework.TestCase;
//
-//import org.openrdf.model.BNode;
-//import org.openrdf.model.Resource;
-//import org.openrdf.model.URI;
-//import org.openrdf.model.Value;
-//import org.openrdf.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.BNode;
+//import org.eclipse.rdf4j.model.Resource;
+//import org.eclipse.rdf4j.model.IRI;
+//import org.eclipse.rdf4j.model.Value;
+//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
//
//import com.google.common.io.ByteStreams;
//
@@ -37,8 +37,8 @@
//public class RdfCloudTripleStoreUtilsTest extends TestCase {
//
// public void testWriteReadURI() throws Exception {
-// final ValueFactoryImpl vf = new ValueFactoryImpl();
-// URI uri = vf.createURI("http://www.example.org/test/rel");
+// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
+// URI uri = vf.createIRI("http://www.example.org/test/rel");
// byte[] value = writeValue(uri);
//
// Value readValue = readValue(ByteStreams
@@ -47,7 +47,7 @@
// }
//
// public void testWriteReadBNode() throws Exception {
-// final ValueFactoryImpl vf = new ValueFactoryImpl();
+// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
// Value val = vf.createBNode("bnodeid");
// byte[] value = writeValue(val);
//
@@ -57,7 +57,7 @@
// }
//
// public void testWriteReadLiteral() throws Exception {
-// final ValueFactoryImpl vf = new ValueFactoryImpl();
+// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
// Value val = vf.createLiteral("myliteral");
// byte[] value = writeValue(val);
//
@@ -67,7 +67,7 @@
// }
//
// public void testContexts() throws Exception {
-// final ValueFactoryImpl vf = new ValueFactoryImpl();
+// final ValueFactoryImpl vf = SimpleValueFactory.getInstance();
// BNode cont1 = vf.createBNode("cont1");
// BNode cont2 = vf.createBNode("cont2");
// BNode cont3 = vf.createBNode("cont3");
[18/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerTest.java b/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerTest.java
index 0077c29..d52a3f1 100644
--- a/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerTest.java
+++ b/extras/rya.geoindexing/geo.geomesa/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoIndexerTest.java
@@ -33,14 +33,12 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.collect.Sets;
import com.vividsolutions.jts.geom.Coordinate;
@@ -95,30 +93,30 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Point point = gf.createPoint(new Coordinate(10, 10));
final Value pointValue = vf.createLiteral("Point(10 10)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final URI invalidPredicate = GeoConstants.GEO_AS_WKT;
+ final IRI invalidPredicate = GeoConstants.GEO_AS_WKT;
// These should not be stored because they are not in the predicate list
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), invalidPredicate, pointValue)));
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), invalidPredicate, pointValue)));
- final URI pred1 = vf.createURI("pred:1");
- final URI pred2 = vf.createURI("pred:2");
+ final IRI pred1 = vf.createIRI("pred:1");
+ final IRI pred2 = vf.createIRI("pred:2");
// These should be stored because they are in the predicate list
- final Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1, pointValue);
- final Statement s4 = new StatementImpl(vf.createURI("foo:subj4"), pred2, pointValue);
+ final Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1, pointValue);
+ final Statement s4 = vf.createStatement(vf.createIRI("foo:subj4"), pred2, pointValue);
f.storeStatement(convertStatement(s3));
f.storeStatement(convertStatement(s4));
// This should not be stored because the object is not valid wkt
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
// This should not be stored because the object is not a literal
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj6"), pred1, vf.createURI("p:Point(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj6"), pred1, vf.createIRI("p:Point(10 10)"))));
f.flush();
@@ -134,13 +132,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -178,13 +176,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -207,13 +205,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -246,13 +244,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -265,7 +263,7 @@ public class GeoIndexerTest {
// query with wrong context
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
}
}
@@ -275,13 +273,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -293,7 +291,7 @@ public class GeoIndexerTest {
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(subject))));
// query with wrong subject
- Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -303,13 +301,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -323,10 +321,10 @@ public class GeoIndexerTest {
// query with wrong context
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
// query with wrong subject
- Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -336,13 +334,13 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -356,7 +354,7 @@ public class GeoIndexerTest {
// query with wrong predicate
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createURI("other:pred"))))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createIRI("other:pred"))))));
}
}
@@ -366,19 +364,19 @@ public class GeoIndexerTest {
try (final GeoMesaGeoIndexer f = new GeoMesaGeoIndexer()) {
f.setConf(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource context = vf.createURI("foo:context");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource context = vf.createIRI("foo:context");
- final Resource subjectEast = vf.createURI("foo:subj:east");
- final URI predicateEast = GeoConstants.GEO_AS_WKT;
+ final Resource subjectEast = vf.createIRI("foo:subj:east");
+ final IRI predicateEast = GeoConstants.GEO_AS_WKT;
final Value objectEast = vf.createLiteral("Point(179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementEast = new ContextStatementImpl(subjectEast, predicateEast, objectEast, context);
+ final Statement statementEast = vf.createStatement(subjectEast, predicateEast, objectEast, context);
f.storeStatement(convertStatement(statementEast));
- final Resource subjectWest = vf.createURI("foo:subj:west");
- final URI predicateWest = GeoConstants.GEO_AS_WKT;
+ final Resource subjectWest = vf.createIRI("foo:subj:west");
+ final IRI predicateWest = GeoConstants.GEO_AS_WKT;
final Value objectWest = vf.createLiteral("Point(-179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementWest = new ContextStatementImpl(subjectWest, predicateWest, objectWest, context);
+ final Statement statementWest = vf.createStatement(subjectWest, predicateWest, objectWest, context);
f.storeStatement(convertStatement(statementWest));
f.flush();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
index 0a4e767..8684d11 100644
--- a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
+++ b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoWaveGeoIndexer.java
@@ -51,6 +51,11 @@ import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.StatementSerializer;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.GeoTupleSet.GeoSearchFunctionFactory.NearQuery;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.geotools.data.DataStore;
import org.geotools.data.DataUtilities;
import org.geotools.data.FeatureSource;
@@ -67,15 +72,10 @@ import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory;
import org.opengis.filter.identity.Identifier;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
-import info.aduna.iteration.CloseableIteration;
import mil.nga.giat.geowave.adapter.vector.FeatureDataAdapter;
import mil.nga.giat.geowave.adapter.vector.plugin.GeoWaveGTDataStore;
import mil.nga.giat.geowave.adapter.vector.plugin.GeoWaveGTDataStoreFactory;
@@ -147,7 +147,7 @@ public class GeoWaveGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
private static final String GEO_ID_ATTRIBUTE = "geo_id";
private static final String GEOMETRY_ATTRIBUTE = "geowave_index_geometry";
- private Set<URI> validPredicates;
+ private Set<IRI> validPredicates;
private Configuration conf;
private FeatureStore<SimpleFeatureType, SimpleFeature> featureStore;
private FeatureSource<SimpleFeatureType, SimpleFeature> featureSource;
@@ -367,7 +367,7 @@ public class GeoWaveGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
if (contraints.hasPredicates()) {
final List<String> predicates = new ArrayList<String>();
- for (final URI u : contraints.getPredicates()) {
+ for (final IRI u : contraints.getPredicates()) {
predicates.add("( " + PREDICATE_ATTRIBUTE + "= '" + u.stringValue() + "') ");
}
filterParms.add("(" + StringUtils.join(predicates, " OR ") + ")");
@@ -488,7 +488,7 @@ public class GeoWaveGeoIndexer extends AbstractAccumuloIndexer implements GeoInd
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return validPredicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/geoExamples/GeowaveDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/geoExamples/GeowaveDirectExample.java b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/geoExamples/GeowaveDirectExample.java
index 33a4bec..9242b3c 100644
--- a/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/geoExamples/GeowaveDirectExample.java
+++ b/extras/rya.geoindexing/geo.geowave/src/main/java/org/apache/rya/indexing/geoExamples/GeowaveDirectExample.java
@@ -29,20 +29,20 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
public class GeowaveDirectExample {
private static final Logger log = Logger.getLogger(GeowaveDirectExample.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerSfTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerSfTest.java b/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerSfTest.java
index 0cf2544..10f6a13 100644
--- a/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerSfTest.java
+++ b/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerSfTest.java
@@ -43,6 +43,13 @@ import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.GeoIndexerType;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.geotools.geometry.jts.Geometries;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -52,14 +59,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
@@ -76,7 +75,6 @@ import com.vividsolutions.jts.geom.impl.PackedCoordinateSequence;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.gml2.GMLWriter;
-import info.aduna.iteration.CloseableIteration;
import mil.nga.giat.geowave.datastore.accumulo.minicluster.MiniAccumuloClusterFactory;
/**
@@ -85,6 +83,8 @@ import mil.nga.giat.geowave.datastore.accumulo.minicluster.MiniAccumuloClusterFa
*/
@RunWith(value = Parameterized.class)
public class GeoWaveIndexerSfTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private static AccumuloRdfConfiguration conf;
private static GeometryFactory gf = new GeometryFactory(new PrecisionModel(), 4326);
private static GeoWaveGeoIndexer g;
@@ -139,24 +139,24 @@ public class GeoWaveIndexerSfTest {
* JUnit 4 parameterized iterates thru this list and calls the constructor with each.
* For each test, Call the constructor three times, for WKT and for GML encoding 1, and GML encoding 2
*/
- private static final URI USE_JTS_LIB_ENCODING = new URIImpl("uri:useLib") ;
- private static final URI USE_ROUGH_ENCODING = new URIImpl("uri:useRough") ;
+ private static final IRI USE_JTS_LIB_ENCODING = VF.createIRI("uri:useLib") ;
+ private static final IRI USE_ROUGH_ENCODING = VF.createIRI("uri:useRough") ;
@Parameters
- public static Collection<URI[]> constructorData() {
- final URI[][] data = new URI[][] { { GeoConstants.XMLSCHEMA_OGC_WKT, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING } };
+ public static Collection<IRI[]> constructorData() {
+ final IRI[][] data = new IRI[][] { { GeoConstants.XMLSCHEMA_OGC_WKT, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING }, { GeoConstants.XMLSCHEMA_OGC_GML, USE_JTS_LIB_ENCODING } };
return Arrays.asList(data);
}
- private final URI schemaToTest;
- private final URI encodeMethod;
+ private final IRI schemaToTest;
+ private final IRI encodeMethod;
/**
* Constructor required by JUnit parameterized runner. See {@link #constructorData()} for constructor values.
- * @param schemaToTest the schema to test {@link URI}.
- * @param encodeMethod the encode method {@link URI}.
+ * @param schemaToTest the schema to test {@link IRI}.
+ * @param encodeMethod the encode method {@link IRI}.
*/
- public GeoWaveIndexerSfTest(final URI schemaToTest, final URI encodeMethod) {
+ public GeoWaveIndexerSfTest(final IRI schemaToTest, final IRI encodeMethod) {
this.schemaToTest = schemaToTest;
this.encodeMethod = encodeMethod;
}
@@ -228,11 +228,11 @@ public class GeoWaveIndexerSfTest {
g.storeStatement(createRyaStatement(G, schemaToTest, encodeMethod));
}
- private static RyaStatement createRyaStatement(final Geometry geo, final URI schema, final URI encodingMethod) {
+ private static RyaStatement createRyaStatement(final Geometry geo, final IRI schema, final IRI encodingMethod) {
return RdfToRyaConversions.convertStatement(genericStatement(geo,schema,encodingMethod));
}
- private static Statement genericStatement(final Geometry geo, final URI schema, final URI encodingMethod) {
+ private static Statement genericStatement(final Geometry geo, final IRI schema, final IRI encodingMethod) {
if (schema.equals(GeoConstants.XMLSCHEMA_OGC_WKT)) {
return genericStatementWkt(geo);
} else if (schema.equals(GeoConstants.XMLSCHEMA_OGC_GML)) {
@@ -242,17 +242,15 @@ public class GeoWaveIndexerSfTest {
}
private static Statement genericStatementWkt(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:" + NAMES.get(geo));
- final URI predicate = GeoConstants.GEO_AS_WKT;
- final Value object = vf.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
- return new StatementImpl(subject, predicate, object);
+ final Resource subject = VF.createIRI("uri:" + NAMES.get(geo));
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
+ final Value object = VF.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
+ return VF.createStatement(subject, predicate, object);
}
- private static Statement genericStatementGml(final Geometry geo, final URI encodingMethod) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:" + NAMES.get(geo));
- final URI predicate = GeoConstants.GEO_AS_GML;
+ private static Statement genericStatementGml(final Geometry geo, final IRI encodingMethod) {
+ final Resource subject = VF.createIRI("uri:" + NAMES.get(geo));
+ final IRI predicate = GeoConstants.GEO_AS_GML;
final String gml ;
if (encodingMethod == USE_JTS_LIB_ENCODING) {
@@ -267,8 +265,8 @@ public class GeoWaveIndexerSfTest {
// System.out.println("========== GML====");
}
- final Value object = vf.createLiteral(gml, GeoConstants.XMLSCHEMA_OGC_GML);
- return new StatementImpl(subject, predicate, object);
+ final Value object = VF.createLiteral(gml, GeoConstants.XMLSCHEMA_OGC_GML);
+ return VF.createStatement(subject, predicate, object);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerTest.java b/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerTest.java
index 1930a50..c590e2f 100644
--- a/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerTest.java
+++ b/extras/rya.geoindexing/geo.geowave/src/test/java/org/apache/rya/indexing/accumulo/geo/GeoWaveIndexerTest.java
@@ -37,19 +37,17 @@ import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.GeoIndexerType;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.Sets;
import com.google.common.io.Files;
@@ -140,30 +138,30 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Point point = gf.createPoint(new Coordinate(10, 10));
final Value pointValue = vf.createLiteral("Point(10 10)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final URI invalidPredicate = GeoConstants.GEO_AS_WKT;
+ final IRI invalidPredicate = GeoConstants.GEO_AS_WKT;
// These should not be stored because they are not in the predicate list
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), invalidPredicate, pointValue)));
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), invalidPredicate, pointValue)));
- final URI pred1 = vf.createURI("pred:1");
- final URI pred2 = vf.createURI("pred:2");
+ final IRI pred1 = vf.createIRI("pred:1");
+ final IRI pred2 = vf.createIRI("pred:2");
// These should be stored because they are in the predicate list
- final Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1, pointValue);
- final Statement s4 = new StatementImpl(vf.createURI("foo:subj4"), pred2, pointValue);
+ final Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1, pointValue);
+ final Statement s4 = vf.createStatement(vf.createIRI("foo:subj4"), pred2, pointValue);
f.storeStatement(convertStatement(s3));
f.storeStatement(convertStatement(s4));
// This should not be stored because the object is not valid wkt
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
// This should not be stored because the object is not a literal
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj6"), pred1, vf.createURI("p:Point(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj6"), pred1, vf.createIRI("p:Point(10 10)"))));
f.flush();
@@ -180,13 +178,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -225,13 +223,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -255,13 +253,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -294,13 +292,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -313,7 +311,7 @@ public class GeoWaveIndexerTest {
// query with wrong context
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
}
}
@@ -324,13 +322,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -342,7 +340,7 @@ public class GeoWaveIndexerTest {
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(subject))));
// query with wrong subject
- Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -353,13 +351,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -373,10 +371,10 @@ public class GeoWaveIndexerTest {
// query with wrong context
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
// query with wrong subject
- Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ Assert.assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -387,13 +385,13 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -407,7 +405,7 @@ public class GeoWaveIndexerTest {
// query with wrong predicate
Assert.assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createURI("other:pred"))))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createIRI("other:pred"))))));
}
}
@@ -418,19 +416,19 @@ public class GeoWaveIndexerTest {
f.setConf(conf);
f.purge(conf);
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource context = vf.createURI("foo:context");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource context = vf.createIRI("foo:context");
- final Resource subjectEast = vf.createURI("foo:subj:east");
- final URI predicateEast = GeoConstants.GEO_AS_WKT;
+ final Resource subjectEast = vf.createIRI("foo:subj:east");
+ final IRI predicateEast = GeoConstants.GEO_AS_WKT;
final Value objectEast = vf.createLiteral("Point(179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementEast = new ContextStatementImpl(subjectEast, predicateEast, objectEast, context);
+ final Statement statementEast = vf.createStatement(subjectEast, predicateEast, objectEast, context);
f.storeStatement(convertStatement(statementEast));
- final Resource subjectWest = vf.createURI("foo:subj:west");
- final URI predicateWest = GeoConstants.GEO_AS_WKT;
+ final Resource subjectWest = vf.createIRI("foo:subj:west");
+ final IRI predicateWest = GeoConstants.GEO_AS_WKT;
final Value objectWest = vf.createLiteral("Point(-179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementWest = new ContextStatementImpl(subjectWest, predicateWest, objectWest, context);
+ final Statement statementWest = vf.createStatement(subjectWest, predicateWest, objectWest, context);
f.storeStatement(convertStatement(statementWest));
f.flush();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geoExamples/RyaMongoGeoDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geoExamples/RyaMongoGeoDirectExample.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geoExamples/RyaMongoGeoDirectExample.java
index 04488bb..bed432d 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geoExamples/RyaMongoGeoDirectExample.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geoExamples/RyaMongoGeoDirectExample.java
@@ -30,18 +30,18 @@ import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.mongodb.MongoIndexingConfiguration;
import org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder;
import org.apache.rya.mongodb.EmbeddedMongoFactory;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategy.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategy.java
index 5db432b..54bb90c 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategy.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategy.java
@@ -48,10 +48,10 @@ import org.apache.rya.indexing.mongodb.geo.GeoMongoDBStorageStrategy.GeoQuery;
import org.apache.rya.indexing.mongodb.geo.GmlParser;
import org.apache.rya.indexing.mongodb.temporal.TemporalMongoDBStorageStrategy;
import org.joda.time.DateTime;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBObjectBuilder;
@@ -116,7 +116,7 @@ public class GeoTemporalMongoDBStorageStrategy extends IndexingMongoDBStorageStr
@Override
public DBObject serialize(final RyaStatement ryaStatement) {
final BasicDBObjectBuilder builder = BasicDBObjectBuilder.start("_id", ryaStatement.getSubject().hashCode());
- final URI obj = ryaStatement.getObject().getDataType();
+ final IRI obj = ryaStatement.getObject().getDataType();
if(obj.equals(GeoConstants.GEO_AS_WKT) || obj.equals(GeoConstants.GEO_AS_GML) ||
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
index ce6d653..bc836bd 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
@@ -46,8 +46,8 @@ import org.apache.rya.indexing.mongodb.IndexingException;
import org.apache.rya.indexing.mongodb.geo.GmlParser;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.joda.time.DateTime;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
@@ -126,7 +126,7 @@ public class MongoGeoTemporalIndexer extends AbstractMongoIndexer<GeoTemporalMon
}
final Event currentEvent = updated.build();
- final URI pred = statement.getObject().getDataType();
+ final IRI pred = statement.getObject().getDataType();
if((pred.equals(GeoConstants.GEO_AS_WKT) || pred.equals(GeoConstants.GEO_AS_GML) ||
pred.equals(GeoConstants.XMLSCHEMA_OGC_WKT) || pred.equals(GeoConstants.XMLSCHEMA_OGC_GML))
&& currentEvent.getGeometry().isPresent()) {
@@ -174,7 +174,7 @@ public class MongoGeoTemporalIndexer extends AbstractMongoIndexer<GeoTemporalMon
updated = Event.builder(old.get());
}
- final URI pred = statement.getObject().getDataType();
+ final IRI pred = statement.getObject().getDataType();
if(pred.equals(GeoConstants.GEO_AS_WKT) || pred.equals(GeoConstants.GEO_AS_GML) ||
pred.equals(GeoConstants.XMLSCHEMA_OGC_WKT) || pred.equals(GeoConstants.XMLSCHEMA_OGC_GML)) {
//is geo
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java
index 634359f..0043e04 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java
@@ -28,8 +28,8 @@ import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.accumulo.geo.GeoParseUtils;
import org.apache.rya.indexing.mongodb.IndexingMongoDBStorageStrategy;
import org.bson.Document;
-import org.openrdf.model.Statement;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBObjectBuilder;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoIndexer.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoIndexer.java
index 2abee76..9c23b51 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoIndexer.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoIndexer.java
@@ -31,15 +31,14 @@ import org.apache.rya.indexing.accumulo.geo.GeoTupleSet.GeoSearchFunctionFactory
import org.apache.rya.indexing.mongodb.AbstractMongoIndexer;
import org.apache.rya.indexing.mongodb.geo.GeoMongoDBStorageStrategy.GeoQuery;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
-import org.openrdf.model.Statement;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.mongodb.DBObject;
import com.vividsolutions.jts.geom.Geometry;
-import info.aduna.iteration.CloseableIteration;
-
public class MongoGeoIndexer extends AbstractMongoIndexer<GeoMongoDBStorageStrategy> implements GeoIndexer {
private static final String COLLECTION_SUFFIX = "geo";
private static final Logger logger = Logger.getLogger(MongoGeoIndexer.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoTupleSet.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoTupleSet.java
index c564d02..7ec141d 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoTupleSet.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/mongodb/geo/MongoGeoTupleSet.java
@@ -1,21 +1,3 @@
-package org.apache.rya.indexing.mongodb.geo;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.hadoop.conf.Configuration;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.Maps;
-import com.vividsolutions.jts.geom.Geometry;
-import com.vividsolutions.jts.io.ParseException;
-import com.vividsolutions.jts.io.WKTReader;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -34,9 +16,12 @@ import com.vividsolutions.jts.io.WKTReader;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.mongodb.geo;
+import java.util.Map;
+import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
+import org.apache.hadoop.conf.Configuration;
import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.GeoIndexer;
import org.apache.rya.indexing.IndexingExpr;
@@ -45,6 +30,18 @@ import org.apache.rya.indexing.SearchFunction;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.geo.GeoTupleSet;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Maps;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.io.ParseException;
+import com.vividsolutions.jts.io.WKTReader;
public class MongoGeoTupleSet extends ExternalTupleSet {
@@ -114,7 +111,7 @@ public class MongoGeoTupleSet extends ExternalTupleSet {
throws QueryEvaluationException {
- URI funcURI = filterInfo.getFunction();
+ IRI funcURI = filterInfo.getFunction();
SearchFunction searchFunction = (new MongoGeoSearchFunctionFactory(conf)).getSearchFunction(funcURI);
if(filterInfo.getArguments().length > 1) {
throw new IllegalArgumentException("Index functions do not support more than two arguments.");
@@ -133,7 +130,7 @@ public class MongoGeoTupleSet extends ExternalTupleSet {
Configuration conf;
- private final Map<URI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
+ private final Map<IRI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
public MongoGeoSearchFunctionFactory(Configuration conf) {
this.conf = conf;
@@ -146,7 +143,7 @@ public class MongoGeoTupleSet extends ExternalTupleSet {
* @param searchFunction
* @return
*/
- public SearchFunction getSearchFunction(final URI searchFunction) {
+ public SearchFunction getSearchFunction(final IRI searchFunction) {
SearchFunction geoFunc = null;
@@ -159,7 +156,7 @@ public class MongoGeoTupleSet extends ExternalTupleSet {
return geoFunc;
}
- private SearchFunction getSearchFunctionInternal(final URI searchFunction) throws QueryEvaluationException {
+ private SearchFunction getSearchFunctionInternal(final IRI searchFunction) throws QueryEvaluationException {
SearchFunction sf = SEARCH_FUNCTION_MAP.get(searchFunction);
if (sf != null) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalProviderTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalProviderTest.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalProviderTest.java
index 9f60e2e..d5b6e79 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalProviderTest.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalProviderTest.java
@@ -31,10 +31,10 @@ import org.apache.rya.indexing.geotemporal.model.EventQueryNode;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
public class GeoTemporalProviderTest {
private static final String URI_PROPERTY_AT_TIME = "Property:atTime";
@@ -51,10 +51,10 @@ public class GeoTemporalProviderTest {
*/
@Test
public void twoPatternsTwoFilters_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -72,10 +72,10 @@ public class GeoTemporalProviderTest {
@Test
public void onePatternTwoFilters_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -92,10 +92,10 @@ public class GeoTemporalProviderTest {
@Test
public void twoPatternsOneFilter_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -112,8 +112,8 @@ public class GeoTemporalProviderTest {
@Test
public void twoPatternsNoFilter_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -129,10 +129,10 @@ public class GeoTemporalProviderTest {
@Test
public void twoPatternsTwoFiltersNotValid_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
//Only handles geo and temporal filters
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
@@ -151,10 +151,10 @@ public class GeoTemporalProviderTest {
@Test
public void twoSubjOneFilter_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -174,10 +174,10 @@ public class GeoTemporalProviderTest {
@Test
public void twoNode_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
@@ -199,10 +199,10 @@ public class GeoTemporalProviderTest {
@Test
public void twoSubjectMultiFilter_test() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Value geo = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
final Value temp = vf.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
- final URI tempPred = vf.createURI(URI_PROPERTY_AT_TIME);
+ final IRI tempPred = vf.createIRI(URI_PROPERTY_AT_TIME);
final String query =
"PREFIX geo: <http://www.opengis.net/ont/geosparql#>" +
"PREFIX geos: <http://www.opengis.net/def/function/geosparql/>" +
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalTestUtils.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalTestUtils.java
index 51b2ba0..a5411d0 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalTestUtils.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/GeoTemporalTestUtils.java
@@ -27,14 +27,14 @@ import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.geotemporal.model.EventQueryNode;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.ComparisonFailure;
import org.mockito.Mockito;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
@@ -112,7 +112,7 @@ public final class GeoTemporalTestUtils {
return collector.getTupleExpr();
}
- private static class NodeCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class NodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
private final List<QueryModelNode> stPatterns = new ArrayList<>();
public List<QueryModelNode> getTupleExpr() {
@@ -130,7 +130,7 @@ public final class GeoTemporalTestUtils {
}
}
- private static class FunctionCallCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class FunctionCallCollector extends AbstractQueryModelVisitor<RuntimeException> {
private final List<FunctionCall> filters = new ArrayList<>();
public List<FunctionCall> getTupleExpr() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
index d629d04..316117b 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
@@ -37,23 +37,23 @@ import org.apache.rya.indexing.geotemporal.mongo.MongoGeoTemporalIndexer;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
public class MongoGeoTemporalIndexIT extends MongoITBase {
private static final String URI_PROPERTY_AT_TIME = "Property:atTime";
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
public void updateConfiguration(final MongoDBRdfConfiguration conf) {
@@ -162,19 +162,20 @@ public class MongoGeoTemporalIndexIT extends MongoITBase {
}
private void addStatements(final SailRepositoryConnection conn) throws Exception {
- URI subject = VF.createURI("urn:event1");
- final URI predicate = VF.createURI(URI_PROPERTY_AT_TIME);
+ IRI subject = VF.createIRI("urn:event1");
+ final IRI predicate = VF.createIRI(URI_PROPERTY_AT_TIME);
Value object = VF.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
conn.add(VF.createStatement(subject, predicate, object));
object = VF.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
conn.add(VF.createStatement(subject, GeoConstants.GEO_AS_WKT, object));
- subject = VF.createURI("urn:event2");
+ subject = VF.createIRI("urn:event2");
object = VF.createLiteral(new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0).toString());
conn.add(VF.createStatement(subject, predicate, object));
object = VF.createLiteral("Point(1 1)", GeoConstants.XMLSCHEMA_OGC_WKT);
conn.add(VF.createStatement(subject, GeoConstants.GEO_AS_WKT, object));
+ conn.commit();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
index 9875091..cfcb513 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -18,6 +18,7 @@
*/
package org.apache.rya.indexing.geotemporal.model;
+import static org.apache.rya.api.domain.VarNameUtils.prependConstant;
import static org.apache.rya.indexing.geotemporal.GeoTemporalTestUtils.getFilters;
import static org.apache.rya.indexing.geotemporal.GeoTemporalTestUtils.getSps;
import static org.junit.Assert.assertEquals;
@@ -26,6 +27,7 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.rya.api.domain.RyaURI;
@@ -37,44 +39,42 @@ import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.geotemporal.mongo.MongoEventStorage;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.impl.MapBindingSet;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.PrecisionModel;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Integration tests the methods of {@link EventQueryNode}.
*/
public class EventQueryNode2IT extends MongoITBase {
private static final GeometryFactory GF = new GeometryFactory(new PrecisionModel(), 4326);
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test(expected = IllegalStateException.class)
public void constructor_differentSubjects() throws Exception {
final Var geoSubj = new Var("point");
- final Var geoPred = new Var("-const-http://www.opengis.net/ont/geosparql#asWKT", ValueFactoryImpl.getInstance().createURI("http://www.opengis.net/ont/geosparql#asWKT"));
+ final Var geoPred = new Var(prependConstant("http://www.opengis.net/ont/geosparql#asWKT"), VF.createIRI("http://www.opengis.net/ont/geosparql#asWKT"));
final Var geoObj = new Var("wkt");
final StatementPattern geoSP = new StatementPattern(geoSubj, geoPred, geoObj);
final Var timeSubj = new Var("time");
- final Var timePred = new Var("-const-http://www.w3.org/2006/time#inXSDDateTime", ValueFactoryImpl.getInstance().createURI("-const-http://www.w3.org/2006/time#inXSDDateTime"));
+ final Var timePred = new Var(prependConstant("http://www.w3.org/2006/time#inXSDDateTime"), VF.createIRI(prependConstant("http://www.w3.org/2006/time#inXSDDateTime")));
final Var timeObj = new Var("time");
final StatementPattern timeSP = new StatementPattern(timeSubj, timePred, timeObj);
// This will fail.
@@ -97,7 +97,7 @@ public class EventQueryNode2IT extends MongoITBase {
final StatementPattern geoSP = new StatementPattern(geoSubj, geoPred, geoObj);
final Var timeSubj = new Var("time");
- final Var timePred = new Var("-const-http://www.w3.org/2006/time#inXSDDateTime", ValueFactoryImpl.getInstance().createURI("-const-http://www.w3.org/2006/time#inXSDDateTime"));
+ final Var timePred = new Var(prependConstant("http://www.w3.org/2006/time#inXSDDateTime"), VF.createIRI(prependConstant("http://www.w3.org/2006/time#inXSDDateTime")));
final Var timeObj = new Var("time");
final StatementPattern timeSP = new StatementPattern(timeSubj, timePred, timeObj);
// This will fail.
@@ -252,7 +252,7 @@ public class EventQueryNode2IT extends MongoITBase {
final EventQueryNode node = buildNode(storage, query);
final MapBindingSet existingBindings = new MapBindingSet();
- existingBindings.addBinding("event", VF.createURI("urn:event-2222"));
+ existingBindings.addBinding("event", VF.createIRI("urn:event-2222"));
final CloseableIteration<BindingSet, QueryEvaluationException> rez = node.evaluate(existingBindings);
final MapBindingSet expected = new MapBindingSet();
expected.addBinding("wkt", VF.createLiteral("POINT (-1 -1)"));
@@ -304,7 +304,7 @@ public class EventQueryNode2IT extends MongoITBase {
final EventQueryNode node = buildNode(storage, query);
final MapBindingSet existingBindings = new MapBindingSet();
- existingBindings.addBinding("event", VF.createURI("urn:event-2222"));
+ existingBindings.addBinding("event", VF.createIRI("urn:event-2222"));
final CloseableIteration<BindingSet, QueryEvaluationException> rez = node.evaluate(existingBindings);
final MapBindingSet expected = new MapBindingSet();
expected.addBinding("wkt", VF.createLiteral("POINT (-1 -1)"));
@@ -313,15 +313,16 @@ public class EventQueryNode2IT extends MongoITBase {
assertFalse(rez.hasNext());
}
- private EventQueryNode buildNode(final EventStorage store, final String query) throws Exception {
+ private static EventQueryNode buildNode(final EventStorage store, final String query) throws Exception {
final List<IndexingExpr> geoFilters = new ArrayList<>();
final List<IndexingExpr> temporalFilters = new ArrayList<>();
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final URI filterURI = new URIImpl(filter.getURI());
+ final IRI filterURI = VF.createIRI(filter.getURI());
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), extractArguments(objVar.getName(), filter));
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
@@ -342,7 +343,7 @@ public class EventQueryNode2IT extends MongoITBase {
.build();
}
- private Value[] extractArguments(final String matchName, final FunctionCall call) {
+ private static Value[] extractArguments(final String matchName, final FunctionCall call) {
final Value args[] = new Value[call.getArgs().size() - 1];
int argI = 0;
for (int i = 0; i != call.getArgs().size(); ++i) {
[20/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/RyaDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/RyaDirectExample.java b/extras/indexingExample/src/main/java/RyaDirectExample.java
index eed1a22..c05edd5 100644
--- a/extras/indexingExample/src/main/java/RyaDirectExample.java
+++ b/extras/indexingExample/src/main/java/RyaDirectExample.java
@@ -39,30 +39,28 @@ import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType;
import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.accumulo.PcjTables;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
@@ -90,13 +88,14 @@ public class RyaDirectExample {
SailRepositoryConnection conn = null;
try {
+ log.info("Creating PCJ Tables");
+ createPCJ(conf);
+
log.info("Connecting to Indexing Sail Repository.");
final Sail extSail = RyaSailFactory.getInstance(conf);
repository = new SailRepository(extSail);
conn = repository.getConnection();
- createPCJ(conf);
-
final long start = System.currentTimeMillis();
log.info("Running SPARQL Example: Add and Delete");
testAddAndDelete(conn);
@@ -335,19 +334,19 @@ public class RyaDirectExample {
final SailRepositoryConnection conn) throws Exception {
// add data to the repository using the SailRepository add methods
final ValueFactory f = conn.getValueFactory();
- final URI person = f.createURI("http://example.org/ontology/Person");
+ final IRI person = f.createIRI("http://example.org/ontology/Person");
String uuid;
uuid = "urn:people:alice";
- conn.add(f.createURI(uuid), RDF.TYPE, person);
- conn.add(f.createURI(uuid), RDFS.LABEL,
- f.createLiteral("Alice Palace Hose", f.createURI("xsd:string")));
+ conn.add(f.createIRI(uuid), RDF.TYPE, person);
+ conn.add(f.createIRI(uuid), RDFS.LABEL,
+ f.createLiteral("Alice Palace Hose", f.createIRI("xsd:string")));
- uuid = "urn:people:bobss";
- conn.add(f.createURI(uuid), RDF.TYPE, person);
- conn.add(f.createURI(uuid), RDFS.LABEL,
- f.createLiteral("Bob Snob Hose", "en"));
+ uuid = "urn:people:bob";
+ conn.add(f.createIRI(uuid), RDF.TYPE, person);
+ conn.add(f.createIRI(uuid), RDFS.LABEL,
+ f.createLiteral("Bob Snob Hose", f.createIRI("xsd:string")));
String queryString;
TupleQuery tupleQuery;
@@ -645,21 +644,21 @@ public class RyaDirectExample {
// Delete data from the repository using the SailRepository remove
// methods
final ValueFactory f = conn.getValueFactory();
- final URI person = f.createURI("http://example.org/ontology/Person");
+ final IRI person = f.createIRI("http://example.org/ontology/Person");
String uuid;
uuid = "urn:people:alice";
- conn.remove(f.createURI(uuid), RDF.TYPE, person);
- conn.remove(f.createURI(uuid), RDFS.LABEL,
- f.createLiteral("Alice Palace Hose", f.createURI("xsd:string")));
+ conn.remove(f.createIRI(uuid), RDF.TYPE, person);
+ conn.remove(f.createIRI(uuid), RDFS.LABEL,
+ f.createLiteral("Alice Palace Hose", f.createIRI("xsd:string")));
- uuid = "urn:people:bobss";
- conn.remove(f.createURI(uuid), RDF.TYPE, person);
- conn.remove(f.createURI(uuid), RDFS.LABEL,
- f.createLiteral("Bob Snob Hose", "en"));
+ uuid = "urn:people:bob";
+ conn.remove(f.createIRI(uuid), RDF.TYPE, person);
+ conn.remove(f.createIRI(uuid), RDFS.LABEL,
+ f.createLiteral("Bob Snob Hose", f.createIRI("xsd:string")));
- conn.remove(person, RDFS.LABEL, f.createLiteral("label", "en"));
+ conn.remove(person, RDFS.LABEL, f.createLiteral("label", f.createIRI("xsd:string")));
String queryString;
TupleQuery tupleQuery;
@@ -753,18 +752,19 @@ public class RyaDirectExample {
+ " ?e <uri:talksTo> ?o . "//
+ "}";//
- URI obj, subclass, talksTo;
- final URI person = new URIImpl("urn:people:alice");
- final URI feature = new URIImpl("urn:feature");
- final URI sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ ValueFactory vf = SimpleValueFactory.getInstance();
+ IRI obj, subclass, talksTo;
+ final IRI person = vf.createIRI("urn:people:alice");
+ final IRI feature = vf.createIRI("urn:feature");
+ final IRI sub = vf.createIRI("uri:entity");
+ subclass = vf.createIRI("uri:class");
+ obj = vf.createIRI("uri:obj");
+ talksTo = vf.createIRI("uri:talksTo");
conn.add(person, RDF.TYPE, sub);
conn.add(feature, RDF.TYPE, sub);
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, vf.createLiteral("label"));
conn.add(sub, talksTo, obj);
final String tablename1 = RYA_TABLE_PREFIX + "INDEX_1";
@@ -775,11 +775,11 @@ public class RyaDirectExample {
new PcjTables().createAndPopulatePcj(conn, accCon, tablename1,
queryString1, new String[] { "e", "c", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
new PcjTables().createAndPopulatePcj(conn, accCon, tablename2,
queryString2, new String[] { "e", "c", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
} catch (final RyaDAOException e) {
throw new Error("While creating PCJ tables.",e);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/StatementMetadataExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/StatementMetadataExample.java b/extras/indexingExample/src/main/java/StatementMetadataExample.java
index b759fd2..9f0afc9 100644
--- a/extras/indexingExample/src/main/java/StatementMetadataExample.java
+++ b/extras/indexingExample/src/main/java/StatementMetadataExample.java
@@ -23,7 +23,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-
import org.apache.accumulo.core.client.Connector;
import org.apache.commons.lang3.Validate;
import org.apache.hadoop.conf.Configuration;
@@ -39,24 +38,25 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
public class StatementMetadataExample {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/api/pom.xml
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/api/pom.xml b/extras/periodic.notification/api/pom.xml
index ebed3c7..1118e14 100644
--- a/extras/periodic.notification/api/pom.xml
+++ b/extras/periodic.notification/api/pom.xml
@@ -40,8 +40,8 @@
<artifactId>gson</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-query</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-query</artifactId>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BinPruner.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BinPruner.java b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BinPruner.java
index f4a083c..8aee25b 100644
--- a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BinPruner.java
+++ b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BinPruner.java
@@ -18,8 +18,8 @@
*/
package org.apache.rya.periodic.notification.api;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Object that cleans up old {@link BindingSet}s corresponding to the specified
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetExporter.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetExporter.java b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetExporter.java
index 491576b..364ad4e 100644
--- a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetExporter.java
+++ b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetExporter.java
@@ -18,7 +18,7 @@
*/
package org.apache.rya.periodic.notification.api;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* An Object that is used to export {@link BindingSet}s to an external repository or queuing system.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetRecord.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetRecord.java b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetRecord.java
index c3f70f1..1deb230 100644
--- a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetRecord.java
+++ b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/api/BindingSetRecord.java
@@ -18,7 +18,7 @@
*/
package org.apache.rya.periodic.notification.api;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Objects;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/serialization/BindingSetSerDe.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/serialization/BindingSetSerDe.java b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/serialization/BindingSetSerDe.java
index 6db7b18..ba7dcad 100644
--- a/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/serialization/BindingSetSerDe.java
+++ b/extras/periodic.notification/api/src/main/java/org/apache/rya/periodic/notification/serialization/BindingSetSerDe.java
@@ -28,14 +28,17 @@ import org.apache.kafka.common.serialization.Serializer;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Joiner;
import com.google.common.primitives.Bytes;
+import com.google.common.base.Joiner;
+import com.google.common.primitives.Bytes;
+
/**
* Kafka {@link Serializer} and {@link Deserializer} for producing and consuming messages
* from Kafka.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/pom.xml
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/pom.xml b/extras/periodic.notification/service/pom.xml
index ef07131..dc68d3d 100644
--- a/extras/periodic.notification/service/pom.xml
+++ b/extras/periodic.notification/service/pom.xml
@@ -49,8 +49,8 @@
<artifactId>rya.indexing</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-query</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-query</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplication.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplication.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplication.java
index 79abe2f..66cb25b 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplication.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplication.java
@@ -32,7 +32,7 @@ import org.apache.rya.periodic.notification.exporter.KafkaExporterExecutor;
import org.apache.rya.periodic.notification.processor.NotificationProcessorExecutor;
import org.apache.rya.periodic.notification.pruner.PeriodicQueryPrunerExecutor;
import org.apache.rya.periodic.notification.registration.kafka.KafkaNotificationProvider;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationFactory.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationFactory.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationFactory.java
index fbc03f3..85f6e15 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationFactory.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationFactory.java
@@ -18,13 +18,10 @@
*/
package org.apache.rya.periodic.notification.application;
-import java.io.File;
-import java.io.FileInputStream;
import java.util.Optional;
import java.util.Properties;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -54,9 +51,7 @@ import org.apache.rya.periodic.notification.recovery.PeriodicNotificationProvide
import org.apache.rya.periodic.notification.registration.kafka.KafkaNotificationProvider;
import org.apache.rya.periodic.notification.serialization.BindingSetSerDe;
import org.apache.rya.periodic.notification.serialization.CommandNotificationSerializer;
-import org.openrdf.query.BindingSet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.eclipse.rdf4j.query.BindingSet;
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaExporterExecutor.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaExporterExecutor.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaExporterExecutor.java
index 815a794..b9f3de8 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaExporterExecutor.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaExporterExecutor.java
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.rya.periodic.notification.api.BindingSetRecord;
import org.apache.rya.periodic.notification.api.LifeCycle;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaPeriodicBindingSetExporter.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaPeriodicBindingSetExporter.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaPeriodicBindingSetExporter.java
index c343116..182f328 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaPeriodicBindingSetExporter.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/exporter/KafkaPeriodicBindingSetExporter.java
@@ -31,8 +31,8 @@ import org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants;
import org.apache.rya.periodic.notification.api.BindingSetExporter;
import org.apache.rya.periodic.notification.api.BindingSetRecord;
import org.apache.rya.periodic.notification.api.BindingSetRecordExportException;
-import org.openrdf.model.Literal;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.query.BindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/processor/TimestampedNotificationProcessor.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/processor/TimestampedNotificationProcessor.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/processor/TimestampedNotificationProcessor.java
index dcc47b6..a27bf7a 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/processor/TimestampedNotificationProcessor.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/processor/TimestampedNotificationProcessor.java
@@ -30,7 +30,7 @@ import org.apache.rya.periodic.notification.api.NodeBin;
import org.apache.rya.periodic.notification.api.NotificationProcessor;
import org.apache.rya.periodic.notification.exporter.KafkaPeriodicBindingSetExporter;
import org.apache.rya.periodic.notification.notification.TimestampedNotification;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -95,7 +95,7 @@ public class TimestampedNotificationProcessor implements NotificationProcessor,
final long bin = getBinFromTimestamp(ts, period);
final NodeBin nodeBin = new NodeBin(id, bin);
- try (CloseableIterator<BindingSet> iter = periodicStorage.listResults(id, Optional.of(bin));) {
+ try (CloseableIterator<BindingSet> iter = periodicStorage.listResults(id, Optional.of(bin))) {
while(iter.hasNext()) {
bindingSets.add(new BindingSetRecord(iter.next(), id));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/pruner/FluoBinPruner.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/pruner/FluoBinPruner.java b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/pruner/FluoBinPruner.java
index ea08af5..886ffc2 100644
--- a/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/pruner/FluoBinPruner.java
+++ b/extras/periodic.notification/service/src/main/java/org/apache/rya/periodic/notification/pruner/FluoBinPruner.java
@@ -29,9 +29,8 @@ import org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation;
import org.apache.rya.indexing.pcj.fluo.app.util.BindingHashShardingFunction;
import org.apache.rya.periodic.notification.api.BinPruner;
import org.apache.rya.periodic.notification.api.NodeBin;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,7 +42,7 @@ import com.google.common.base.Optional;
public class FluoBinPruner implements BinPruner {
private static final Logger log = LoggerFactory.getLogger(FluoBinPruner.class);
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final FluoClient client;
public FluoBinPruner(final FluoClient client) {
@@ -54,10 +53,8 @@ public class FluoBinPruner implements BinPruner {
* This method deletes BindingSets in the specified bin from the BindingSet
* Column of the indicated Fluo nodeId
*
- * @param id
+ * @param nodeBin
* - Fluo nodeId
- * @param bin
- * - bin id
*/
@Override
public void pruneBindingSetBin(final NodeBin nodeBin) {
@@ -70,7 +67,7 @@ public class FluoBinPruner implements BinPruner {
throw new RuntimeException();
}
final Column batchInfoColumn = type.get().getResultColumn();
- final Bytes batchInfoSpanPrefix = BindingHashShardingFunction.getShardedScanPrefix(id, vf.createLiteral(bin));
+ final Bytes batchInfoSpanPrefix = BindingHashShardingFunction.getShardedScanPrefix(id, VF.createLiteral(bin));
final SpanBatchDeleteInformation batchInfo = SpanBatchDeleteInformation.builder().setColumn(batchInfoColumn)
.setSpan(Span.prefix(batchInfoSpanPrefix)).build();
BatchInformationDAO.addBatch(tx, id, batchInfo);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationIT.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationIT.java b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationIT.java
index cd06f2a..bd87df5 100644
--- a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationIT.java
+++ b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationApplicationIT.java
@@ -71,25 +71,23 @@ import org.apache.rya.periodic.notification.serialization.CommandNotificationSer
import org.apache.rya.test.kafka.EmbeddedKafkaInstance;
import org.apache.rya.test.kafka.EmbeddedKafkaSingleton;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;;
-
+import com.google.common.collect.Sets;
public class PeriodicNotificationApplicationIT extends RyaExportITBase {
@@ -142,12 +140,11 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
//make data
final int periodMult = 15;
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
//Sleep until current time aligns nicely with period to makell
//results more predictable
while(System.currentTimeMillis() % (periodMult*1000) > 500) {
- ;
}
final ZonedDateTime time = ZonedDateTime.now();
@@ -161,21 +158,21 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final String time3 = zTime3.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasObsType"), vf.createLiteral("ship")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasObsType"), vf.createLiteral("ship")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasObsType"), vf.createLiteral("airplane")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasObsType"), vf.createLiteral("airplane")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasObsType"), vf.createLiteral("ship")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasObsType"), vf.createLiteral("ship")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasObsType"), vf.createLiteral("airplane")),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasObsType"), vf.createLiteral("airplane")),
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_5"), vf.createURI("uri:hasObsType"), vf.createLiteral("automobile")));
+ vf.createStatement(vf.createIRI("urn:obs_5"), vf.createIRI("uri:hasObsType"), vf.createLiteral("automobile")));
try (FluoClient fluo = FluoClientFactory.getFluoClient(conf.getFluoAppName(), Optional.of(conf.getFluoTableName()), conf)) {
final Connector connector = ConfigUtils.getConnector(conf);
@@ -210,17 +207,17 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final Set<BindingSet> expected1 = new HashSet<>();
final QueryBindingSet bs1 = new QueryBindingSet();
bs1.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(0)));
- bs1.addBinding("total", new LiteralImpl("2", XMLSchema.INTEGER));
+ bs1.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
bs1.addBinding("type", vf.createLiteral("airplane"));
final QueryBindingSet bs2 = new QueryBindingSet();
bs2.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(0)));
- bs2.addBinding("total", new LiteralImpl("2", XMLSchema.INTEGER));
+ bs2.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
bs2.addBinding("type", vf.createLiteral("ship"));
final QueryBindingSet bs3 = new QueryBindingSet();
bs3.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(0)));
- bs3.addBinding("total", new LiteralImpl("1", XMLSchema.INTEGER));
+ bs3.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
bs3.addBinding("type", vf.createLiteral("automobile"));
expected1.add(bs1);
@@ -230,12 +227,12 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final Set<BindingSet> expected2 = new HashSet<>();
final QueryBindingSet bs4 = new QueryBindingSet();
bs4.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(1)));
- bs4.addBinding("total", new LiteralImpl("2", XMLSchema.INTEGER));
+ bs4.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
bs4.addBinding("type", vf.createLiteral("airplane"));
final QueryBindingSet bs5 = new QueryBindingSet();
bs5.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(1)));
- bs5.addBinding("total", new LiteralImpl("2", XMLSchema.INTEGER));
+ bs5.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
bs5.addBinding("type", vf.createLiteral("ship"));
expected2.add(bs4);
@@ -244,12 +241,12 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final Set<BindingSet> expected3 = new HashSet<>();
final QueryBindingSet bs6 = new QueryBindingSet();
bs6.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(2)));
- bs6.addBinding("total", new LiteralImpl("1", XMLSchema.INTEGER));
+ bs6.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
bs6.addBinding("type", vf.createLiteral("ship"));
final QueryBindingSet bs7 = new QueryBindingSet();
bs7.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(ids.get(2)));
- bs7.addBinding("total", new LiteralImpl("1", XMLSchema.INTEGER));
+ bs7.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
bs7.addBinding("type", vf.createLiteral("airplane"));
expected3.add(bs6);
@@ -286,12 +283,11 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
//make data
final int periodMult = 15;
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
//Sleep until current time aligns nicely with period to make
//results more predictable
while(System.currentTimeMillis() % (periodMult*1000) > 500) {
- ;
}
final ZonedDateTime time = ZonedDateTime.now();
@@ -305,15 +301,15 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final String time3 = zTime3.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")));
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")));
try (FluoClient fluo = FluoClientFactory.getFluoClient(conf.getFluoAppName(), Optional.of(conf.getFluoTableName()), conf)) {
final Connector connector = ConfigUtils.getConnector(conf);
@@ -378,12 +374,11 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
//make data
final int periodMult = 15;
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
//Sleep until current time aligns nicely with period to make
//results more predictable
while(System.currentTimeMillis() % (periodMult*1000) > 500) {
- ;
}
final ZonedDateTime time = ZonedDateTime.now();
@@ -397,15 +392,15 @@ public class PeriodicNotificationApplicationIT extends RyaExportITBase {
final String time3 = zTime3.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")));
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")));
try (FluoClient fluo = FluoClientFactory.getFluoClient(conf.getFluoAppName(), Optional.of(conf.getFluoTableName()), conf)) {
final Connector connector = ConfigUtils.getConnector(conf);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationProviderIT.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationProviderIT.java b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationProviderIT.java
index e05ca6f..cadbc57 100644
--- a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationProviderIT.java
+++ b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/application/PeriodicNotificationProviderIT.java
@@ -31,9 +31,9 @@ import org.apache.rya.indexing.pcj.fluo.app.util.FluoQueryUtils;
import org.apache.rya.periodic.notification.coordinator.PeriodicNotificationCoordinatorExecutor;
import org.apache.rya.periodic.notification.notification.TimestampedNotification;
import org.apache.rya.periodic.notification.recovery.PeriodicNotificationProvider;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/exporter/PeriodicNotificationExporterIT.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/exporter/PeriodicNotificationExporterIT.java b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/exporter/PeriodicNotificationExporterIT.java
index 82338b9..a2c76ec 100644
--- a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/exporter/PeriodicNotificationExporterIT.java
+++ b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/exporter/PeriodicNotificationExporterIT.java
@@ -38,13 +38,13 @@ import org.apache.rya.periodic.notification.api.BindingSetRecord;
import org.apache.rya.periodic.notification.serialization.BindingSetSerDe;
import org.apache.rya.test.kafka.KafkaITBase;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
public class PeriodicNotificationExporterIT extends KafkaITBase {
@@ -53,7 +53,7 @@ public class PeriodicNotificationExporterIT extends KafkaITBase {
public KafkaTestInstanceRule kafkaTestInstanceRule = new KafkaTestInstanceRule(false);
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testExporter() throws InterruptedException {
@@ -69,13 +69,13 @@ public class PeriodicNotificationExporterIT extends KafkaITBase {
final KafkaExporterExecutor exporter = new KafkaExporterExecutor(new KafkaProducer<String, BindingSet>(createKafkaProducerConfig()), 1, records);
exporter.start();
final QueryBindingSet bs1 = new QueryBindingSet();
- bs1.addBinding(PeriodicQueryResultStorage.PeriodicBinId, vf.createLiteral(1L));
- bs1.addBinding("name", vf.createURI("uri:Bob"));
+ bs1.addBinding(PeriodicQueryResultStorage.PeriodicBinId, VF.createLiteral(1L));
+ bs1.addBinding("name", VF.createIRI("uri:Bob"));
final BindingSetRecord record1 = new BindingSetRecord(bs1, topic1);
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding(PeriodicQueryResultStorage.PeriodicBinId, vf.createLiteral(2L));
- bs2.addBinding("name", vf.createURI("uri:Joe"));
+ bs2.addBinding(PeriodicQueryResultStorage.PeriodicBinId, VF.createLiteral(2L));
+ bs2.addBinding("name", VF.createIRI("uri:Joe"));
final BindingSetRecord record2 = new BindingSetRecord(bs2, topic2);
records.add(record1);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/processor/PeriodicNotificationProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/processor/PeriodicNotificationProcessorIT.java b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/processor/PeriodicNotificationProcessorIT.java
index 221a18d..1c04a42 100644
--- a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/processor/PeriodicNotificationProcessorIT.java
+++ b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/processor/PeriodicNotificationProcessorIT.java
@@ -34,16 +34,16 @@ import org.apache.rya.periodic.notification.api.BindingSetRecord;
import org.apache.rya.periodic.notification.api.NodeBin;
import org.apache.rya.periodic.notification.notification.PeriodicNotification;
import org.apache.rya.periodic.notification.notification.TimestampedNotification;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
public class PeriodicNotificationProcessorIT extends AccumuloExportITBase {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String RYA_INSTANCE_NAME = "rya_";
@Test
@@ -72,26 +72,26 @@ public class PeriodicNotificationProcessorIT extends AccumuloExportITBase {
Set<VisibilityBindingSet> storageResults = new HashSet<>();
QueryBindingSet bs1 = new QueryBindingSet();
- bs1.addBinding("periodicBinId", vf.createLiteral(binId1));
- bs1.addBinding("id", vf.createLiteral(1));
+ bs1.addBinding("periodicBinId", VF.createLiteral(binId1));
+ bs1.addBinding("id", VF.createLiteral(1));
expected.add(bs1);
storageResults.add(new VisibilityBindingSet(bs1));
QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("periodicBinId", vf.createLiteral(binId1));
- bs2.addBinding("id", vf.createLiteral(2));
+ bs2.addBinding("periodicBinId", VF.createLiteral(binId1));
+ bs2.addBinding("id", VF.createLiteral(2));
expected.add(bs2);
storageResults.add(new VisibilityBindingSet(bs2));
QueryBindingSet bs3 = new QueryBindingSet();
- bs3.addBinding("periodicBinId", vf.createLiteral(binId2));
- bs3.addBinding("id", vf.createLiteral(3));
+ bs3.addBinding("periodicBinId", VF.createLiteral(binId2));
+ bs3.addBinding("id", VF.createLiteral(3));
expected.add(bs3);
storageResults.add(new VisibilityBindingSet(bs3));
QueryBindingSet bs4 = new QueryBindingSet();
- bs4.addBinding("periodicBinId", vf.createLiteral(binId2));
- bs4.addBinding("id", vf.createLiteral(4));
+ bs4.addBinding("periodicBinId", VF.createLiteral(binId2));
+ bs4.addBinding("id", VF.createLiteral(4));
expected.add(bs4);
storageResults.add(new VisibilityBindingSet(bs4));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/pruner/PeriodicNotificationBinPrunerIT.java
----------------------------------------------------------------------
diff --git a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/pruner/PeriodicNotificationBinPrunerIT.java b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/pruner/PeriodicNotificationBinPrunerIT.java
index ac2202c..d403450 100644
--- a/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/pruner/PeriodicNotificationBinPrunerIT.java
+++ b/extras/periodic.notification/tests/src/test/java/org/apache/rya/periodic/notification/pruner/PeriodicNotificationBinPrunerIT.java
@@ -53,16 +53,15 @@ import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPeriodicQueryResultS
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
import org.apache.rya.periodic.notification.api.NodeBin;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Sets;
@@ -88,7 +87,7 @@ public class PeriodicNotificationBinPrunerIT extends RyaExportITBase {
String queryId = FluoQueryUtils.convertFluoQueryIdToPcjId(createPeriodicQuery.createPeriodicQuery(sparql).getQueryId());
// create statements to ingest into Fluo
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
ZonedDateTime time = ZonedDateTime.now();
long currentTime = time.toInstant().toEpochMilli();
@@ -106,24 +105,24 @@ public class PeriodicNotificationBinPrunerIT extends RyaExportITBase {
String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasId"), vf.createLiteral("id_4")),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasId"), vf.createLiteral("id_4")),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")));
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")));
// add statements to Fluo
InsertTriples inserter = new InsertTriples();
@@ -250,8 +249,10 @@ public class PeriodicNotificationBinPrunerIT extends RyaExportITBase {
}
private void compareFluoCounts(FluoClient client, String pcjId, long bin) {
+ final ValueFactory vf = SimpleValueFactory.getInstance();
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, new LiteralImpl(Long.toString(bin), XMLSchema.LONG));
+
+ bs.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(Long.toString(bin), XMLSchema.LONG));
VariableOrder varOrder = new VariableOrder(IncrementalUpdateConstants.PERIODIC_BIN_ID);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/BenchmarkStatementGenerator.java
----------------------------------------------------------------------
diff --git a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/BenchmarkStatementGenerator.java b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/BenchmarkStatementGenerator.java
index fdd3b63..e766c18 100644
--- a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/BenchmarkStatementGenerator.java
+++ b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/BenchmarkStatementGenerator.java
@@ -25,10 +25,10 @@ import java.util.List;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,11 +41,10 @@ public class BenchmarkStatementGenerator {
private static final Logger logger = LoggerFactory.getLogger(BenchmarkStatementGenerator.class);
- private final ValueFactory vf;
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final DatatypeFactory dtf;
public BenchmarkStatementGenerator() throws DatatypeConfigurationException {
- vf = new ValueFactoryImpl();
dtf = DatatypeFactory.newInstance();
}
@@ -69,7 +68,7 @@ public class BenchmarkStatementGenerator {
*/
public List<Statement> generate(final long numObservationsPerType, final int numTypes, final String typePrefix, final long observationOffset, final ZonedDateTime zonedTime) {
final String time = zonedTime.format(DateTimeFormatter.ISO_INSTANT);
- final Literal litTime = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
+ final Literal litTime = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
final List<Statement> statements = Lists.newArrayList();
for (long i = 0; i < numObservationsPerType; i++) {
@@ -80,8 +79,8 @@ public class BenchmarkStatementGenerator {
final String obsId = "urn:obs_" + String.format("%020d", observationId);
final String type = typePrefix + j;
//logger.info(obsId + " " + type + " " + litTime);
- statements.add(vf.createStatement(vf.createURI(obsId), vf.createURI("uri:hasTime"), litTime));
- statements.add(vf.createStatement(vf.createURI(obsId), vf.createURI("uri:hasObsType"), vf.createLiteral(type)));
+ statements.add(VF.createStatement(VF.createIRI(obsId), VF.createIRI("uri:hasTime"), litTime));
+ statements.add(VF.createStatement(VF.createIRI(obsId), VF.createIRI("uri:hasObsType"), VF.createLiteral(type)));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/KafkaLatencyBenchmark.java
----------------------------------------------------------------------
diff --git a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/KafkaLatencyBenchmark.java b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/KafkaLatencyBenchmark.java
index e75d499..258d9df 100644
--- a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/KafkaLatencyBenchmark.java
+++ b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/periodic/KafkaLatencyBenchmark.java
@@ -53,8 +53,8 @@ import org.apache.rya.api.client.RyaClientException;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.export.kafka.KryoVisibilityBindingSetSerializer;
import org.apache.rya.periodic.notification.serialization.BindingSetSerDe;
-import org.openrdf.model.Statement;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.BindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/PCJOptimizerBenchmark.java
----------------------------------------------------------------------
diff --git a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/PCJOptimizerBenchmark.java b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/PCJOptimizerBenchmark.java
index cf4ca8f..8b386ab 100644
--- a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/PCJOptimizerBenchmark.java
+++ b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/PCJOptimizerBenchmark.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -33,6 +33,10 @@ import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
@@ -43,10 +47,6 @@ import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.CommandLineOptionException;
import org.openjdk.jmh.runner.options.CommandLineOptions;
import org.openjdk.jmh.runner.options.OptionsBuilder;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/QueryBenchmark.java
----------------------------------------------------------------------
diff --git a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/QueryBenchmark.java b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/QueryBenchmark.java
index 248ea88..68fa53d 100644
--- a/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/QueryBenchmark.java
+++ b/extras/rya.benchmark/src/main/java/org/apache/rya/benchmark/query/QueryBenchmark.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -35,10 +35,24 @@ import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.benchmark.query.Parameters.NumReadsRuns;
import org.apache.rya.benchmark.query.QueryBenchmark.QueryBenchmarkRun.NotEnoughResultsException;
import org.apache.rya.benchmark.query.Rya.Accumulo;
import org.apache.rya.benchmark.query.Rya.SecondaryIndexing;
+import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType;
+import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType;
+import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
@@ -51,21 +65,6 @@ import org.openjdk.jmh.annotations.Timeout;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.options.CommandLineOptions;
import org.openjdk.jmh.runner.options.OptionsBuilder;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
-import org.openrdf.sail.SailException;
-
-import info.aduna.iteration.CloseableIteration;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType;
-import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType;
-import org.apache.rya.sail.config.RyaSailFactory;
/**
* A benchmark that may be used to evaluate the performance of SPARQL queries
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.benchmark/src/test/java/org/apache/rya/benchmark/query/QueryBenchmarkRunIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.benchmark/src/test/java/org/apache/rya/benchmark/query/QueryBenchmarkRunIT.java b/extras/rya.benchmark/src/test/java/org/apache/rya/benchmark/query/QueryBenchmarkRunIT.java
index dd5fe68..1160ad3 100644
--- a/extras/rya.benchmark/src/test/java/org/apache/rya/benchmark/query/QueryBenchmarkRunIT.java
+++ b/extras/rya.benchmark/src/test/java/org/apache/rya/benchmark/query/QueryBenchmarkRunIT.java
@@ -42,10 +42,10 @@ import org.apache.zookeeper.ClientCnxn;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
+import org.eclipse.rdf4j.sail.SailException;
/**
* Integration tests {@link QueryBenchmarkRun}.
@@ -121,23 +121,23 @@ public class QueryBenchmarkRunIT {
final SailConnection sailConn = sail.getConnection();
sailConn.begin();
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Bob"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:David"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Eve"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Frank"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:George"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
-
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:David"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Eve"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Frank"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:George"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:green"));
- sailConn.addStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:brown"));
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:David"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:George"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:David"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:George"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:green"));
+ sailConn.addStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:brown"));
sailConn.commit();
sailConn.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.accumulo/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/pom.xml b/extras/rya.export/export.accumulo/pom.xml
index 48a83d1..06201dc 100644
--- a/extras/rya.export/export.accumulo/pom.xml
+++ b/extras/rya.export/export.accumulo/pom.xml
@@ -73,6 +73,12 @@ under the License.
<version>${accumulo.version}</version>
<type>pom</type>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.accumulo</groupId>
+ <artifactId>accumulo-minicluster</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStore.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStore.java b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStore.java
index f5992df..ddcdd4c 100644
--- a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStore.java
+++ b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStore.java
@@ -38,10 +38,8 @@ import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-import org.apache.rya.export.InstanceType;
import org.apache.rya.export.accumulo.parent.AccumuloParentMetadataRepository;
import org.apache.rya.export.accumulo.util.AccumuloRyaUtils;
-import org.apache.rya.export.api.MergerException;
import org.apache.rya.export.api.metadata.MergeParentMetadata;
import org.apache.rya.export.api.metadata.ParentMetadataExistsException;
import org.apache.rya.export.api.store.AddStatementException;
@@ -50,12 +48,11 @@ import org.apache.rya.export.api.store.FetchStatementException;
import org.apache.rya.export.api.store.RemoveStatementException;
import org.apache.rya.export.api.store.RyaStatementStore;
import org.apache.rya.export.api.store.UpdateStatementException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import com.google.common.base.Function;
import com.google.common.collect.Iterators;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Allows specific CRUD operations an Accumulo {@link RyaStatement} storage
* system.
@@ -79,15 +76,9 @@ public class AccumuloRyaStatementStore implements RyaStatementStore {
/**
* Creates a new instance of {@link AccumuloRyaStatementStore}.
- * @param instanceName the Accumulo instance name.
- * @param username the Accumulo user name.
- * @param password the Accumulo user's password.
- * @param instanceType the {@link InstanceType}.
+ * @param dao the {@AccumuloRyaDAO}.
* @param tablePrefix the Rya instance's table prefix.
- * @param auths the comma-separated list of Accumulo authorizations for the
- * user.
- * @param zooKeepers the comma-separated list of zoo keeper host names.
- * @throws MergerException
+ * @param ryaInstance the Rya instance name.
*/
public AccumuloRyaStatementStore(final AccumuloRyaDAO dao, final String tablePrefix, final String ryaInstance) {
this.tablePrefix = tablePrefix;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/conf/AccumuloExportConstants.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/conf/AccumuloExportConstants.java b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/conf/AccumuloExportConstants.java
index 51dec9b..1fc9eaa 100644
--- a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/conf/AccumuloExportConstants.java
+++ b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/conf/AccumuloExportConstants.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.export.InstanceType;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
index 1073b6e..090d22f 100644
--- a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
+++ b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
@@ -61,7 +61,7 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.openrdf.model.ValueFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
@@ -104,7 +104,7 @@ public final class AccumuloRyaUtils {
* @return the {@link RyaURI}.
*/
public static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createURI(namespace, localName));
+ return RdfToRyaConversions.convertURI(VALUE_FACTORY.createIRI(namespace, localName));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.client/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.client/pom.xml b/extras/rya.export/export.client/pom.xml
index 979cb7d..c942702 100644
--- a/extras/rya.export/export.client/pom.xml
+++ b/extras/rya.export/export.client/pom.xml
@@ -56,21 +56,20 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
</dependency>
<!-- Testing dependencies. -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/MergeDriverClient.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/MergeDriverClient.java b/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/MergeDriverClient.java
index 232a0ed..2a902a7 100644
--- a/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/MergeDriverClient.java
+++ b/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/MergeDriverClient.java
@@ -45,10 +45,10 @@ import org.apache.rya.export.client.merge.MemoryTimeMerger;
import org.apache.rya.export.client.merge.StatementStoreFactory;
import org.apache.rya.export.client.merge.VisibilityStatementMerger;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
@@ -89,7 +89,7 @@ public class MergeDriverClient {
final String tomcat = configuration.getChildTomcatUrl();
final String ntpHost = configuration.getNtpServerHost();
try {
- offset = Optional.<Long>fromNullable(TimeUtils.getNtpServerAndMachineTimeDifference(ntpHost, tomcat));
+ offset = Optional.fromNullable(TimeUtils.getNtpServerAndMachineTimeDifference(ntpHost, tomcat));
} catch (final IOException e) {
LOG.error("Unable to get time difference between time server: " + ntpHost + " and the server: " + tomcat, e);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/conf/TimeUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/conf/TimeUtils.java b/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/conf/TimeUtils.java
index b1731de..30ac924 100644
--- a/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/conf/TimeUtils.java
+++ b/extras/rya.export/export.client/src/main/java/org/apache/rya/export/client/conf/TimeUtils.java
@@ -31,10 +31,10 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.net.ntp.NTPUDPClient;
import org.apache.commons.net.ntp.TimeInfo;
import org.apache.log4j.Logger;
-import org.codehaus.plexus.util.StringUtils;
import org.mortbay.jetty.HttpMethods;
import com.google.common.net.HttpHeaders;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java b/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
index 60fff56..83fd774 100644
--- a/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
+++ b/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
@@ -44,16 +44,16 @@ import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.AfterClass;
-import org.openrdf.model.Statement;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
import com.mongodb.MongoClient;
import com.mongodb.MongoException;
@@ -193,7 +193,7 @@ public abstract class ITBase {
}
/**
- * A helper function for creating a Sesame {@link Statement} that represents
+ * A helper function for creating a RDF4J {@link Statement} that represents
* a Triple..
*
* @param subject
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/pom.xml b/extras/rya.forwardchain/pom.xml
index 454cb74..2fdaf15 100644
--- a/extras/rya.forwardchain/pom.xml
+++ b/extras/rya.forwardchain/pom.xml
@@ -31,8 +31,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.apache.rya</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
index f1fe8b3..d4ae96f 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
@@ -22,15 +22,15 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
public class ForwardChainConstants {
private static final ValueFactory VF = RdfCloudTripleStoreConstants.VALUE_FACTORY;
private static final String NAMESPACE = RyaSchema.NAMESPACE;
- public static final URI DERIVATION_TIME = VF.createURI(NAMESPACE, "forwardChainIteration");
- public static final URI DERIVATION_RULE = VF.createURI(NAMESPACE, "forwardChainRule");
+ public static final IRI DERIVATION_TIME = VF.createIRI(NAMESPACE, "forwardChainIteration");
+ public static final IRI DERIVATION_RULE = VF.createIRI(NAMESPACE, "forwardChainRule");
public static final RyaURI RYA_DERIVATION_RULE = RdfToRyaConversions.convertURI(DERIVATION_RULE);
public static final RyaURI RYA_DERIVATION_TIME = RdfToRyaConversions.convertURI(DERIVATION_TIME);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractConstructRule.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractConstructRule.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractConstructRule.java
index c4c12c7..649baa7 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractConstructRule.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractConstructRule.java
@@ -21,8 +21,8 @@ package org.apache.rya.forwardchain.rule;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.strategy.AbstractRuleExecutionStrategy;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.parser.ParsedGraphQuery;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.parser.ParsedGraphQuery;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractInconsistencyRule.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractInconsistencyRule.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractInconsistencyRule.java
index 451c5e4..56afae7 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractInconsistencyRule.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/rule/AbstractInconsistencyRule.java
@@ -24,7 +24,7 @@ import java.util.Collection;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.forwardchain.ForwardChainException;
import org.apache.rya.forwardchain.strategy.AbstractRuleExecutionStrategy;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
/**
* A rule that identifies an inconsistency in the data, but does not add or
[06/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
index 27b799f..6b049b9 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/FilterRangeVisitor.java
@@ -1,11 +1,3 @@
-package org.apache.rya.rdftriplestore.evaluation;
-
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.RANGE;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,29 +16,34 @@ import java.util.Map;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.rdftriplestore.evaluation;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.RANGE;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RangeURI;
import org.apache.rya.api.domain.RangeValue;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.BooleanLiteralImpl;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.impl.BooleanLiteral;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Class FilterTimeIndexVisitor
* Date: Apr 11, 2011
* Time: 10:16:15 PM
*/
-public class FilterRangeVisitor extends QueryModelVisitorBase<Exception> {
+public class FilterRangeVisitor extends AbstractQueryModelVisitor<Exception> {
private final RdfCloudTripleStoreConfiguration conf;
private final Map<Var, RangeValue> rangeValues = new HashMap<Var, RangeValue>();
@@ -74,7 +71,7 @@ public class FilterRangeVisitor extends QueryModelVisitorBase<Exception> {
final Value start = startVc.getValue();
final Value end = endVc.getValue();
rangeValues.put(var, new RangeValue(start, end));
- node.setCondition(new ValueConstant(BooleanLiteralImpl.TRUE));
+ node.setCondition(new ValueConstant(BooleanLiteral.TRUE));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/MultipleBindingSetsIterator.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/MultipleBindingSetsIterator.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/MultipleBindingSetsIterator.java
index 5d4d3c1..dd84e4d 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/MultipleBindingSetsIterator.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/MultipleBindingSetsIterator.java
@@ -19,18 +19,16 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.LookAheadIteration;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-
import java.util.ArrayList;
import java.util.Collection;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.LookAheadIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+
/**
*/
public class MultipleBindingSetsIterator extends LookAheadIteration<BindingSet, QueryEvaluationException> {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelEvaluationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelEvaluationStrategyImpl.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelEvaluationStrategyImpl.java
index a3b70b6..47e5269 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelEvaluationStrategyImpl.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelEvaluationStrategyImpl.java
@@ -19,16 +19,6 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.ConvertingIteration;
-import info.aduna.iteration.EmptyIteration;
-import info.aduna.iteration.Iteration;
-import info.aduna.iteration.IteratorIteration;
-import info.aduna.iteration.LimitIteration;
-import info.aduna.iteration.OffsetIteration;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -38,6 +28,7 @@ import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import org.apache.log4j.Logger;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.utils.NullableStatementImpl;
@@ -47,35 +38,37 @@ import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
import org.apache.rya.rdftriplestore.utils.TransitivePropertySP;
-
-import org.apache.log4j.Logger;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.Slice;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl;
-import org.openrdf.query.algebra.evaluation.iterator.FilterIterator;
-import org.openrdf.query.algebra.evaluation.iterator.JoinIterator;
-import org.openrdf.query.algebra.evaluation.util.QueryEvaluationUtil;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.ConvertingIteration;
+import org.eclipse.rdf4j.common.iteration.EmptyIteration;
+import org.eclipse.rdf4j.common.iteration.Iteration;
+import org.eclipse.rdf4j.common.iteration.IteratorIteration;
+import org.eclipse.rdf4j.common.iteration.LimitIteration;
+import org.eclipse.rdf4j.common.iteration.OffsetIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.Slice;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.StrictEvaluationStrategy;
+import org.eclipse.rdf4j.query.algebra.evaluation.iterator.FilterIterator;
+import org.eclipse.rdf4j.query.algebra.evaluation.iterator.JoinIterator;
import com.google.common.collect.Lists;
/**
*/
-public class ParallelEvaluationStrategyImpl extends EvaluationStrategyImpl {
+public class ParallelEvaluationStrategyImpl extends StrictEvaluationStrategy {
private static Logger logger = Logger.getLogger(ParallelEvaluationStrategyImpl.class);
private int numOfThreads = 10;
@@ -86,7 +79,7 @@ public class ParallelEvaluationStrategyImpl extends EvaluationStrategyImpl {
public ParallelEvaluationStrategyImpl(StoreTripleSource tripleSource, InferenceEngine inferenceEngine,
Dataset dataset, RdfCloudTripleStoreConfiguration conf) {
- super(tripleSource, dataset);
+ super(tripleSource, dataset, null);
Integer nthreads = conf.getNumThreads();
this.numOfThreads = (nthreads != null) ? nthreads : this.numOfThreads;
Boolean val = conf.isPerformant();
@@ -185,7 +178,7 @@ public class ParallelEvaluationStrategyImpl extends EvaluationStrategyImpl {
Set<Statement> sts = null;
try {
sts = inferenceEngine.findTransitiveProperty((Resource) getVarValue(subjVar),
- (URI) getVarValue(predVar), getVarValue(objVar), (Resource) getVarValue(cntxtVar));
+ (IRI) getVarValue(predVar), getVarValue(objVar), (Resource) getVarValue(cntxtVar));
} catch (InferenceEngineException e) {
throw new QueryEvaluationException(e);
}
@@ -203,11 +196,11 @@ public class ParallelEvaluationStrategyImpl extends EvaluationStrategyImpl {
Value objValue = getVarValue(objVar, binding);
Resource contxtValue = (Resource) getVarValue(cntxtVar, binding);
if ((subjValue != null && !(subjValue instanceof Resource)) ||
- (predValue != null && !(predValue instanceof URI))) {
+ (predValue != null && !(predValue instanceof IRI))) {
continue;
}
stmts.add(new RdfCloudTripleStoreUtils.CustomEntry<Statement, BindingSet>(
- new NullableStatementImpl((Resource) subjValue, (URI) predValue, objValue, contxtValue), binding));
+ new NullableStatementImpl((Resource) subjValue, (IRI) predValue, objValue, contxtValue), binding));
}
if (stmts.size() == 0) {
return new EmptyIteration();
@@ -259,14 +252,14 @@ public class ParallelEvaluationStrategyImpl extends EvaluationStrategyImpl {
return super.evaluate(expr, bindings);
}
- public CloseableIteration evaluate(Slice slice, BindingSet bindings)
+ public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Slice slice, BindingSet bindings)
throws QueryEvaluationException {
- CloseableIteration result = evaluate(slice.getArg(), bindings);
+ CloseableIteration<BindingSet, QueryEvaluationException> result = evaluate(slice.getArg(), bindings);
if (slice.hasOffset()) {
- result = new OffsetIteration(result, slice.getOffset());
+ result = new OffsetIteration<BindingSet, QueryEvaluationException>(result, slice.getOffset());
}
if (slice.hasLimit()) {
- result = new LimitIteration(result, slice.getLimit());
+ result = new LimitIteration<BindingSet, QueryEvaluationException>(result, slice.getLimit());
}
return result;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelJoinIterator.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelJoinIterator.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelJoinIterator.java
index 5ee9802..1ffeb4a 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelJoinIterator.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ParallelJoinIterator.java
@@ -19,22 +19,19 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.LookAheadIteration;
-
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.EvaluationStrategy;
-import org.openrdf.query.impl.EmptyBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.LookAheadIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy;
+import org.eclipse.rdf4j.query.impl.EmptyBindingSet;
/**
*/
@@ -85,7 +82,7 @@ public class ParallelJoinIterator extends LookAheadIteration<BindingSet, QueryEv
try {
for (int i = 0; i < batch; i++) {
if (leftIter.hasNext()) {
- ParallelIteratorWork work = new ParallelIteratorWork((BindingSet) leftIter.next(), join.getRightArg());
+ ParallelIteratorWork work = new ParallelIteratorWork(leftIter.next(), join.getRightArg());
workQueue.add(work);
executorService.execute(work);
} else
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/PushJoinDownVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/PushJoinDownVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/PushJoinDownVisitor.java
index ecf4c7b..2cff052 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/PushJoinDownVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/PushJoinDownVisitor.java
@@ -19,18 +19,16 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Class ReorderJoinVisitor
* Date: Apr 11, 2011
* Time: 10:16:15 PM
*/
-public class PushJoinDownVisitor extends QueryModelVisitorBase<Exception> {
+public class PushJoinDownVisitor extends AbstractQueryModelVisitor<Exception> {
@Override
public void meet(final Join node) throws Exception {
super.meet(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinOptimizer.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinOptimizer.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinOptimizer.java
index b5d5c43..ab7c8ad 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinOptimizer.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinOptimizer.java
@@ -1,14 +1,3 @@
-package org.apache.rya.rdftriplestore.evaluation;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.rya.rdftriplestore.utils.DefaultStatistics;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,9 +6,9 @@ import org.apache.rya.rdftriplestore.utils.DefaultStatistics;
* 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
@@ -27,20 +16,27 @@ import org.apache.rya.rdftriplestore.utils.DefaultStatistics;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.rdftriplestore.evaluation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
-
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
+import org.apache.rya.rdftriplestore.utils.DefaultStatistics;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
/**
* A query optimizer that re-orders nested Joins.
@@ -72,7 +68,7 @@ public class QueryJoinOptimizer implements QueryOptimizer {
}
}
- protected class JoinVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected class JoinVisitor extends AbstractQueryModelVisitor<RuntimeException> {
Set<String> boundVars = new HashSet<String>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizer.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizer.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizer.java
index 8fc437a..3553c8e 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizer.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizer.java
@@ -19,8 +19,6 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -30,14 +28,13 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
public class QueryJoinSelectOptimizer implements QueryOptimizer {
@@ -61,7 +58,7 @@ public class QueryJoinSelectOptimizer implements QueryOptimizer {
tupleExpr.visit(new JoinVisitor());
}
- protected class JoinVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected class JoinVisitor extends AbstractQueryModelVisitor<RuntimeException> {
@Override
public void meet(Join node) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreEvaluationStatistics.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreEvaluationStatistics.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreEvaluationStatistics.java
index b7698cf..f4abd7e 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreEvaluationStatistics.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreEvaluationStatistics.java
@@ -19,10 +19,7 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
import static com.google.common.base.Preconditions.checkNotNull;
-//import static RdfCloudTripleStoreUtils.getTtlValueConverter;
import java.util.ArrayList;
import java.util.Collection;
@@ -35,21 +32,21 @@ import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.api.persist.RdfEvalStatsDAO.CARDINALITY_OF;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.BinaryTupleOperator;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.Slice;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.Slice;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
/**
* Class RdfCloudTripleStoreEvaluationStatistics
@@ -113,7 +110,7 @@ public class RdfCloudTripleStoreEvaluationStatistics<C extends RdfCloudTripleSto
final Var subjectVar = sp.getSubjectVar();
final Resource subj = (Resource) getConstantValue(subjectVar);
final Var predicateVar = sp.getPredicateVar();
- final URI pred = (URI) getConstantValue(predicateVar);
+ final IRI pred = (IRI) getConstantValue(predicateVar);
final Var objectVar = sp.getObjectVar();
final Value obj = getConstantValue(objectVar);
final Resource context = (Resource) getConstantValue(sp.getContextVar());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatistics.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatistics.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatistics.java
index 09435e7..27882f5 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatistics.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatistics.java
@@ -19,8 +19,6 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
import static com.google.common.base.Preconditions.checkNotNull;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
@@ -28,8 +26,8 @@ import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
public class RdfCloudTripleStoreSelectivityEvaluationStatistics<C extends RdfCloudTripleStoreConfiguration> extends RdfCloudTripleStoreEvaluationStatistics {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ReorderJoinVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ReorderJoinVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ReorderJoinVisitor.java
index 2ae159f..03ef28f 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ReorderJoinVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ReorderJoinVisitor.java
@@ -19,19 +19,17 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Class ReorderJoinVisitor
* Date: Apr 11, 2011
* Time: 10:16:15 PM
*/
-public class ReorderJoinVisitor extends QueryModelVisitorBase<Exception> {
+public class ReorderJoinVisitor extends AbstractQueryModelVisitor<Exception> {
@Override
public void meet(final Join node) throws Exception {
super.meet(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/SeparateFilterJoinsVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/SeparateFilterJoinsVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/SeparateFilterJoinsVisitor.java
index 8f24220..d1f758b 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/SeparateFilterJoinsVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/SeparateFilterJoinsVisitor.java
@@ -18,12 +18,13 @@ package org.apache.rya.rdftriplestore.evaluation;
* specific language governing permissions and limitations
* under the License.
*/
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* TODO: This might be a very bad thing. It may force all AND and not allow ORs?. Depends on how they do the bindings.
@@ -31,7 +32,7 @@ import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
* Date: Apr 11, 2011
* Time: 10:16:15 PM
*/
-public class SeparateFilterJoinsVisitor extends QueryModelVisitorBase<Exception> {
+public class SeparateFilterJoinsVisitor extends AbstractQueryModelVisitor<Exception> {
@Override
public void meet(final Filter node) throws Exception {
super.meet(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AbstractInferVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AbstractInferVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AbstractInferVisitor.java
index b1c7eb5..90cdf6e 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AbstractInferVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AbstractInferVisitor.java
@@ -22,11 +22,11 @@ package org.apache.rya.rdftriplestore.inference;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
import org.apache.rya.rdftriplestore.utils.TransitivePropertySP;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -35,7 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* Date: Mar 14, 2012
* Time: 5:33:01 PM
*/
-public class AbstractInferVisitor extends QueryModelVisitorBase<Exception> {
+public class AbstractInferVisitor extends AbstractQueryModelVisitor<Exception> {
static Var EXPANDED = new Var("infer-expanded");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitor.java
index 26ae289..d609ac6 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitor.java
@@ -25,12 +25,12 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Expands the query tree to account for any universal class expressions (property restrictions
@@ -80,7 +80,7 @@ public class AllValuesFromVisitor extends AbstractInferVisitor {
// Only applies to type queries where the type is defined
if (predVar != null && RDF.TYPE.equals(predVar.getValue()) && objVar != null && objVar.getValue() instanceof Resource) {
final Resource typeToInfer = (Resource) objVar.getValue();
- Map<Resource, Set<URI>> relevantAvfRestrictions = inferenceEngine.getAllValuesFromByValueType(typeToInfer);
+ Map<Resource, Set<IRI>> relevantAvfRestrictions = inferenceEngine.getAllValuesFromByValueType(typeToInfer);
if (!relevantAvfRestrictions.isEmpty()) {
// We can infer the queried type if, for an allValuesFrom restriction type
// associated with the queried type, some anonymous neighboring node belongs to the
@@ -99,7 +99,7 @@ public class AllValuesFromVisitor extends AbstractInferVisitor {
final FixedStatementPattern avfPropertyTypes = new FixedStatementPattern(avfTypeVar,
new Var(OWL.ONPROPERTY.stringValue(), OWL.ONPROPERTY), avfPredVar);
for (Resource avfRestrictionType : relevantAvfRestrictions.keySet()) {
- for (URI avfProperty : relevantAvfRestrictions.get(avfRestrictionType)) {
+ for (IRI avfProperty : relevantAvfRestrictions.get(avfRestrictionType)) {
avfPropertyTypes.statements.add(new NullableStatementImpl(avfRestrictionType,
OWL.ONPROPERTY, avfProperty));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DoNotExpandSP.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DoNotExpandSP.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DoNotExpandSP.java
index 717e48a..22e7313 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DoNotExpandSP.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DoNotExpandSP.java
@@ -19,10 +19,8 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Class DoNotExpandSP
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitor.java
index 6445286..b13398e 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitor.java
@@ -24,12 +24,12 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Expands the query tree to account for any relevant domain and range information known to the
@@ -72,12 +72,12 @@ public class DomainRangeVisitor extends AbstractInferVisitor {
final Var contextVar = node.getContextVar();
// Only applies to statement patterns that query for members of a defined type.
if (predVar != null && RDF.TYPE.equals(predVar.getValue())
- && objVar != null && objVar.getValue() instanceof URI) {
- final URI inferredType = (URI) objVar.getValue();
+ && objVar != null && objVar.getValue() instanceof IRI) {
+ final IRI inferredType = (IRI) objVar.getValue();
// Preserve the original node so explicit type assertions are still matched:
TupleExpr currentNode = node.clone();
// If there are any properties with this type as domain, check for appropriate triples:
- final Set<URI> domainProperties = inferenceEngine.getPropertiesWithDomain(inferredType);
+ final Set<IRI> domainProperties = inferenceEngine.getPropertiesWithDomain(inferredType);
if (!domainProperties.isEmpty()) {
Var domainPredVar = new Var("p-" + UUID.randomUUID());
Var domainObjVar = new Var("o-" + UUID.randomUUID());
@@ -86,14 +86,14 @@ public class DomainRangeVisitor extends AbstractInferVisitor {
StatementPattern domainSP = new DoNotExpandSP(subjVar, domainPredVar, domainObjVar, contextVar);
// Enumerate predicates having this type as domain
FixedStatementPattern domainFSP = new FixedStatementPattern(domainPredVar, domainVar, objVar);
- for (URI property : domainProperties) {
+ for (IRI property : domainProperties) {
domainFSP.statements.add(new NullableStatementImpl(property, RDFS.DOMAIN, inferredType));
}
// For each such predicate, any triple <subjVar predicate _:any> implies the type
currentNode = new InferUnion(currentNode, new InferJoin(domainFSP, domainSP));
}
// If there are any properties with this type as range, check for appropriate triples:
- final Set<URI> rangeProperties = inferenceEngine.getPropertiesWithRange(inferredType);
+ final Set<IRI> rangeProperties = inferenceEngine.getPropertiesWithRange(inferredType);
if (!rangeProperties.isEmpty()) {
Var rangePredVar = new Var("p-" + UUID.randomUUID());
Var rangeSubjVar = new Var("s-" + UUID.randomUUID());
@@ -102,7 +102,7 @@ public class DomainRangeVisitor extends AbstractInferVisitor {
StatementPattern rangeSP = new DoNotExpandSP(rangeSubjVar, rangePredVar, subjVar, contextVar);
// Enumerate predicates having this type as range
FixedStatementPattern rangeFSP = new FixedStatementPattern(rangePredVar, rangeVar, objVar);
- for (URI property : rangeProperties) {
+ for (IRI property : rangeProperties) {
rangeFSP.statements.add(new NullableStatementImpl(property, RDFS.RANGE, inferredType));
}
// For each such predicate, any triple <_:any predicate subjVar> implies the type
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitor.java
index 3077eb4..43eae4a 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitor.java
@@ -19,13 +19,13 @@
package org.apache.rya.rdftriplestore.inference;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Expands the query tree to account for any relevant has-self class expressions
@@ -61,15 +61,15 @@ public class HasSelfVisitor extends AbstractInferVisitor {
@Override
protected void meetSP(final StatementPattern node) throws Exception {
- final URI pred = (URI) node.getPredicateVar().getValue();
+ final IRI pred = (IRI) node.getPredicateVar().getValue();
final Var obj = node.getObjectVar();
//if originalSP like (?s rdf:type :C1): require that C1 is defined, i.e. not a variable
// node <- originalSP
final StatementPattern clone = node.clone();
if (RDF.TYPE.equals(pred) && obj.isConstant()) {
//for property in getHasSelfImplyingType(C1):
- if (obj.getValue() instanceof URI) {
- for (final URI property : inferenceEngine.getHasSelfImplyingType((URI) obj.getValue())) {
+ if (obj.getValue() instanceof IRI) {
+ for (final IRI property : inferenceEngine.getHasSelfImplyingType((IRI) obj.getValue())) {
//node <- InferUnion(node, StatementPattern(?s, property, ?s)).
final InferUnion union = new InferUnion(clone,
new StatementPattern(clone.getSubjectVar(),
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
index 43ca579..0bcbc6b 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/HasValueVisitor.java
@@ -25,14 +25,14 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Expands the query tree to account for any relevant has-value class
@@ -94,17 +94,17 @@ public class HasValueVisitor extends AbstractInferVisitor {
// { ?var rdf:type :Restriction } and { ?var :property ?value }
// Both require defined predicate
if (predVar != null && predVar.getValue() != null) {
- final URI predURI = (URI) predVar.getValue();
+ final IRI predURI = (IRI) predVar.getValue();
if (RDF.TYPE.equals(predURI) && objVar != null && objVar.getValue() != null
&& objVar.getValue() instanceof Resource) {
// If the predicate is rdf:type and the type is specified, check whether it can be
// inferred using any hasValue restriction(s)
final Resource objType = (Resource) objVar.getValue();
- final Map<URI, Set<Value>> sufficientValues = inferenceEngine.getHasValueByType(objType);
+ final Map<IRI, Set<Value>> sufficientValues = inferenceEngine.getHasValueByType(objType);
if (sufficientValues.size() > 0) {
final Var valueVar = new Var("v-" + UUID.randomUUID());
TupleExpr currentNode = node.clone();
- for (URI property : sufficientValues.keySet()) {
+ for (IRI property : sufficientValues.keySet()) {
final Var propVar = new Var(property.toString(), property);
final TupleExpr valueSP = new DoNotExpandSP(subjVar, propVar, valueVar);
final FixedStatementPattern relevantValues = new FixedStatementPattern(objVar, propVar, valueVar);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferJoin.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferJoin.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferJoin.java
index de18e14..4e1ea77 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferJoin.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferJoin.java
@@ -19,14 +19,12 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.TupleExpr;
-
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+
/**
* Class InferJoin
* Date: Apr 16, 2011
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferUnion.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferUnion.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferUnion.java
index f783881..10390df 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferUnion.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferUnion.java
@@ -19,14 +19,12 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
-
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+
/**
* Class InferUnion
* Date: Mar 14, 2012
[13/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
index bbdcfec..ca00934 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -26,8 +27,8 @@ import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
+import org.eclipse.rdf4j.model.Statement;
import org.junit.Assert;
-import org.openrdf.model.Statement;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetPcjMetadataIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetPcjMetadataIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetPcjMetadataIT.java
index 7676657..926af3e 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetPcjMetadataIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetPcjMetadataIT.java
@@ -40,11 +40,11 @@ import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.ShiftVarOrderFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.SailException;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQueryMetadataDAOIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQueryMetadataDAOIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQueryMetadataDAOIT.java
index 384ec5d..551afa6 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQueryMetadataDAOIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/FluoQueryMetadataDAOIT.java
@@ -38,13 +38,13 @@ import org.apache.rya.indexing.pcj.fluo.app.NodeType;
import org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
/**
* Integration tests the methods of {@link FluoQueryMetadataDAO}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
index 5c8a1be..555e002 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
@@ -60,11 +60,11 @@ import org.apache.rya.indexing.pcj.fluo.app.util.FluoQueryUtils;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -72,8 +72,8 @@ import com.google.common.base.Preconditions;
public class BatchIT extends RyaExportITBase {
private static final Logger log = Logger.getLogger(BatchIT.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final FluoQueryMetadataDAO dao = new FluoQueryMetadataDAO();
- private static final ValueFactory vf = new ValueFactoryImpl();
@Test
public void simpleScanDelete() throws Exception {
@@ -140,12 +140,12 @@ public class BatchIT extends RyaExportITBase {
String joinId = ids.get(2);
String rightSp = ids.get(4);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("subject", vf.createURI("urn:subject_1"));
- bs.addBinding("object1", vf.createURI("urn:object_0"));
+ bs.addBinding("subject", VF.createIRI("urn:subject_1"));
+ bs.addBinding("object1", VF.createIRI("urn:object_0"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
//create sharded span for deletion
- URI uri = vf.createURI("urn:subject_1");
+ IRI uri = VF.createIRI("urn:subject_1");
Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, uri);
Span span = Span.prefix(prefixBytes);
@@ -190,11 +190,11 @@ public class BatchIT extends RyaExportITBase {
String joinId = ids.get(2);
String rightSp = ids.get(4);
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("subject", vf.createURI("urn:subject_1"));
- bs.addBinding("object1", vf.createURI("urn:object_0"));
+ bs.addBinding("subject", VF.createIRI("urn:subject_1"));
+ bs.addBinding("object1", VF.createIRI("urn:object_0"));
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
- URI uri = vf.createURI("urn:subject_1");
+ IRI uri = VF.createIRI("urn:subject_1");
Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(rightSp, uri);
Span span = Span.prefix(prefixBytes);
@@ -368,7 +368,7 @@ public class BatchIT extends RyaExportITBase {
for (int i = 0; i < ids.size(); i++) {
String id = ids.get(i);
String bsPrefix = prefixes.get(i);
- URI uri = vf.createURI(bsPrefix);
+ IRI uri = VF.createIRI(bsPrefix);
Bytes prefixBytes = BindingHashShardingFunction.getShardedScanPrefix(id, uri);
NodeType type = NodeType.fromNodeId(id).get();
Column bsCol = type.getResultColumn();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeleteIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeleteIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeleteIT.java
index ef5ab34..933a698 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeleteIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeleteIT.java
@@ -37,11 +37,11 @@ import org.apache.rya.api.client.RyaClient;
import org.apache.rya.api.client.accumulo.AccumuloRyaClientFactory;
import org.apache.rya.indexing.pcj.fluo.api.DeleteFluoPcj;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.collect.Sets;
@@ -60,18 +60,18 @@ public class CreateDeleteIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadData(sparql, statements);
@@ -100,11 +100,11 @@ public class CreateDeleteIT extends RyaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(0.99)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(0.99)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadData(sparql, statements);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeletePeriodicPCJ.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeletePeriodicPCJ.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeletePeriodicPCJ.java
index eb21b34..46fa2c1 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeletePeriodicPCJ.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/CreateDeletePeriodicPCJ.java
@@ -60,10 +60,10 @@ import org.apache.rya.periodic.notification.notification.CommandNotification;
import org.apache.rya.periodic.notification.notification.CommandNotification.Command;
import org.apache.rya.periodic.notification.registration.KafkaNotificationRegistrationClient;
import org.apache.rya.periodic.notification.serialization.CommandNotificationSerializer;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.Sets;
@@ -79,7 +79,7 @@ public class CreateDeletePeriodicPCJ extends KafkaExportITBase {
+ "?obs <uri:hasId> ?id }"; // n
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
ZonedDateTime time = ZonedDateTime.now();
@@ -96,18 +96,18 @@ public class CreateDeletePeriodicPCJ extends KafkaExportITBase {
String time4 = zTime4.format(DateTimeFormatter.ISO_INSTANT);
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time1))),
- vf.createStatement(vf.createURI("urn:obs_1"), vf.createURI("uri:hasId"), vf.createLiteral("id_1")),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_1"), vf.createIRI("uri:hasId"), vf.createLiteral("id_1")),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time2))),
- vf.createStatement(vf.createURI("urn:obs_2"), vf.createURI("uri:hasId"), vf.createLiteral("id_2")),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_2"), vf.createIRI("uri:hasId"), vf.createLiteral("id_2")),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time3))),
- vf.createStatement(vf.createURI("urn:obs_3"), vf.createURI("uri:hasId"), vf.createLiteral("id_3")),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasTime"),
+ vf.createStatement(vf.createIRI("urn:obs_3"), vf.createIRI("uri:hasId"), vf.createLiteral("id_3")),
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasTime"),
vf.createLiteral(dtf.newXMLGregorianCalendar(time4))),
- vf.createStatement(vf.createURI("urn:obs_4"), vf.createURI("uri:hasId"), vf.createLiteral("id_4")));
+ vf.createStatement(vf.createIRI("urn:obs_4"), vf.createIRI("uri:hasId"), vf.createLiteral("id_4")));
runTest(query, statements, 30);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
index 866d32b..ff2dc28 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
@@ -35,13 +35,13 @@ import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -64,28 +64,28 @@ public class InputIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Bob"));
+ bs.addBinding("x", vf.createIRI("http://Bob"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Charlie"));
+ bs.addBinding("x", vf.createIRI("http://Charlie"));
expected.add(bs);
// Load the historic data into Rya.
@@ -144,15 +144,15 @@ public class InputIT extends RyaExportITBase {
new RyaStatement(new RyaURI("http://David"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")));
// The expected results of the SPARQL query once the PCJ has been computed.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Bob"));
+ bs.addBinding("x", vf.createIRI("http://Bob"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Charlie"));
+ bs.addBinding("x", vf.createIRI("http://Charlie"));
expected.add(bs);
// Create the PCJ table.
@@ -172,7 +172,7 @@ public class InputIT extends RyaExportITBase {
}
// Stream the data into Fluo.
- new InsertTriples().insert(fluoClient, streamedTriples, Optional.<String>absent());
+ new InsertTriples().insert(fluoClient, streamedTriples, Optional.absent());
// Verify the end results of the query match the expected results.
super.getMiniFluo().waitForObservers();
@@ -204,10 +204,10 @@ public class InputIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
@@ -236,7 +236,7 @@ public class InputIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Alice"));
+ bs.addBinding("x", vf.createIRI("http://Alice"));
expected.add(bs);
Set<BindingSet> results = new HashSet<>();
@@ -249,13 +249,13 @@ public class InputIT extends RyaExportITBase {
assertEquals(expected, results);
// Stream the data into Fluo.
- new InsertTriples().insert(fluoClient, streamedTriples, Optional.<String>absent());
+ new InsertTriples().insert(fluoClient, streamedTriples, Optional.absent());
// Verify the end results of the query also include Frank.
super.getMiniFluo().waitForObservers();
bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Frank"));
+ bs.addBinding("x", vf.createIRI("http://Frank"));
expected.add(bs);
results = new HashSet<>();
@@ -286,10 +286,10 @@ public class InputIT extends RyaExportITBase {
"}";
// Triples that are loaded into Rya before the PCJ is created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> historicTriples = Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
@@ -300,7 +300,7 @@ public class InputIT extends RyaExportITBase {
final Set<BindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("x", vf.createURI("http://Alice"));
+ bs.addBinding("x", vf.createIRI("http://Alice"));
expected.add(bs);
// Load the historic data into Rya.
@@ -331,7 +331,7 @@ public class InputIT extends RyaExportITBase {
assertEquals(expected, results);
// Stream the same Alice triple into Fluo.
- new InsertTriples().insert(fluoClient, streamedTriples, Optional.<String>absent());
+ new InsertTriples().insert(fluoClient, streamedTriples, Optional.absent());
// Verify the end results of the query is stiill only Alice.
super.getMiniFluo().waitForObservers();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
index dd79c37..03a9b02 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
@@ -35,13 +35,13 @@ import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.pcj.fluo.test.base.KafkaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Sets;
@@ -67,24 +67,24 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Triples that will be streamed into Fluo after the PCJ has been created.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements =
Sets.newHashSet(
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Bob")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Charlie")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://David")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://livesIn"), vf.createURI("http://Leeds")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://livesIn"), vf.createURI("http://London")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://worksAt"), vf.createURI("http://Chipotle")));
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Bob")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Charlie")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://David")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://livesIn"), vf.createIRI("http://Leeds")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://livesIn"), vf.createIRI("http://London")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://worksAt"), vf.createIRI("http://Chipotle")));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -93,21 +93,21 @@ public class KafkaExportIT extends KafkaExportITBase {
final Set<BindingSet> expectedResult = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Bob"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Bob"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResult.add( new VisibilityBindingSet(bs) );
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://Charlie"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://Charlie"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResult.add( new VisibilityBindingSet(bs) );
bs = new MapBindingSet();
- bs.addBinding("customer", vf.createURI("http://Alice"));
- bs.addBinding("worker", vf.createURI("http://David"));
- bs.addBinding("city", vf.createURI("http://London"));
+ bs.addBinding("customer", vf.createIRI("http://Alice"));
+ bs.addBinding("worker", vf.createIRI("http://David"));
+ bs.addBinding("city", vf.createIRI("http://London"));
expectedResult.add( new VisibilityBindingSet(bs) );
// Ensure the last result matches the expected result.
@@ -124,11 +124,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(0.99)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(0.99)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -151,11 +151,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(0.99)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(0.99)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -178,15 +178,15 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
// Three that are part of the count.
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:id"), vf.createLiteral(UUID.randomUUID().toString())),
// One that is not.
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(3.99)));
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(3.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -209,11 +209,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:count"), vf.createLiteral(5)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:count"), vf.createLiteral(7)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:count"), vf.createLiteral(2)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:count"), vf.createLiteral(5)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:count"), vf.createLiteral(7)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:count"), vf.createLiteral(2)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -236,11 +236,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(3)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(4)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(8)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(3)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(4)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(8)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -264,11 +264,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(0.99)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(0.99)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -291,11 +291,11 @@ public class KafkaExportIT extends KafkaExportITBase {
"}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(5.25)),
- vf.createStatement(vf.createURI("urn:gum"), vf.createURI("urn:price"), vf.createLiteral(7)),
- vf.createStatement(vf.createURI("urn:sandwich"), vf.createURI("urn:price"), vf.createLiteral(2.75)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(5.25)),
+ vf.createStatement(vf.createIRI("urn:gum"), vf.createIRI("urn:price"), vf.createLiteral(7)),
+ vf.createStatement(vf.createIRI("urn:sandwich"), vf.createIRI("urn:price"), vf.createLiteral(2.75)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -320,13 +320,13 @@ public class KafkaExportIT extends KafkaExportITBase {
"GROUP BY ?item";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(5.25)),
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(7)),
- vf.createStatement(vf.createURI("urn:apple"), vf.createURI("urn:price"), vf.createLiteral(2.75)),
- vf.createStatement(vf.createURI("urn:banana"), vf.createURI("urn:price"), vf.createLiteral(2.75)),
- vf.createStatement(vf.createURI("urn:banana"), vf.createURI("urn:price"), vf.createLiteral(1.99)));
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(5.25)),
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(7)),
+ vf.createStatement(vf.createIRI("urn:apple"), vf.createIRI("urn:price"), vf.createLiteral(2.75)),
+ vf.createStatement(vf.createIRI("urn:banana"), vf.createIRI("urn:price"), vf.createLiteral(2.75)),
+ vf.createStatement(vf.createIRI("urn:banana"), vf.createIRI("urn:price"), vf.createLiteral(1.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -335,12 +335,12 @@ public class KafkaExportIT extends KafkaExportITBase {
final Set<VisibilityBindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("item", vf.createURI("urn:apple"));
+ bs.addBinding("item", vf.createIRI("urn:apple"));
bs.addBinding("averagePrice", vf.createLiteral("5.0", XMLSchema.DECIMAL));
expectedResults.add( new VisibilityBindingSet(bs) );
bs = new MapBindingSet();
- bs.addBinding("item", vf.createURI("urn:banana"));
+ bs.addBinding("item", vf.createIRI("urn:banana"));
bs.addBinding("averagePrice", vf.createLiteral("2.37", XMLSchema.DECIMAL));
expectedResults.add( new VisibilityBindingSet(bs) );
@@ -361,33 +361,33 @@ public class KafkaExportIT extends KafkaExportITBase {
"GROUP BY ?type ?location";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
// American items that will be averaged.
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:type"), vf.createLiteral("apple")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:type"), vf.createLiteral("apple")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:price"), vf.createLiteral(.99)),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:price"), vf.createLiteral(.99)),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:price"), vf.createLiteral(5.25)),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:price"), vf.createLiteral(5.25)),
// French items that will be averaged.
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:price"), vf.createLiteral(8.5)),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:price"), vf.createLiteral(8.5)),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:price"), vf.createLiteral(3.99)),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:type"), vf.createLiteral("cigarettes")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:price"), vf.createLiteral(3.99)),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:type"), vf.createLiteral("cigarettes")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -439,33 +439,33 @@ public class KafkaExportIT extends KafkaExportITBase {
"GROUP BY ?type ?location }}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
// American items that will be averaged.
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:type"), vf.createLiteral("apple")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:price"), vf.createLiteral(2.50)),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:type"), vf.createLiteral("apple")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:price"), vf.createLiteral(2.50)),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:price"), vf.createLiteral(4.25)),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:price"), vf.createLiteral(4.25)),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:price"), vf.createLiteral(5.25)),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:price"), vf.createLiteral(5.25)),
// French items that will be averaged.
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:type"), vf.createLiteral("cheese")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:price"), vf.createLiteral(8.5)),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:type"), vf.createLiteral("cheese")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:price"), vf.createLiteral(8.5)),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:price"), vf.createLiteral(3.99)),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:type"), vf.createLiteral("cigarettes")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:price"), vf.createLiteral(3.99)),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:type"), vf.createLiteral("cigarettes")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -513,36 +513,36 @@ public class KafkaExportIT extends KafkaExportITBase {
"GROUP BY ?type ?location }}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:type"), vf.createURI("urn:blue")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:1"), vf.createURI("urn:price"), vf.createLiteral(8.5)),
- vf.createStatement(vf.createURI("urn:blue"), vf.createURI("urn:hasMilkType"), vf.createLiteral("cow", XMLSchema.STRING)),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:type"), vf.createIRI("urn:blue")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:1"), vf.createIRI("urn:price"), vf.createLiteral(8.5)),
+ vf.createStatement(vf.createIRI("urn:blue"), vf.createIRI("urn:hasMilkType"), vf.createLiteral("cow", XMLSchema.STRING)),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:type"), vf.createURI("urn:american")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:2"), vf.createURI("urn:price"), vf.createLiteral(.99)),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:type"), vf.createIRI("urn:american")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:2"), vf.createIRI("urn:price"), vf.createLiteral(.99)),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:type"), vf.createURI("urn:cheddar")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:location"), vf.createLiteral("USA")),
- vf.createStatement(vf.createURI("urn:3"), vf.createURI("urn:price"), vf.createLiteral(5.25)),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:type"), vf.createIRI("urn:cheddar")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:location"), vf.createLiteral("USA")),
+ vf.createStatement(vf.createIRI("urn:3"), vf.createIRI("urn:price"), vf.createLiteral(5.25)),
// French items that will be averaged.
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:type"), vf.createURI("urn:goat")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:location"), vf.createLiteral("France")),
- vf.createStatement(vf.createURI("urn:4"), vf.createURI("urn:price"), vf.createLiteral(6.5)),
- vf.createStatement(vf.createURI("urn:goat"), vf.createURI("urn:hasMilkType"), vf.createLiteral("goat", XMLSchema.STRING)),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:type"), vf.createIRI("urn:goat")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:location"), vf.createLiteral("France")),
+ vf.createStatement(vf.createIRI("urn:4"), vf.createIRI("urn:price"), vf.createLiteral(6.5)),
+ vf.createStatement(vf.createIRI("urn:goat"), vf.createIRI("urn:hasMilkType"), vf.createLiteral("goat", XMLSchema.STRING)),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:type"), vf.createURI("urn:fontina")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:location"), vf.createLiteral("Italy")),
- vf.createStatement(vf.createURI("urn:5"), vf.createURI("urn:price"), vf.createLiteral(3.99)),
- vf.createStatement(vf.createURI("urn:fontina"), vf.createURI("urn:hasMilkType"), vf.createLiteral("cow", XMLSchema.STRING)),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:type"), vf.createIRI("urn:fontina")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:location"), vf.createLiteral("Italy")),
+ vf.createStatement(vf.createIRI("urn:5"), vf.createIRI("urn:price"), vf.createLiteral(3.99)),
+ vf.createStatement(vf.createIRI("urn:fontina"), vf.createIRI("urn:hasMilkType"), vf.createLiteral("cow", XMLSchema.STRING)),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:type"), vf.createURI("urn:fontina")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:location"), vf.createLiteral("Italy")),
- vf.createStatement(vf.createURI("urn:6"), vf.createURI("urn:price"), vf.createLiteral(4.99)));
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:type"), vf.createIRI("urn:fontina")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:location"), vf.createLiteral("Italy")),
+ vf.createStatement(vf.createIRI("urn:6"), vf.createIRI("urn:price"), vf.createLiteral(4.99)));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadDataAndCreateQuery(sparql, statements);
@@ -551,21 +551,21 @@ public class KafkaExportIT extends KafkaExportITBase {
final Set<VisibilityBindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("type", vf.createURI("urn:blue"));
+ bs.addBinding("type", vf.createIRI("urn:blue"));
bs.addBinding("location", vf.createLiteral("France", XMLSchema.STRING));
bs.addBinding("averagePrice", vf.createLiteral("8.5", XMLSchema.DECIMAL));
bs.addBinding("milkType", vf.createLiteral("cow", XMLSchema.STRING));
expectedResults.add( new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("type", vf.createURI("urn:goat"));
+ bs.addBinding("type", vf.createIRI("urn:goat"));
bs.addBinding("location", vf.createLiteral("France", XMLSchema.STRING));
bs.addBinding("averagePrice", vf.createLiteral("6.5", XMLSchema.DECIMAL));
bs.addBinding("milkType", vf.createLiteral("goat", XMLSchema.STRING));
expectedResults.add( new VisibilityBindingSet(bs) );
bs = new MapBindingSet();
- bs.addBinding("type", vf.createURI("urn:fontina"));
+ bs.addBinding("type", vf.createIRI("urn:fontina"));
bs.addBinding("location", vf.createLiteral("Italy", XMLSchema.STRING));
bs.addBinding("averagePrice", vf.createLiteral("4.49", XMLSchema.DECIMAL));
bs.addBinding("milkType", vf.createLiteral("cow", XMLSchema.STRING));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
index b2944ca..309d1ca 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo.integration;
* specific language governing permissions and limitations
* under the License.
*/
+
import static java.util.Objects.requireNonNull;
import java.util.ArrayList;
@@ -33,7 +34,6 @@ import java.util.stream.Collectors;
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.config.ObserverSpecification;
import org.apache.fluo.core.client.FluoClientImpl;
-import org.apache.fluo.recipes.test.FluoITHelper;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
@@ -58,13 +58,13 @@ import org.apache.rya.indexing.pcj.fluo.app.observers.QueryResultObserver;
import org.apache.rya.indexing.pcj.fluo.app.observers.StatementPatternObserver;
import org.apache.rya.indexing.pcj.fluo.app.observers.TripleObserver;
import org.apache.rya.pcj.fluo.test.base.KafkaExportITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.Sets;
@@ -114,11 +114,11 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
+ "?customer <urn:talksTo> ?worker. " + "?worker <urn:livesIn> ?city. " + "?worker <urn:worksAt> <urn:burgerShack>. " + "}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:Joe"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")),
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:livesIn"), vf.createURI("urn:London")),
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:burgerShack")));
+ vf.createStatement(vf.createIRI("urn:Joe"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")),
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:livesIn"), vf.createIRI("urn:London")),
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:burgerShack")));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadStatements(sparql, statements);
@@ -306,24 +306,24 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
+ "}GROUP BY ?location }}";
// Create the Statements that will be loaded into Rya.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("urn:obs1"), vf.createURI("urn:hasVelocity"), vf.createLiteral(77)),
- vf.createStatement(vf.createURI("urn:obs1"), vf.createURI("urn:hasLocation"), vf.createLiteral("OldTown")),
- vf.createStatement(vf.createURI("urn:obs2"), vf.createURI("urn:hasVelocity"), vf.createLiteral(81)),
- vf.createStatement(vf.createURI("urn:obs2"), vf.createURI("urn:hasLocation"), vf.createLiteral("OldTown")),
- vf.createStatement(vf.createURI("urn:obs3"), vf.createURI("urn:hasVelocity"), vf.createLiteral(70)),
- vf.createStatement(vf.createURI("urn:obs3"), vf.createURI("urn:hasLocation"), vf.createLiteral("OldTown")),
- vf.createStatement(vf.createURI("urn:obs5"), vf.createURI("urn:hasVelocity"), vf.createLiteral(87)),
- vf.createStatement(vf.createURI("urn:obs5"), vf.createURI("urn:hasLocation"), vf.createLiteral("Rosslyn")),
- vf.createStatement(vf.createURI("urn:obs6"), vf.createURI("urn:hasVelocity"), vf.createLiteral(81)),
- vf.createStatement(vf.createURI("urn:obs6"), vf.createURI("urn:hasLocation"), vf.createLiteral("Rosslyn")),
- vf.createStatement(vf.createURI("urn:obs7"), vf.createURI("urn:hasVelocity"), vf.createLiteral(67)),
- vf.createStatement(vf.createURI("urn:obs7"), vf.createURI("urn:hasLocation"), vf.createLiteral("Clarendon")),
- vf.createStatement(vf.createURI("urn:obs8"), vf.createURI("urn:hasVelocity"), vf.createLiteral(77)),
- vf.createStatement(vf.createURI("urn:obs8"), vf.createURI("urn:hasLocation"), vf.createLiteral("Ballston")),
- vf.createStatement(vf.createURI("urn:obs9"), vf.createURI("urn:hasVelocity"), vf.createLiteral(87)),
- vf.createStatement(vf.createURI("urn:obs9"), vf.createURI("urn:hasLocation"), vf.createLiteral("FallsChurch")));
+ vf.createStatement(vf.createIRI("urn:obs1"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(77)),
+ vf.createStatement(vf.createIRI("urn:obs1"), vf.createIRI("urn:hasLocation"), vf.createLiteral("OldTown")),
+ vf.createStatement(vf.createIRI("urn:obs2"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(81)),
+ vf.createStatement(vf.createIRI("urn:obs2"), vf.createIRI("urn:hasLocation"), vf.createLiteral("OldTown")),
+ vf.createStatement(vf.createIRI("urn:obs3"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(70)),
+ vf.createStatement(vf.createIRI("urn:obs3"), vf.createIRI("urn:hasLocation"), vf.createLiteral("OldTown")),
+ vf.createStatement(vf.createIRI("urn:obs5"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(87)),
+ vf.createStatement(vf.createIRI("urn:obs5"), vf.createIRI("urn:hasLocation"), vf.createLiteral("Rosslyn")),
+ vf.createStatement(vf.createIRI("urn:obs6"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(81)),
+ vf.createStatement(vf.createIRI("urn:obs6"), vf.createIRI("urn:hasLocation"), vf.createLiteral("Rosslyn")),
+ vf.createStatement(vf.createIRI("urn:obs7"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(67)),
+ vf.createStatement(vf.createIRI("urn:obs7"), vf.createIRI("urn:hasLocation"), vf.createLiteral("Clarendon")),
+ vf.createStatement(vf.createIRI("urn:obs8"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(77)),
+ vf.createStatement(vf.createIRI("urn:obs8"), vf.createIRI("urn:hasLocation"), vf.createLiteral("Ballston")),
+ vf.createStatement(vf.createIRI("urn:obs9"), vf.createIRI("urn:hasVelocity"), vf.createLiteral(87)),
+ vf.createStatement(vf.createIRI("urn:obs9"), vf.createIRI("urn:hasLocation"), vf.createLiteral("FallsChurch")));
// Create the PCJ in Fluo and load the statements into Rya.
final String pcjId = loadStatements(sparql, statements);
@@ -353,7 +353,7 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
expectedResults.add(subGraph2);
Assert.assertEquals(expectedResults.size(), results.size());
- ConstructGraphTestUtils.subGraphsEqualIgnoresBlankNode(expectedResults, results);;
+ ConstructGraphTestUtils.subGraphsEqualIgnoresBlankNode(expectedResults, results);
}
[31/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloInstall.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloInstall.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloInstall.java
index e5a8f50..7db7562 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloInstall.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloInstall.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -20,8 +20,6 @@ package org.apache.rya.api.client.accumulo;
import static java.util.Objects.requireNonNull;
-import java.util.Date;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
@@ -47,8 +45,8 @@ import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.Precomputed
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
@@ -164,9 +162,9 @@ public class AccumuloInstall extends AccumuloCommand implements Install {
// Statistics values.
.setProspectorDetails(
- new ProspectorDetails(Optional.<Date>absent()) )
+ new ProspectorDetails(Optional.absent()) )
.setJoinSelectivityDetails(
- new JoinSelectivityDetails(Optional.<Date>absent()) )
+ new JoinSelectivityDetails(Optional.absent()) )
.build();
// Initialize the table.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatements.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatements.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatements.java
index 9556bcf..6635b8b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatements.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatements.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -32,12 +32,12 @@ import org.apache.rya.api.client.RyaClientException;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.Statement;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFile.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFile.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFile.java
index 182432a..61e5717 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFile.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFile.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -35,14 +35,14 @@ import org.apache.rya.api.client.RyaClientException;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.UnsupportedRDFormatException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.rio.UnsupportedRDFormatException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJ.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJ.java b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJ.java
index 3fe99ef..115d3f8 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJ.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJ.java
@@ -51,19 +51,19 @@ import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandlerBase;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -161,7 +161,7 @@ public class MongoBatchUpdatePCJ implements BatchUpdatePCJ {
// Execute the query.
final List<VisibilityBindingSet> batch = new ArrayList<>(1000);
- tupleQuery.evaluate(new TupleQueryResultHandlerBase() {
+ tupleQuery.evaluate(new AbstractTupleQueryResultHandler() {
@Override
public void handleSolution(final BindingSet bindingSet) throws TupleQueryResultHandlerException {
final VisibilityBindingSet result = new VisibilityBindingSet(bindingSet, "");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQuery.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQuery.java b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQuery.java
index 7ce396e..b0a31e2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQuery.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQuery.java
@@ -32,16 +32,16 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoInstall.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoInstall.java b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoInstall.java
index 264dd78..359341d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoInstall.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoInstall.java
@@ -43,8 +43,8 @@ import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatements.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatements.java b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatements.java
index 8c9e0b5..8204f14 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatements.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatements.java
@@ -30,12 +30,12 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.Statement;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFile.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFile.java b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFile.java
index 244d02a..4dd79fa 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFile.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFile.java
@@ -33,13 +33,13 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/DocIdIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/DocIdIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/DocIdIndexer.java
index 42064f7..9f6eb78 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/DocIdIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/DocIdIndexer.java
@@ -19,29 +19,26 @@ package org.apache.rya.indexing;
* under the License.
*/
-
-import info.aduna.iteration.CloseableIteration;
-
import java.io.Closeable;
import java.io.IOException;
import java.util.Collection;
-import org.apache.rya.indexing.accumulo.entity.StarQuery;
-
import org.apache.accumulo.core.client.TableNotFoundException;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
+import org.apache.rya.indexing.accumulo.entity.StarQuery;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
public interface DocIdIndexer extends Closeable {
- public abstract CloseableIteration<BindingSet, QueryEvaluationException> queryDocIndex(StarQuery query,
+ public CloseableIteration<BindingSet, QueryEvaluationException> queryDocIndex(StarQuery query,
Collection<BindingSet> constraints) throws TableNotFoundException, QueryEvaluationException;
@Override
- public abstract void close() throws IOException;
+ public void close() throws IOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
index 6c4e05b..d5653a0 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/FilterFunctionOptimizer.java
@@ -19,10 +19,10 @@ package org.apache.rya.indexing;
* under the License.
*/
-
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -42,33 +42,32 @@ import org.apache.rya.indexing.accumulo.freetext.FreeTextTupleSet;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
import org.apache.rya.mongodb.MongoSecondaryIndex;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.And;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.And;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Lists;
public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
private static final Logger LOG = Logger.getLogger(FilterFunctionOptimizer.class);
- private final ValueFactory valueFactory = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private Configuration conf;
private FreeTextIndexer freeTextIndexer;
@@ -157,18 +156,18 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
tupleExpr.visit(fVisitor);
final List<IndexingExpr> results = Lists.newArrayList();
for(int i = 0; i < fVisitor.func.size(); i++){
- results.add(new IndexingExpr(fVisitor.func.get(i), matchStatement, fVisitor.args.get(i)));
+ results.add(new IndexingExpr(fVisitor.func.get(i), matchStatement, Arrays.stream(fVisitor.args.get(i)).toArray()));
}
removeMatchedPattern(tupleExpr, matchStatement, new IndexerExprReplacer(results));
}
//find vars contained in filters
- private static class SearchVarVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class SearchVarVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final Collection<Var> searchProperties = new ArrayList<>();
@Override
public void meet(final FunctionCall fn) {
- final URI fun = new URIImpl(fn.getURI());
+ final IRI fun = VF.createIRI(fn.getURI());
final Var result = IndexingFunctionRegistry.getResultVarFromFunctionCall(fun, fn.getArgs());
if (result != null && !searchProperties.contains(result)) {
searchProperties.add(result);
@@ -177,7 +176,7 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
}
//find StatementPatterns containing filter variables
- private static class MatchStatementVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class MatchStatementVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final Collection<Var> propertyVars;
private final Collection<Var> usedVars = new ArrayList<>();
private final List<StatementPattern> matchStatements = new ArrayList<>();
@@ -199,16 +198,16 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
}
}
- private abstract class AbstractEnhanceVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private abstract class AbstractEnhanceVisitor extends AbstractQueryModelVisitor<RuntimeException> {
final String matchVar;
- List<URI> func = Lists.newArrayList();
+ List<IRI> func = Lists.newArrayList();
List<Value[]> args = Lists.newArrayList();
public AbstractEnhanceVisitor(final String matchVar) {
this.matchVar = matchVar;
}
- protected void addFilter(final URI uri, final Value[] values) {
+ protected void addFilter(final IRI uri, final Value[] values) {
func.add(uri);
args.add(values);
}
@@ -223,12 +222,12 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
@Override
public void meet(final FunctionCall call) {
- final URI fnUri = valueFactory.createURI(call.getURI());
+ final IRI fnUri = VF.createIRI(call.getURI());
final Var resultVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(fnUri, call.getArgs());
if (resultVar != null && resultVar.getName().equals(matchVar)) {
- addFilter(valueFactory.createURI(call.getURI()), extractArguments(matchVar, call));
+ addFilter(VF.createIRI(call.getURI()), extractArguments(matchVar, call));
if (call.getParentNode() instanceof Filter || call.getParentNode() instanceof And || call.getParentNode() instanceof LeftJoin) {
- call.replaceWith(new ValueConstant(valueFactory.createLiteral(true)));
+ call.replaceWith(new ValueConstant(VF.createLiteral(true)));
} else {
throw new IllegalArgumentException("Query error: Found " + call + " as part of an expression that is too complex");
}
@@ -292,7 +291,7 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
public IndexerExprReplacer(final List<IndexingExpr> indxExpr) {
this.indxExpr = indxExpr;
- final URI func = indxExpr.get(0).getFunction();
+ final IRI func = indxExpr.get(0).getFunction();
type = IndexingFunctionRegistry.getFunctionType(func);
}
@@ -317,7 +316,7 @@ public class FilterFunctionOptimizer implements QueryOptimizer, Configurable {
}
}
- private static class VarExchangeVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class VarExchangeVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final StatementPattern exchangeVar;
public VarExchangeVisitor(final StatementPattern sp) {
exchangeVar = sp;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
index 4dbbde7..7745b01 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/FreeTextIndexer.java
@@ -1,10 +1,3 @@
-package org.apache.rya.indexing;
-
-import java.io.IOException;
-
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,11 +16,14 @@ import org.openrdf.query.QueryEvaluationException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing;
+import java.io.IOException;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
/**
* A repository to store, index, and retrieve {@link Statement}s based on freetext features.
@@ -44,5 +40,5 @@ public interface FreeTextIndexer extends RyaSecondaryIndexer {
* @return the set of statements that meet the query and other constraints.
* @throws IOException
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryText(String query, StatementConstraints contraints) throws IOException;
+ public CloseableIteration<Statement, QueryEvaluationException> queryText(String query, StatementConstraints contraints) throws IOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/GeoConstants.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/GeoConstants.java b/extras/indexing/src/main/java/org/apache/rya/indexing/GeoConstants.java
index 2cb8217..fc3402a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/GeoConstants.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/GeoConstants.java
@@ -19,29 +19,32 @@ package org.apache.rya.indexing;
* under the License.
*/
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* A set of URIs used in GeoSPARQL
*/
public class GeoConstants {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
public static final String NS_GEO = "http://www.opengis.net/ont/geosparql#";
public static final String NS_GEOF = "http://www.opengis.net/def/function/geosparql/";
- public static final URI XMLSCHEMA_OGC_WKT = new URIImpl(NS_GEO + "wktLiteral");
- public static final URI GEO_AS_WKT = new URIImpl(NS_GEO + "asWKT");
+ public static final IRI XMLSCHEMA_OGC_WKT = VF.createIRI(NS_GEO + "wktLiteral");
+ public static final IRI GEO_AS_WKT = VF.createIRI(NS_GEO + "asWKT");
- public static final URI XMLSCHEMA_OGC_GML = new URIImpl(NS_GEO + "gmlLiteral");
- public static final URI GEO_AS_GML = new URIImpl(NS_GEO + "asGML");
+ public static final IRI XMLSCHEMA_OGC_GML = VF.createIRI(NS_GEO + "gmlLiteral");
+ public static final IRI GEO_AS_GML = VF.createIRI(NS_GEO + "asGML");
- public static final URI GEO_SF_EQUALS = new URIImpl(NS_GEOF + "sfEquals");
- public static final URI GEO_SF_DISJOINT = new URIImpl(NS_GEOF + "sfDisjoint");
- public static final URI GEO_SF_INTERSECTS = new URIImpl(NS_GEOF + "sfIntersects");
- public static final URI GEO_SF_TOUCHES = new URIImpl(NS_GEOF + "sfTouches");
- public static final URI GEO_SF_CROSSES = new URIImpl(NS_GEOF + "sfCrosses");
- public static final URI GEO_SF_WITHIN = new URIImpl(NS_GEOF + "sfWithin");
- public static final URI GEO_SF_CONTAINS = new URIImpl(NS_GEOF + "sfContains");
- public static final URI GEO_SF_OVERLAPS = new URIImpl(NS_GEOF + "sfOverlaps");
- public static final URI GEO_SF_NEAR = new URIImpl(NS_GEOF + "sfNear");
+ public static final IRI GEO_SF_EQUALS = VF.createIRI(NS_GEOF + "sfEquals");
+ public static final IRI GEO_SF_DISJOINT = VF.createIRI(NS_GEOF + "sfDisjoint");
+ public static final IRI GEO_SF_INTERSECTS = VF.createIRI(NS_GEOF + "sfIntersects");
+ public static final IRI GEO_SF_TOUCHES = VF.createIRI(NS_GEOF + "sfTouches");
+ public static final IRI GEO_SF_CROSSES = VF.createIRI(NS_GEOF + "sfCrosses");
+ public static final IRI GEO_SF_WITHIN = VF.createIRI(NS_GEOF + "sfWithin");
+ public static final IRI GEO_SF_CONTAINS = VF.createIRI(NS_GEOF + "sfContains");
+ public static final IRI GEO_SF_OVERLAPS = VF.createIRI(NS_GEOF + "sfOverlaps");
+ public static final IRI GEO_SF_NEAR = VF.createIRI(NS_GEOF + "sfNear");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ExternalIndexMatcher.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ExternalIndexMatcher.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ExternalIndexMatcher.java
index 1acbe2f..d014ca8 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ExternalIndexMatcher.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ExternalIndexMatcher.java
@@ -19,10 +19,9 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface ExternalIndexMatcher {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessor.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessor.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessor.java
index 9cda09e..121aa79 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessor.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessor.java
@@ -19,10 +19,6 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
-
-
-
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
@@ -30,17 +26,16 @@ import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer.VarCollector;
-
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -186,7 +181,7 @@ public class GeneralizedExternalProcessor {
// moves StatementPatterns in query that also occur in index to bottom of
// query tree.
- private static class SPBubbleDownVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class SPBubbleDownVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private TupleExpr tuple;
private QueryModelNode indexQNode;
@@ -266,7 +261,7 @@ public class GeneralizedExternalProcessor {
// element in the query tree that occurs in compSet with replacement and
// returns
// the element that was replaced.
- private static class QNodeExchanger extends QueryModelVisitorBase<RuntimeException> {
+ private static class QNodeExchanger extends AbstractQueryModelVisitor<RuntimeException> {
private QueryModelNode toBeReplaced;
private QueryModelNode replacement;
@@ -308,7 +303,7 @@ public class GeneralizedExternalProcessor {
// SPBubbleDownVisitor has been called to position index StatementPatterns
// within query tree.
//could lead to problems if filter optimizer called before external processor
- private static class FilterBubbleDownVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class FilterBubbleDownVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private QueryModelNode filter;
private Set<QueryModelNode> compSet;
@@ -380,7 +375,7 @@ public class GeneralizedExternalProcessor {
// visitor which determines whether or not to reposition a filter by calling
// FilterBubbleDownVisitor
- private static class FilterBubbleManager extends QueryModelVisitorBase<RuntimeException> {
+ private static class FilterBubbleManager extends AbstractQueryModelVisitor<RuntimeException> {
private TupleExpr tuple;
private QueryModelNode indexQNode;
@@ -436,7 +431,7 @@ public class GeneralizedExternalProcessor {
// calling this method is that both SPBubbleDownVisitor and
// FilterBubbleManager have been called
// to position the StatementPatterns and Filters.
- private static class SubsetEqualsVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class SubsetEqualsVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private TupleExpr tuple;
private QueryModelNode indexQNode;
@@ -524,7 +519,7 @@ public class GeneralizedExternalProcessor {
// visitor which determines whether a query is valid (i.e. it does not
// contain nodes other than
// Projection, Join, Filter, StatementPattern )
- private static class ValidQueryVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class ValidQueryVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private boolean isValid = true;
@@ -561,7 +556,7 @@ public class GeneralizedExternalProcessor {
}
// repositions ExternalTuples above StatementPatterns within query tree
- private static class ExtTupleExchangeVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class ExtTupleExchangeVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> extTuples;
@@ -597,7 +592,7 @@ public class GeneralizedExternalProcessor {
}
- private static class ExternalTupleCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class ExternalTupleCollector extends AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> eSet = new HashSet<QueryModelNode>();
@@ -615,7 +610,7 @@ public class GeneralizedExternalProcessor {
}
- private static class FilterCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class FilterCollector extends AbstractQueryModelVisitor<RuntimeException> {
private List<QueryModelNode> filterList = Lists.newArrayList();
@@ -644,7 +639,7 @@ public class GeneralizedExternalProcessor {
}
// repositions ExternalTuples above StatementPatterns within query tree
- private static class BindingSetAssignmentExchangeVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class BindingSetAssignmentExchangeVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> bsas;
@@ -672,7 +667,7 @@ public class GeneralizedExternalProcessor {
}
- public static class BindingSetAssignmentCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class BindingSetAssignmentCollector extends AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> bindingSetList = Sets.newHashSet();
@@ -694,7 +689,7 @@ public class GeneralizedExternalProcessor {
- public static class QueryNodeCount extends QueryModelVisitorBase<RuntimeException> {
+ public static class QueryNodeCount extends AbstractQueryModelVisitor<RuntimeException> {
private int nodeCount;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidator.java
index a5b4af2..f424f73 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidator.java
@@ -19,20 +19,18 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Sets;
@@ -106,10 +104,8 @@ public class IndexPlanValidator implements TupleValidator {
}
isEmpty = true;
return false;
- } else if(isEmpty) {
- return false;
- }else {
- return true;
+ } else {
+ return !isEmpty;
}
}
@@ -150,17 +146,10 @@ public class IndexPlanValidator implements TupleValidator {
//System.out.println("Left binding names are " + leftBindingNames + " and right binding names are " + rightBindingNames);
if (Sets.intersection(leftBindingNames, rightBindingNames).size() == 0) {
- if (omitCrossProd) {
- return false;
- } else {
- return true;
- }
-
+ return !omitCrossProd;
} else {
if (join.getRightArg() instanceof ExternalTupleSet) {
-
return ((ExternalTupleSet) join.getRightArg()).supportsBindingSet(leftBindingNames);
-
} else {
return true;
}
@@ -168,7 +157,7 @@ public class IndexPlanValidator implements TupleValidator {
}
- public class TupleValidateVisitor extends QueryModelVisitorBase<RuntimeException> {
+ public class TupleValidateVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private boolean isValid = true;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexTupleGenerator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexTupleGenerator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexTupleGenerator.java
index 2e00cf5..fd4faab 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexTupleGenerator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexTupleGenerator.java
@@ -19,10 +19,9 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface IndexTupleGenerator {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGenerator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGenerator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGenerator.java
index 5683de5..34aa6ae 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGenerator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGenerator.java
@@ -19,15 +19,14 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.collect.Lists;
@@ -70,10 +69,8 @@ public class IndexedExecutionPlanGenerator implements ExternalIndexMatcher {
}
isEmpty = true;
return false;
- } else if(isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
index 1138fa7..974f616 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/IndexedQueryPlanSelector.java
@@ -19,14 +19,13 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface IndexedQueryPlanSelector {
- public TupleExpr getThreshholdQueryPlan(Iterator<TupleExpr> tupleList, double threshhold,
+ TupleExpr getThreshholdQueryPlan(Iterator<TupleExpr> tupleList, double threshhold,
double indexWeight, double commonVarWeight, double dirProdWeight);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelector.java
index a260226..96f822f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelector.java
@@ -19,20 +19,19 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
import java.util.Set;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Sets;
@@ -111,9 +110,9 @@ public class ThreshholdPlanSelector implements IndexedQueryPlanSelector {
double dirProductScale;
if(queryNodeCount > nodeCount) {
- dirProductScale = 1/((double)(queryNodeCount - nodeCount));
+ dirProductScale = 1/ (queryNodeCount - nodeCount);
} else {
- dirProductScale = 1/((double)(queryNodeCount - nodeCount + 1));
+ dirProductScale = 1/ (queryNodeCount - nodeCount + 1);
}
double joinVarRatio;
@@ -143,7 +142,7 @@ public class ThreshholdPlanSelector implements IndexedQueryPlanSelector {
return cost;
}
- public static class QueryNodeCount extends QueryModelVisitorBase<RuntimeException> {
+ public static class QueryNodeCount extends AbstractQueryModelVisitor<RuntimeException> {
private int nodeCount = 0;
private int commonJoinVars = 0;
@@ -210,13 +209,13 @@ public class ThreshholdPlanSelector implements IndexedQueryPlanSelector {
Set<String> rNames = node.getRightArg().getAssuredBindingNames();
for(String s: node.getLeftArg().getBindingNames()) {
- if(s.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(s)) {
lNames.remove(s);
}
}
for(String s: node.getRightArg().getBindingNames()) {
- if(s.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(s)) {
rNames.remove(s);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGenerator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGenerator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGenerator.java
index a76e30d..78b1f92 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGenerator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGenerator.java
@@ -19,7 +19,6 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -27,14 +26,14 @@ import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
@@ -77,10 +76,8 @@ public class TupleExecutionPlanGenerator implements IndexTupleGenerator {
isEmpty = true;
return false;
}
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -167,7 +164,7 @@ public class TupleExecutionPlanGenerator implements IndexTupleGenerator {
}
- public static class NodeCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class NodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
private final Set<QueryModelNode> nodeSet = Sets.newHashSet();
private final List<Filter> filterSet = Lists.newArrayList();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArranger.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArranger.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArranger.java
index 773481a..f4cbc9c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArranger.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArranger.java
@@ -19,7 +19,6 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -28,21 +27,21 @@ import java.util.NoSuchElementException;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-
-//A given TupleExpr can be broken up into "join segments", which are sections of the TupleExpr where nodes can
-//be freely exchanged. This class creates a list of permuted TupleExpr from a specified TupleExpr by permuting the nodes
-//in each join segment.
+/**
+ * A given TupleExpr can be broken up into "join segments", which are sections of the TupleExpr where nodes can
+ * be freely exchanged. This class creates a list of permuted TupleExpr from a specified TupleExpr by permuting the nodes
+ * in each join segment.
+ */
public class TupleReArranger {
private static Map<Join, List<List<TupleExpr>>> joinArgs;
@@ -81,10 +80,8 @@ public class TupleReArranger {
isEmpty = true;
return false;
}
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -186,7 +183,7 @@ public class TupleReArranger {
//creates a map which associates each first join of a TupleExpr join segment with all permutations of
//the non-join nodes after it. More specifically, each join is associated with a list of TupleExpr
//lists, where each list represents an ordering of the non-join nodes following the associated join
- private static class NodeCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class NodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
private static List<Filter> filterList;
@@ -241,7 +238,7 @@ public class TupleReArranger {
//for a given reOrder map, searches through TupleExpr and places each reordered collection
//of nodes at appropriate join
- private static class PermInserter extends QueryModelVisitorBase<RuntimeException> {
+ private static class PermInserter extends AbstractQueryModelVisitor<RuntimeException> {
private Map<Join, List<TupleExpr>> reOrderMap = Maps.newHashMap();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleValidator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleValidator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleValidator.java
index 699b438..c8fdabc 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleValidator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/TupleValidator.java
@@ -19,10 +19,9 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.Iterator;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public interface TupleValidator {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGenerator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGenerator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGenerator.java
index 3aac2f7..92a4678 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGenerator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGenerator.java
@@ -26,11 +26,11 @@ import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
@@ -86,10 +86,8 @@ public class ValidIndexCombinationGenerator {
}
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -153,10 +151,8 @@ public class ValidIndexCombinationGenerator {
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -228,10 +224,8 @@ public class ValidIndexCombinationGenerator {
return true;
}
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -304,10 +298,8 @@ public class ValidIndexCombinationGenerator {
}
}
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -432,7 +424,7 @@ public class ValidIndexCombinationGenerator {
}
private static class SpFilterCollector extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> spFilterSet = Sets.newHashSet();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPruner.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPruner.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPruner.java
index 67cf7d6..c970b0e 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPruner.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPruner.java
@@ -19,20 +19,18 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -96,7 +94,7 @@ public class VarConstantIndexListPruner implements IndexListPruner {
}
- private static class ConstantCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class ConstantCollector extends AbstractQueryModelVisitor<RuntimeException> {
private Map<String, Integer> constantMap = Maps.newHashMap();
private int spCount = 0;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingExpr.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingExpr.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingExpr.java
index f919b18..71beea8 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingExpr.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingExpr.java
@@ -19,29 +19,27 @@ package org.apache.rya.indexing;
* under the License.
*/
-
import java.util.Set;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.Sets;
public class IndexingExpr {
- private final URI function;
+ private final IRI function;
private final Object[] arguments;
private final StatementPattern spConstraint;
- public IndexingExpr(URI function, StatementPattern spConstraint, Object... arguments) {
+ public IndexingExpr(IRI function, StatementPattern spConstraint, Object... arguments) {
this.function = function;
this.arguments = arguments;
this.spConstraint = spConstraint;
}
- public URI getFunction() {
+ public IRI getFunction() {
return function;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingFunctionRegistry.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingFunctionRegistry.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingFunctionRegistry.java
index 37f7116..9722fd9 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingFunctionRegistry.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IndexingFunctionRegistry.java
@@ -19,39 +19,38 @@ package org.apache.rya.indexing;
* under the License.
*/
-
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.Maps;
public class IndexingFunctionRegistry {
-
-
- private static final Map<URI, FUNCTION_TYPE> SEARCH_FUNCTIONS = Maps.newHashMap();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final Map<IRI, FUNCTION_TYPE> SEARCH_FUNCTIONS = Maps.newHashMap();
static {
String TEMPORAL_NS = "tag:rya-rdf.org,2015:temporal#";
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"after"),FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"before"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"equals"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"beforeInterval"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"afterInterval"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"insideInterval"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"hasBeginningInterval"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl(TEMPORAL_NS+"hasEndInterval"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"after"),FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"before"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"equals"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"beforeInterval"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"afterInterval"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"insideInterval"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"hasBeginningInterval"), FUNCTION_TYPE.TEMPORAL);
+ SEARCH_FUNCTIONS.put(VF.createIRI(TEMPORAL_NS+"hasEndInterval"), FUNCTION_TYPE.TEMPORAL);
- SEARCH_FUNCTIONS.put(new URIImpl("http://rdf.useekm.com/fts#text"), FUNCTION_TYPE.FREETEXT);
+ SEARCH_FUNCTIONS.put(VF.createIRI("http://rdf.useekm.com/fts#text"), FUNCTION_TYPE.FREETEXT);
SEARCH_FUNCTIONS.put(GeoConstants.GEO_SF_EQUALS, FUNCTION_TYPE.GEO);
SEARCH_FUNCTIONS.put(GeoConstants.GEO_SF_DISJOINT, FUNCTION_TYPE.GEO);
@@ -65,15 +64,14 @@ public class IndexingFunctionRegistry {
}
- public enum FUNCTION_TYPE {GEO, TEMPORAL, FREETEXT};
-
-
- public static Set<URI> getFunctions() {
+ public enum FUNCTION_TYPE {GEO, TEMPORAL, FREETEXT}
+
+ public static Set<IRI> getFunctions() {
return SEARCH_FUNCTIONS.keySet();
}
- public static Var getResultVarFromFunctionCall(URI function, List<ValueExpr> args) {
+ public static Var getResultVarFromFunctionCall(IRI function, List<ValueExpr> args) {
FUNCTION_TYPE type = SEARCH_FUNCTIONS.get(function);
@@ -91,7 +89,7 @@ public class IndexingFunctionRegistry {
}
- public static FUNCTION_TYPE getFunctionType(URI func) {
+ public static FUNCTION_TYPE getFunctionType(IRI func) {
return SEARCH_FUNCTIONS.get(func);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/IteratorFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/IteratorFactory.java b/extras/indexing/src/main/java/org/apache/rya/indexing/IteratorFactory.java
index 50b8746..73978cc 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/IteratorFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/IteratorFactory.java
@@ -19,24 +19,22 @@ package org.apache.rya.indexing;
* under the License.
*/
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.NoSuchElementException;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
//Given StatementPattern constraint and SearchFunction associated with an Indexing Node,
@@ -87,12 +85,12 @@ public class IteratorFactory {
// get the predicate constraint
if (match.getPredicateVar().isConstant()) {
// get the predicate binding from the filter/statement pair
- Set<URI> predicates = new HashSet<URI>(getPredicateRestrictions(match.getPredicateVar()));
+ Set<IRI> predicates = new HashSet<IRI>(getPredicateRestrictions(match.getPredicateVar()));
contraints.setPredicates(predicates);
} else if (bindings.hasBinding(predicateBinding)) {
// get the predicate binding from the passed in bindings (eg from other statements/parts of the tree)
- URI predicateUri = (URI) bindings.getValue(predicateBinding);
- Set<URI> predicates = Collections.singleton(predicateUri);
+ IRI predicateUri = (IRI) bindings.getValue(predicateBinding);
+ Set<IRI> predicates = Collections.singleton(predicateUri);
contraints.setPredicates(predicates);
}
@@ -151,9 +149,9 @@ public class IteratorFactory {
}
- public static Collection<URI> getPredicateRestrictions(Var predicate) {
+ public static Collection<IRI> getPredicateRestrictions(Var predicate) {
if (predicate.hasValue())
- return Collections.singleton((URI) predicate.getValue());
+ return Collections.singleton((IRI) predicate.getValue());
return Collections.emptyList();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/KeyParts.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/KeyParts.java b/extras/indexing/src/main/java/org/apache/rya/indexing/KeyParts.java
index 11ff8c0..ac777aa 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/KeyParts.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/KeyParts.java
@@ -26,12 +26,11 @@ import java.util.List;
import org.apache.accumulo.core.data.Value;
import org.apache.commons.codec.binary.StringUtils;
import org.apache.hadoop.io.Text;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* Store and format the various temporal index keys.
@@ -52,6 +51,8 @@ import org.openrdf.model.impl.URIImpl;
*
*/
public class KeyParts implements Iterable<KeyParts> {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private static final String CQ_S_P_AT = "spo";
private static final String CQ_P_AT = "po";
private static final String CQ_S_AT = "so";
@@ -179,9 +180,9 @@ public class KeyParts implements Iterable<KeyParts> {
*/
public Text getQueryKey() {
return getQueryKey(instant);
- };
+ }
- /**
+ /**
* Query key is the prefix plus the datetime, but no uniqueness at the end.
*
* @return the row key for range queries.
@@ -194,9 +195,9 @@ public class KeyParts implements Iterable<KeyParts> {
}
appendInstant(theInstant, keyText);
return keyText;
- };
+ }
- @Override
+ @Override
public String toString() {
return "KeyParts [contraintPrefix=" + toHumanString(constraintPrefix) + ", instant=" + toHumanString(instant.getAsKeyBytes()) + ", cf=" + cf + ", cq=" + cq + "]";
}
@@ -270,13 +271,13 @@ public class KeyParts implements Iterable<KeyParts> {
*/
static public List<KeyParts> keyPartsForQuery(final TemporalInstant queryInstant, final StatementConstraints contraints) {
final List<KeyParts> keys = new LinkedList<KeyParts>();
- final URI urlNull = new URIImpl("urn:null");
+ final IRI urlNull = VF.createIRI("urn:null");
final Resource currentContext = contraints.getContext();
final boolean hasSubj = contraints.hasSubject();
if (contraints.hasPredicates()) {
- for (final URI nextPredicate : contraints.getPredicates()) {
+ for (final IRI nextPredicate : contraints.getPredicates()) {
final Text contraintPrefix = new Text();
- final Statement statement = new ContextStatementImpl(hasSubj ? contraints.getSubject() : urlNull, nextPredicate, urlNull, contraints.getContext());
+ final Statement statement = VF.createStatement(hasSubj ? contraints.getSubject() : urlNull, nextPredicate, urlNull, contraints.getContext());
if (hasSubj) {
appendSubjectPredicate(statement, contraintPrefix);
} else {
@@ -287,7 +288,7 @@ public class KeyParts implements Iterable<KeyParts> {
}
else if (contraints.hasSubject()) { // and no predicates
final Text contraintPrefix = new Text();
- final Statement statement = new StatementImpl(contraints.getSubject(), urlNull, urlNull);
+ final Statement statement = VF.createStatement(contraints.getSubject(), urlNull, urlNull);
appendSubject(statement, contraintPrefix);
keys.add( new KeyParts(contraintPrefix, queryInstant, (currentContext==null)?"":currentContext.toString(), CQ_S_AT) );
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunction.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunction.java b/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunction.java
index 838aea6..534cc7f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunction.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunction.java
@@ -19,10 +19,9 @@ package org.apache.rya.indexing;
* under the License.
*/
-
-import info.aduna.iteration.CloseableIteration;
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
/**
* A function used to perform a search.
@@ -39,7 +38,7 @@ public interface SearchFunction {
* @return
* @throws QueryEvaluationException
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> performSearch(String searchTerms, StatementConstraints contraints)
+ public CloseableIteration<Statement, QueryEvaluationException> performSearch(String searchTerms, StatementConstraints contraints)
throws QueryEvaluationException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunctionFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunctionFactory.java b/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunctionFactory.java
index f3b1678..15fe96d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunctionFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/SearchFunctionFactory.java
@@ -19,12 +19,11 @@ package org.apache.rya.indexing;
* under the License.
*/
-
import java.util.Map;
import org.apache.log4j.Logger;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.google.common.collect.Maps;
@@ -32,7 +31,7 @@ public abstract class SearchFunctionFactory {
private static final Logger logger = Logger.getLogger(SearchFunctionFactory.class);
- private final Map<URI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
+ private final Map<IRI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
/**
@@ -41,7 +40,7 @@ public abstract class SearchFunctionFactory {
* @param searchFunction
* @return
*/
- public SearchFunction getSearchFunction(final URI searchFunction) {
+ public SearchFunction getSearchFunction(final IRI searchFunction) {
SearchFunction geoFunc = null;
@@ -54,7 +53,7 @@ public abstract class SearchFunctionFactory {
return geoFunc;
}
- private SearchFunction getSearchFunctionInternal(final URI searchFunction) throws QueryEvaluationException {
+ private SearchFunction getSearchFunctionInternal(final IRI searchFunction) throws QueryEvaluationException {
SearchFunction sf = SEARCH_FUNCTION_MAP.get(searchFunction);
if (sf != null) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/StatementConstraints.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/StatementConstraints.java b/extras/indexing/src/main/java/org/apache/rya/indexing/StatementConstraints.java
index 30096a5..76122e7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/StatementConstraints.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/StatementConstraints.java
@@ -19,24 +19,22 @@ package org.apache.rya.indexing;
* under the License.
*/
-
-
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
public class StatementConstraints {
private Resource context = null;
private Resource subject = null;
- private Set<URI> predicates = null;
+ private Set<IRI> predicates = null;
public StatementConstraints setContext(Resource context) {
this.context = context;
return this;
}
- public StatementConstraints setPredicates(Set<URI> predicates) {
+ public StatementConstraints setPredicates(Set<IRI> predicates) {
this.predicates = predicates;
return this;
}
@@ -50,7 +48,7 @@ public class StatementConstraints {
return context;
}
- public Set<URI> getPredicates() {
+ public Set<IRI> getPredicates() {
return predicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/StatementSerializer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/StatementSerializer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/StatementSerializer.java
index b25a379..8ea44c5 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/StatementSerializer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/StatementSerializer.java
@@ -19,22 +19,18 @@ package org.apache.rya.indexing;
* under the License.
*/
-
-
import java.io.IOException;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
/**
* A set of Utilities to serialize {@link Statement}s to/from {@link String}s.
@@ -42,7 +38,7 @@ import org.openrdf.model.impl.ValueFactoryImpl;
public class StatementSerializer {
private static String SEP = "\u0000";
- private static ValueFactory VALUE_FACTORY = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* Read a {@link Statement} from a {@link String}
@@ -71,7 +67,7 @@ public class StatementSerializer {
public static Statement readStatement(String subjectString, String predicateString, String objectString, String contextString) {
Resource subject = createResource(subjectString);
- URI predicate = VALUE_FACTORY.createURI(predicateString);
+ IRI predicate = VF.createIRI(predicateString);
boolean isObjectLiteral = objectString.startsWith("\"");
@@ -83,18 +79,18 @@ public class StatementSerializer {
}
if (contextString == null || contextString.isEmpty()) {
- return new StatementImpl(subject, predicate, object);
+ return VF.createStatement(subject, predicate, object);
} else {
- Resource context = VALUE_FACTORY.createURI(contextString);
- return new ContextStatementImpl(subject, predicate, object, context);
+ Resource context = VF.createIRI(contextString);
+ return VF.createStatement(subject, predicate, object, context);
}
}
private static Resource createResource(String str) {
if (str.startsWith("_")) {
- return VALUE_FACTORY.createBNode(str.substring(2));
+ return VF.createBNode(str.substring(2));
}
- return VALUE_FACTORY.createURI(str);
+ return VF.createIRI(str);
}
@@ -104,7 +100,7 @@ public class StatementSerializer {
if (fullLiteralString.endsWith("\"")) {
String fullLiteralWithoutQuotes = fullLiteralString.substring(1, fullLiteralString.length() - 1);
- return VALUE_FACTORY.createLiteral(fullLiteralWithoutQuotes, (String) null);
+ return VF.createLiteral(fullLiteralWithoutQuotes);
} else {
// find the closing quote
@@ -117,12 +113,12 @@ public class StatementSerializer {
if (data.startsWith("@")) {
// the data is "language"
String lang = data.substring(1);
- return VALUE_FACTORY.createLiteral(label, lang);
+ return VF.createLiteral(label, lang);
} else if (data.startsWith("^^<")) {
// the data is a "datatype"
String datatype = data.substring(3, data.length() - 1);
- URI datatypeUri = VALUE_FACTORY.createURI(datatype);
- return VALUE_FACTORY.createLiteral(label, datatypeUri);
+ IRI datatypeUri = VF.createIRI(datatype);
+ return VF.createLiteral(label, datatypeUri);
}
}
return null;
@@ -165,7 +161,7 @@ public class StatementSerializer {
public static String writeStatement(Statement statement) {
Resource subject = statement.getSubject();
Resource context = statement.getContext();
- URI predicate = statement.getPredicate();
+ IRI predicate = statement.getPredicate();
Value object = statement.getObject();
Validate.notNull(subject);
@@ -197,7 +193,7 @@ public class StatementSerializer {
public static String createStatementRegex(StatementConstraints contraints) {
Resource context = contraints.getContext();
Resource subject = contraints.getSubject();
- Set<URI> predicates = contraints.getPredicates();
+ Set<IRI> predicates = contraints.getPredicates();
if (context == null && subject == null && (predicates == null || predicates.isEmpty())) {
return null;
}
[24/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloPcjIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloPcjIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloPcjIT.java
index d8a70aa..3a29ac3 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloPcjIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/AccumuloPcjIT.java
@@ -1,7 +1,3 @@
-package org.apache.rya.indexing.external;
-
-import java.net.UnknownHostException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +16,9 @@ import java.net.UnknownHostException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.external;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -45,37 +43,37 @@ import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.indexing.pcj.storage.PcjException;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.SailException;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
public class AccumuloPcjIT {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private SailRepositoryConnection conn, pcjConn;
private SailRepository repo, pcjRepo;
@@ -83,7 +81,7 @@ public class AccumuloPcjIT {
private final Configuration conf = getConf();
private final String prefix = "table_";
private final String tablename = "table_INDEX_";
- private URI obj, obj2, subclass, subclass2, talksTo;
+ private IRI obj, obj2, subclass, subclass2, talksTo;
@Before
public void init() throws RepositoryException,
@@ -99,21 +97,21 @@ public class AccumuloPcjIT {
pcjRepo = PcjIntegrationTestingUtil.getAccumuloPcjRepo(prefix, "instance");
pcjConn = pcjRepo.getConnection();
- final URI sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ final IRI sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
conn.add(sub, talksTo, obj);
- final URI sub2 = new URIImpl("uri:entity2");
- subclass2 = new URIImpl("uri:class2");
- obj2 = new URIImpl("uri:obj2");
+ final IRI sub2 = VF.createIRI("uri:entity2");
+ subclass2 = VF.createIRI("uri:class2");
+ obj2 = VF.createIRI("uri:obj2");
conn.add(sub2, RDF.TYPE, subclass2);
- conn.add(sub2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(sub2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub2, talksTo, obj2);
accCon = ConfigUtils.getConnector(conf);
@@ -147,7 +145,7 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?l ?o " //
@@ -177,8 +175,8 @@ public class AccumuloPcjIT {
AccumuloSecurityException, TableExistsException, PcjException,
SailException, TableNotFoundException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?e ?l ?c " //
@@ -208,11 +206,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "o", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -232,8 +230,8 @@ public class AccumuloPcjIT {
AccumuloException, AccumuloSecurityException, TableExistsException,
SailException, TableNotFoundException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
@@ -263,11 +261,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "o", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -287,8 +285,8 @@ public class AccumuloPcjIT {
QueryEvaluationException, MalformedQueryException, SailException,
TableNotFoundException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?e ?c ?l " //
@@ -318,11 +316,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "o", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -346,15 +344,15 @@ public class AccumuloPcjIT {
final Collection<String> vals = ops.tableIdMap().values();
System.out.println("Tables: " + tables + "and values " + vals);
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
@@ -386,11 +384,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "c", "l", "f", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -409,15 +407,15 @@ public class AccumuloPcjIT {
MalformedQueryException, SailException, QueryEvaluationException,
TupleQueryResultHandlerException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?owl " //
@@ -448,11 +446,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "owl" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "c", "l", "f", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, prefix);
pcjConn.prepareTupleQuery(QueryLanguage.SPARQL, queryString).evaluate(
crh2);
@@ -468,16 +466,16 @@ public class AccumuloPcjIT {
TupleQueryResultHandlerException, QueryEvaluationException,
MalformedQueryException, SailException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
accCon.tableOperations().create("table2");
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
@@ -508,11 +506,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, prefix);
pcjConn.prepareTupleQuery(QueryLanguage.SPARQL, queryString).evaluate(
crh2);
@@ -528,24 +526,24 @@ public class AccumuloPcjIT {
AccumuloSecurityException, TableNotFoundException,
TableExistsException, PcjException, SailException {
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
- final URI obj3 = new URIImpl("uri:obj3");
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
- final URI superclass3 = new URIImpl("uri:superclass3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
+ final IRI obj3 = VF.createIRI("uri:obj3");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
+ final IRI superclass3 = VF.createIRI("uri:superclass3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
conn.add(sub3, talksTo, obj3);
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
conn.add(subclass3, RDF.TYPE, superclass3);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj3, RDFS.LABEL, new LiteralImpl("label3"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj3, RDFS.LABEL, VF.createLiteral("label3"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
+ "{" //
@@ -575,11 +573,11 @@ public class AccumuloPcjIT {
final CountingResultHandler crh2 = new CountingResultHandler();
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "l", "e", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -598,25 +596,25 @@ public class AccumuloPcjIT {
AccumuloSecurityException, TableNotFoundException,
TableExistsException, PcjException, SailException {
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
- final URI obj3 = new URIImpl("uri:obj3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
+ final IRI obj3 = VF.createIRI("uri:obj3");
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
- final URI superclass3 = new URIImpl("uri:superclass3");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
+ final IRI superclass3 = VF.createIRI("uri:superclass3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
conn.add(sub3, talksTo, obj3);
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
conn.add(subclass3, RDF.TYPE, superclass3);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj3, RDFS.LABEL, new LiteralImpl("label3"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj3, RDFS.LABEL, VF.createLiteral("label3"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
+ "{" //
@@ -647,11 +645,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -671,25 +669,25 @@ public class AccumuloPcjIT {
TableNotFoundException, TupleQueryResultHandlerException,
QueryEvaluationException, MalformedQueryException, SailException {
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
- final URI obj3 = new URIImpl("uri:obj3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
+ final IRI obj3 = VF.createIRI("uri:obj3");
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
- final URI superclass3 = new URIImpl("uri:superclass3");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
+ final IRI superclass3 = VF.createIRI("uri:superclass3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
conn.add(sub3, talksTo, obj3);
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
conn.add(subclass3, RDF.TYPE, superclass3);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj3, RDFS.LABEL, new LiteralImpl("label3"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj3, RDFS.LABEL, VF.createLiteral("label3"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
@@ -721,11 +719,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -746,25 +744,25 @@ public class AccumuloPcjIT {
TupleQueryResultHandlerException, QueryEvaluationException,
SailException {
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
- final URI obj3 = new URIImpl("uri:obj3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
+ final IRI obj3 = VF.createIRI("uri:obj3");
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
- final URI superclass3 = new URIImpl("uri:superclass3");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
+ final IRI superclass3 = VF.createIRI("uri:superclass3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
conn.add(sub3, talksTo, obj3);
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
conn.add(subclass3, RDF.TYPE, superclass3);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj3, RDFS.LABEL, new LiteralImpl("label3"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj3, RDFS.LABEL, VF.createLiteral("label3"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
+ "{" //
@@ -795,11 +793,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "c", "l", "e", "o", "f" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -819,25 +817,25 @@ public class AccumuloPcjIT {
TableNotFoundException, TupleQueryResultHandlerException,
QueryEvaluationException, MalformedQueryException, SailException {
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
- final URI obj3 = new URIImpl("uri:obj3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
+ final IRI obj3 = VF.createIRI("uri:obj3");
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
- final URI superclass3 = new URIImpl("uri:superclass3");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
+ final IRI superclass3 = VF.createIRI("uri:superclass3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
conn.add(sub3, talksTo, obj3);
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
conn.add(subclass3, RDF.TYPE, superclass3);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj3, RDFS.LABEL, new LiteralImpl("label3"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj3, RDFS.LABEL, VF.createLiteral("label3"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
+ "{" //
@@ -868,11 +866,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "l", "c", "e", "f" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -891,15 +889,15 @@ public class AccumuloPcjIT {
AccumuloSecurityException, TableExistsException,
TableNotFoundException, PcjException, SailException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?c ?e ?l " //
@@ -931,11 +929,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "c", "e", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "e", "o", "f", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -954,15 +952,15 @@ public class AccumuloPcjIT {
MalformedQueryException, SailException, QueryEvaluationException,
TupleQueryResultHandlerException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -976,7 +974,7 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, indexSparqlString)
.evaluate(crh1);
@@ -995,15 +993,15 @@ public class AccumuloPcjIT {
TupleQueryResultHandlerException, QueryEvaluationException,
MalformedQueryException, SailException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -1035,11 +1033,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -1056,15 +1054,15 @@ public class AccumuloPcjIT {
TableNotFoundException, TableExistsException,
MalformedQueryException, SailException, QueryEvaluationException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -1084,14 +1082,14 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais1 = new AccumuloIndexSet(conf,
tablename + 1);
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename + 2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais2 = new AccumuloIndexSet(conf,
tablename + 2);
@@ -1159,15 +1157,15 @@ public class AccumuloPcjIT {
TupleQueryResultHandlerException, QueryEvaluationException,
MalformedQueryException, SailException {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -1199,11 +1197,11 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString)
.evaluate(crh1);
@@ -1217,15 +1215,15 @@ public class AccumuloPcjIT {
@Test
public void testEvaluateTwoIndexValidate() throws Exception {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -1254,13 +1252,13 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais1 = new AccumuloIndexSet(conf, tablename+1);
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais2 = new AccumuloIndexSet(conf, tablename+2);
@@ -1287,26 +1285,26 @@ public class AccumuloPcjIT {
@Test
public void testEvaluateThreeIndexValidate() throws Exception {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
- final URI sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ final IRI sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
- final URI howlsAt = new URIImpl("uri:howlsAt");
- final URI subType = new URIImpl("uri:subType");
- final URI superSuperclass = new URIImpl("uri:super_superclass");
+ final IRI howlsAt = VF.createIRI("uri:howlsAt");
+ final IRI subType = VF.createIRI("uri:subType");
+ final IRI superSuperclass = VF.createIRI("uri:super_superclass");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub, howlsAt, superclass);
conn.add(superclass, subType, superSuperclass);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -1344,20 +1342,20 @@ public class AccumuloPcjIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+1,
indexSparqlString, new String[] { "dog", "pig", "duck" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais1 = new AccumuloIndexSet(conf, tablename+1);
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+2,
indexSparqlString2, new String[] { "o", "f", "e", "c", "l" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais2 = new AccumuloIndexSet(conf, tablename+2);
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablename+3,
indexSparqlString3,
new String[] { "wolf", "sheep", "chicken" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final AccumuloIndexSet ais3 = new AccumuloIndexSet(conf, tablename+3);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PCJOptionalTestIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PCJOptionalTestIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PCJOptionalTestIT.java
index 026fa34..5527afe 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PCJOptionalTestIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PCJOptionalTestIT.java
@@ -38,43 +38,42 @@ import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.indexing.pcj.storage.PcjException;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.SailException;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
public class PCJOptionalTestIT {
-
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private SailRepositoryConnection conn, pcjConn;
private SailRepository repo, pcjRepo;
private Connector accCon;
String tablePrefix = "table_";
- URI sub, sub2, obj, obj2, subclass, subclass2, talksTo, sub3, subclass3;
+ IRI sub, sub2, obj, obj2, subclass, subclass2, talksTo, sub3, subclass3;
@Before
public void init() throws RepositoryException,
@@ -90,27 +89,27 @@ public class PCJOptionalTestIT {
pcjRepo = PcjIntegrationTestingUtil.getAccumuloPcjRepo(tablePrefix, "instance");
pcjConn = pcjRepo.getConnection();
- sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
conn.add(sub, talksTo, obj);
- sub2 = new URIImpl("uri:entity2");
- subclass2 = new URIImpl("uri:class2");
- obj2 = new URIImpl("uri:obj2");
- sub3 = new URIImpl("uri:entity3");
- subclass3 = new URIImpl("uri:class3");
+ sub2 = VF.createIRI("uri:entity2");
+ subclass2 = VF.createIRI("uri:class2");
+ obj2 = VF.createIRI("uri:obj2");
+ sub3 = VF.createIRI("uri:entity3");
+ subclass3 = VF.createIRI("uri:class3");
conn.add(sub2, RDF.TYPE, subclass2);
- conn.add(sub2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(sub2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub2, talksTo, obj2);
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
accCon = new MockInstance("instance").getConnector("root",
@@ -147,7 +146,7 @@ public class PCJOptionalTestIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "c", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?l ?o " //
+ "{" //
@@ -184,7 +183,7 @@ public class PCJOptionalTestIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?l ?o " //
+ "{" //
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PcjIntegrationTestingUtil.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PcjIntegrationTestingUtil.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PcjIntegrationTestingUtil.java
index 8b3b8f5..56eac96 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PcjIntegrationTestingUtil.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PcjIntegrationTestingUtil.java
@@ -52,22 +52,22 @@ import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjDocuments;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -157,7 +157,7 @@ public class PcjIntegrationTestingUtil {
}
public static class BindingSetAssignmentCollector extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
private final Set<QueryModelNode> bindingSetList = Sets.newHashSet();
@@ -178,7 +178,7 @@ public class PcjIntegrationTestingUtil {
}
public static class ExternalTupleVisitor extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
private final Set<QueryModelNode> eSet = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerIT.java
index 86e5a8e..28a2d24 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerIT.java
@@ -1,7 +1,3 @@
-package org.apache.rya.indexing.external;
-
-import java.net.UnknownHostException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +16,9 @@ import java.net.UnknownHostException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.external;
+import java.net.UnknownHostException;
import java.util.List;
import org.apache.accumulo.core.client.AccumuloException;
@@ -30,41 +28,40 @@ import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.pcj.storage.PcjException;
-import org.apache.rya.indexing.pcj.storage.accumulo.PcjVarOrderFactory;
+import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.SailException;
import com.google.common.base.Optional;
-import org.apache.rya.api.persist.RyaDAOException;
-import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
-
public class PrecompJoinOptimizerIT {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private SailRepositoryConnection conn, pcjConn;
private SailRepository repo, pcjRepo;
private Connector accCon;
String tablePrefix = "table_";
- URI sub, sub2, obj, obj2, subclass, subclass2, talksTo;
+ IRI sub, sub2, obj, obj2, subclass, subclass2, talksTo;
@Before
public void init() throws RepositoryException,
@@ -80,21 +77,21 @@ public class PrecompJoinOptimizerIT {
pcjRepo = PcjIntegrationTestingUtil.getAccumuloPcjRepo(tablePrefix, "instance");
pcjConn = pcjRepo.getConnection();
- sub = new URIImpl("uri:entity");
- subclass = new URIImpl("uri:class");
- obj = new URIImpl("uri:obj");
- talksTo = new URIImpl("uri:talksTo");
+ sub = VF.createIRI("uri:entity");
+ subclass = VF.createIRI("uri:class");
+ obj = VF.createIRI("uri:obj");
+ talksTo = VF.createIRI("uri:talksTo");
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
conn.add(sub, talksTo, obj);
- sub2 = new URIImpl("uri:entity2");
- subclass2 = new URIImpl("uri:class2");
- obj2 = new URIImpl("uri:obj2");
+ sub2 = VF.createIRI("uri:entity2");
+ subclass2 = VF.createIRI("uri:class2");
+ obj2 = VF.createIRI("uri:obj2");
conn.add(sub2, RDF.TYPE, subclass2);
- conn.add(sub2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(sub2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub2, talksTo, obj2);
accCon = new MockInstance("instance").getConnector("root",
@@ -130,7 +127,7 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?l ?o " //
+ "{" //
@@ -159,8 +156,8 @@ public class PrecompJoinOptimizerIT {
QueryEvaluationException, TableNotFoundException,
TupleQueryResultHandlerException, RyaDAOException, PcjException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?e ?l ?c " //
@@ -187,10 +184,10 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_2", indexSparqlString2, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final CountingResultHandler crh = new CountingResultHandler();
PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, tablePrefix);
pcjConn.prepareTupleQuery(QueryLanguage.SPARQL, queryString).evaluate(
@@ -218,7 +215,7 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?l ?o " //
+ "{" //
@@ -260,7 +257,7 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_2", indexSparqlString2, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?o ?m ?l" //
@@ -301,14 +298,14 @@ public class PrecompJoinOptimizerIT {
+ " ?e <http://www.w3.org/2000/01/rdf-schema#label> ?l "//
+ "}";//
- final URI sub3 = new URIImpl("uri:entity3");
- final URI subclass3 = new URIImpl("uri:class3");
+ final IRI sub3 = VF.createIRI("uri:entity3");
+ final IRI subclass3 = VF.createIRI("uri:class3");
conn.add(sub3, RDF.TYPE, subclass3);
- conn.add(sub3, RDFS.LABEL, new LiteralImpl("label3"));
+ conn.add(sub3, RDFS.LABEL, VF.createLiteral("label3"));
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString1, new String[] { "e", "l", "c" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
final String queryString = ""//
+ "SELECT ?e ?c ?o ?m ?l" //
+ "{" //
@@ -324,7 +321,7 @@ public class PrecompJoinOptimizerIT {
repo = PcjIntegrationTestingUtil.getAccumuloPcjRepo(tablePrefix, "instance");
conn = repo.getConnection();
conn.add(sub, talksTo, obj);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
pcjConn.prepareTupleQuery(QueryLanguage.SPARQL, queryString).evaluate(
crh);
@@ -340,8 +337,8 @@ public class PrecompJoinOptimizerIT {
TupleQueryResultHandlerException, RyaDAOException, PcjException, InferenceEngineException,
NumberFormatException, UnknownHostException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub, RDF.TYPE, obj);
conn.add(sub2, RDF.TYPE, obj2);
@@ -372,10 +369,10 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_2", indexSparqlString2, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, tablePrefix);
PcjIntegrationTestingUtil.closeAndShutdown(conn, repo);
@@ -399,15 +396,15 @@ public class PrecompJoinOptimizerIT {
TupleQueryResultHandlerException, RyaDAOException, PcjException, InferenceEngineException,
NumberFormatException, UnknownHostException {
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub, RDF.TYPE, obj);
conn.add(sub2, RDF.TYPE, obj2);
- final URI livesIn = new URIImpl("uri:livesIn");
- final URI city = new URIImpl("uri:city");
- final URI city2 = new URIImpl("uri:city2");
- final URI city3 = new URIImpl("uri:city3");
+ final IRI livesIn = VF.createIRI("uri:livesIn");
+ final IRI city = VF.createIRI("uri:city");
+ final IRI city2 = VF.createIRI("uri:city2");
+ final IRI city3 = VF.createIRI("uri:city3");
conn.add(sub, livesIn, city);
conn.add(sub2, livesIn, city2);
conn.add(sub2, livesIn, city3);
@@ -438,10 +435,10 @@ public class PrecompJoinOptimizerIT {
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_1", indexSparqlString, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.createAndPopulatePcj(conn, accCon, tablePrefix
+ "INDEX_2", indexSparqlString2, new String[] { "e", "l", "o" },
- Optional.<PcjVarOrderFactory> absent());
+ Optional.absent());
PcjIntegrationTestingUtil.deleteCoreRyaTables(accCon, tablePrefix);
PcjIntegrationTestingUtil.closeAndShutdown(conn, repo);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest.java
index 0035898..79c5014 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest.java
@@ -18,7 +18,6 @@
*/
package org.apache.rya.indexing.external;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -34,18 +33,18 @@ import org.apache.rya.indexing.pcj.matching.provider.AbstractPcjIndexSetProvider
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.mongodb.EmbeddedMongoSingleton;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -432,7 +431,7 @@ public class PrecompJoinOptimizerTest {
}
public static class NodeCollector extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
Set<QueryModelNode> qNodes = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest2.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest2.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest2.java
index 2988ff3..54960c4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest2.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerTest2.java
@@ -33,17 +33,17 @@ import org.apache.rya.indexing.pcj.matching.provider.AbstractPcjIndexSetProvider
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.mongodb.EmbeddedMongoSingleton;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerVarToConstTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerVarToConstTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerVarToConstTest.java
index b3823de..0628afe 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerVarToConstTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/PrecompJoinOptimizerVarToConstTest.java
@@ -19,7 +19,6 @@ package org.apache.rya.indexing.external;
* under the License.
*/
-
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -29,15 +28,15 @@ import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetColumnVisibilityTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetColumnVisibilityTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetColumnVisibilityTest.java
index fa8aac6..77c5f08 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetColumnVisibilityTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSetColumnVisibilityTest.java
@@ -16,14 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.rya.indexing.external.tupleSet;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
-import java.util.Date;
+import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
@@ -56,23 +55,21 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageException;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.repository.RepositoryException;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
import com.google.common.io.Files;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Tests the evaluation of {@link AccumuloIndexSet}.
*/
@@ -94,6 +91,7 @@ public class AccumuloIndexSetColumnVisibilityTest {
private static String pcjId;
private static QueryBindingSet pcjBs1;
private static QueryBindingSet pcjBs2;
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@BeforeClass
public static void init() throws AccumuloException, AccumuloSecurityException, PCJStorageException, IOException, InterruptedException, TableNotFoundException, AlreadyInitializedException, RyaDetailsRepositoryException {
@@ -119,12 +117,12 @@ public class AccumuloIndexSetColumnVisibilityTest {
// Store the PCJ's results.
pcjBs1 = new QueryBindingSet();
- pcjBs1.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
- pcjBs1.addBinding("name", new URIImpl("http://Alice"));
+ pcjBs1.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
+ pcjBs1.addBinding("name", VF.createIRI("http://Alice"));
pcjBs2 = new QueryBindingSet();
- pcjBs2.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
- pcjBs2.addBinding("name", new URIImpl("http://Bob"));
+ pcjBs2.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
+ pcjBs2.addBinding("name", VF.createIRI("http://Bob"));
final Set<VisibilityBindingSet> visBs = new HashSet<>();
for (final BindingSet bs : Sets.<BindingSet>newHashSet(pcjBs1, pcjBs2)) {
@@ -179,8 +177,8 @@ public class AccumuloIndexSetColumnVisibilityTest {
.setPCJIndexDetails(
PCJIndexDetails.builder()
.setEnabled(true) )
- .setJoinSelectivityDetails( new JoinSelectivityDetails( Optional.<Date>absent() ) )
- .setProspectorDetails( new ProspectorDetails( Optional.<Date>absent() ))
+ .setJoinSelectivityDetails( new JoinSelectivityDetails( Optional.absent() ) )
+ .setProspectorDetails( new ProspectorDetails( Optional.absent() ))
.build();
detailsRepo.initialize(details);
@@ -205,11 +203,11 @@ public class AccumuloIndexSetColumnVisibilityTest {
// Setup the binding sets that will be evaluated.
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("name", new URIImpl("http://Alice"));
+ bs.addBinding("name", VF.createIRI("http://Alice"));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("name", new URIImpl("http://Bob"));
+ bs2.addBinding("name", VF.createIRI("http://Bob"));
- final Set<BindingSet> bSets = Sets.<BindingSet> newHashSet(bs, bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs, bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
final Set<BindingSet> fetchedResults = new HashSet<>();
@@ -218,7 +216,7 @@ public class AccumuloIndexSetColumnVisibilityTest {
fetchedResults.add(next);
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(pcjBs1, pcjBs2);
+ final Set<BindingSet> expected = Sets.newHashSet(pcjBs1, pcjBs2);
assertEquals(expected, fetchedResults);
}
@@ -230,11 +228,11 @@ public class AccumuloIndexSetColumnVisibilityTest {
// Setup the binding sets that will be evaluated.
final QueryBindingSet bs1 = new QueryBindingSet();
- bs1.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bs1.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final QueryBindingSet bs2 = new QueryBindingSet();
- bs2.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ bs2.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
- final Set<BindingSet> bSets = Sets.<BindingSet> newHashSet(bs1, bs2);
+ final Set<BindingSet> bSets = Sets.newHashSet(bs1, bs2);
final CloseableIteration<BindingSet, QueryEvaluationException> results = ais.evaluate(bSets);
final Set<BindingSet> fetchedResults = new HashSet<>();
@@ -243,7 +241,7 @@ public class AccumuloIndexSetColumnVisibilityTest {
fetchedResults.add(next);
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(pcjBs1, pcjBs2);
+ final Set<BindingSet> expected = Sets.newHashSet(pcjBs1, pcjBs2);
assertEquals(expected, fetchedResults);
}
}
\ No newline at end of file
[15/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-infer.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-infer.md b/extras/rya.manual/src/site/markdown/sm-infer.md
index c2d112c..8021297 100644
--- a/extras/rya.manual/src/site/markdown/sm-infer.md
+++ b/extras/rya.manual/src/site/markdown/sm-infer.md
@@ -81,11 +81,11 @@ We will go through some quick samples on loading inferred relationships, seeing
First the code, which will load the following subclassof relationship: `UndergraduateStudent subclassof Student subclassof Person`. Then we will load into the tables three triples defining `UgradA rdf:type UndergraduateStudent, StudentB rdf:type Student, PersonC rdf:type Person`
``` JAVA
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, vf.createURI(litdupsNS, "Student")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "Student"), RDFS.SUBCLASSOF, vf.createURI(litdupsNS, "Person")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), RDF.TYPE, vf.createURI(litdupsNS, "UndergraduateStudent")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "StudentB"), RDF.TYPE, vf.createURI(litdupsNS, "Student")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "PersonC"), RDF.TYPE, vf.createURI(litdupsNS, "Person")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UndergraduateStudent"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Student")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Student"), RDFS.SUBCLASSOF, vf.createIRI(litdupsNS, "Person")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), RDF.TYPE, vf.createIRI(litdupsNS, "UndergraduateStudent")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "StudentB"), RDF.TYPE, vf.createIRI(litdupsNS, "Student")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "PersonC"), RDF.TYPE, vf.createIRI(litdupsNS, "Person")));
conn.commit();
```
@@ -121,10 +121,10 @@ QueryRoot
FixedStatementPattern
Var (name=79f261ee-e930-4af1-bc09-e637cc0affef)
Var (name=c-79f261ee-e930-4af1-bc09-e637cc0affef, value=http://www.w3.org/2000/01/rdf-schema#subClassOf)
- Var (name=-const-2, value=urn:test:litdups#Person, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#Person, anonymous)
DoNotExpandSP
Var (name=s)
- Var (name=-const-1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)
+ Var (name=_const_1, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)
Var (name=79f261ee-e930-4af1-bc09-e637cc0affef)
```
@@ -140,13 +140,13 @@ Also, EquivalentProperty can be thought of as specialized SubPropertyOf relation
Sample Code:
``` JAVA
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "degreeFrom")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "degreeFrom")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "memberOf")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, vf.createURI(litdupsNS, "associatedWith")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), vf.createURI(litdupsNS, "undergradDegreeFrom"), vf.createURI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradB"), vf.createURI(litdupsNS, "gradDegreeFrom"), vf.createURI(litdupsNS, "Yale")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "ProfessorC"), vf.createURI(litdupsNS, "memberOf"), vf.createURI(litdupsNS, "Harvard")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "undergradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "gradDegreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "degreeFrom")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "degreeFrom"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "memberOf")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "memberOf"), RDFS.SUBPROPERTYOF, vf.createIRI(litdupsNS, "associatedWith")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "undergradDegreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "gradDegreeFrom"), vf.createIRI(litdupsNS, "Yale")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "ProfessorC"), vf.createIRI(litdupsNS, "memberOf"), vf.createIRI(litdupsNS, "Harvard")));
conn.commit();
```
@@ -183,11 +183,11 @@ QueryRoot
FixedStatementPattern
Var (name=0bad69f3-4769-4293-8318-e828b23dc52a)
Var (name=c-0bad69f3-4769-4293-8318-e828b23dc52a, value=http://www.w3.org/2000/01/rdf-schema#subPropertyOf)
- Var (name=-const-1, value=urn:test:litdups#memberOf, anonymous)
+ Var (name=_const_1, value=urn:test:litdups#memberOf, anonymous)
DoNotExpandSP
Var (name=s)
Var (name=0bad69f3-4769-4293-8318-e828b23dc52a)
- Var (name=-const-2, value=urn:test:litdups#Harvard, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#Harvard, anonymous)
```
### InverseOf
@@ -197,10 +197,10 @@ InverseOf defines a property that is an inverse relation of another property. Fo
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, vf.createURI(litdupsNS, "hasAlumnus")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "UgradA"), vf.createURI(litdupsNS, "degreeFrom"), vf.createURI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "GradB"), vf.createURI(litdupsNS, "degreeFrom"), vf.createURI(litdupsNS, "Harvard")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "Harvard"), vf.createURI(litdupsNS, "hasAlumnus"), vf.createURI(litdupsNS, "AlumC")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "degreeFrom"), OWL.INVERSEOF, vf.createIRI(litdupsNS, "hasAlumnus")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "UgradA"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "GradB"), vf.createIRI(litdupsNS, "degreeFrom"), vf.createIRI(litdupsNS, "Harvard")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Harvard"), vf.createIRI(litdupsNS, "hasAlumnus"), vf.createIRI(litdupsNS, "AlumC")));
conn.commit();
```
@@ -236,13 +236,13 @@ QueryRoot
ProjectionElem "s"
InferUnion
StatementPattern
- Var (name=-const-1, value=urn:test:litdups#Harvard, anonymous)
- Var (name=-const-2, value=urn:test:litdups#hasAlumnus, anonymous)
+ Var (name=_const_1, value=urn:test:litdups#Harvard, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#hasAlumnus, anonymous)
Var (name=s)
StatementPattern
Var (name=s)
- Var (name=-const-2, value=urn:test:litdups#degreeFrom)
- Var (name=-const-1, value=urn:test:litdups#Harvard, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#degreeFrom)
+ Var (name=_const_1, value=urn:test:litdups#Harvard, anonymous)
```
### SymmetricProperty
@@ -252,9 +252,9 @@ SymmetricProperty defines a relationship where, for example, if Bob is a friendO
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "Bob"), vf.createURI(litdupsNS, "friendOf"), vf.createURI(litdupsNS, "Jeff")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "James"), vf.createURI(litdupsNS, "friendOf"), vf.createURI(litdupsNS, "Jeff")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "friendOf"), RDF.TYPE, OWL.SYMMETRICPROPERTY));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Bob"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "James"), vf.createIRI(litdupsNS, "friendOf"), vf.createIRI(litdupsNS, "Jeff")));
conn.commit();
```
@@ -287,11 +287,11 @@ QueryRoot
InferUnion
StatementPattern
Var (name=s)
- Var (name=-const-1, value=urn:test:litdups#friendOf, anonymous)
- Var (name=-const-2, value=urn:test:litdups#Bob, anonymous)
+ Var (name=_const_1, value=urn:test:litdups#friendOf, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#Bob, anonymous)
StatementPattern
- Var (name=-const-2, value=urn:test:litdups#Bob, anonymous)
- Var (name=-const-1, value=urn:test:litdups#friendOf, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#Bob, anonymous)
+ Var (name=_const_1, value=urn:test:litdups#friendOf, anonymous)
Var (name=s)
```
@@ -302,12 +302,12 @@ TransitiveProperty provides a transitive relationship between resources. For exa
Code:
``` JAVA
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "Queens"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NYC")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "NYC"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NY")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "NY"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "US")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "US"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "NorthAmerica")));
-conn.add(new StatementImpl(vf.createURI(litdupsNS, "NorthAmerica"), vf.createURI(litdupsNS, "subRegionOf"), vf.createURI(litdupsNS, "World")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "subRegionOf"), RDF.TYPE, OWL.TRANSITIVEPROPERTY));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "Queens"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NYC")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NYC"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NY")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NY"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "US")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "US"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "NorthAmerica")));
+conn.add(new StatementImpl(vf.createIRI(litdupsNS, "NorthAmerica"), vf.createIRI(litdupsNS, "subRegionOf"), vf.createIRI(litdupsNS, "World")));
conn.commit();
```
@@ -348,6 +348,6 @@ QueryRoot
ProjectionElem "s"
TransitivePropertySP
Var (name=s)
- Var (name=-const-1, value=urn:test:litdups#subRegionOf, anonymous)
- Var (name=-const-2, value=urn:test:litdups#NorthAmerica, anonymous)
+ Var (name=_const_1, value=urn:test:litdups#subRegionOf, anonymous)
+ Var (name=_const_2, value=urn:test:litdups#NorthAmerica, anonymous)
```
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-namedgraph.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-namedgraph.md b/extras/rya.manual/src/site/markdown/sm-namedgraph.md
index 6826345..766c98a 100644
--- a/extras/rya.manual/src/site/markdown/sm-namedgraph.md
+++ b/extras/rya.manual/src/site/markdown/sm-namedgraph.md
@@ -21,7 +21,7 @@
-->
# Named Graphs
-Named graphs are supported simply in the Rdf Store in a few ways. OpenRdf supports sending `contexts` as each triple is saved.
+Named graphs are supported simply in the Rdf Store in a few ways. RDF4J supports sending `contexts` as each triple is saved.
## Simple Named Graph Load and Query
@@ -116,19 +116,19 @@ QueryRoot
Join
StatementPattern FROM NAMED CONTEXT
Var (name=m)
- Var (name=-const-2, value=http://www.example.org/vocabulary#name, anonymous)
+ Var (name=_const_2, value=http://www.example.org/vocabulary#name, anonymous)
Var (name=name)
- Var (name=-const-1, value=http://www.example.org/exampleDocument#G1, anonymous)
+ Var (name=_const_1, value=http://www.example.org/exampleDocument#G1, anonymous)
StatementPattern FROM NAMED CONTEXT
Var (name=m)
- Var (name=-const-3, value=http://www.example.org/vocabulary#homepage, anonymous)
+ Var (name=_const_3, value=http://www.example.org/vocabulary#homepage, anonymous)
Var (name=hp)
- Var (name=-const-1, value=http://www.example.org/exampleDocument#G1, anonymous)
+ Var (name=_const_1, value=http://www.example.org/exampleDocument#G1, anonymous)
StatementPattern FROM NAMED CONTEXT
Var (name=m)
- Var (name=-const-5, value=http://www.example.org/vocabulary#hasSkill, anonymous)
+ Var (name=_const_5, value=http://www.example.org/vocabulary#hasSkill, anonymous)
Var (name=skill)
- Var (name=-const-4, value=http://www.example.org/exampleDocument#G2, anonymous)
+ Var (name=_const_4, value=http://www.example.org/exampleDocument#G2, anonymous)
```
## Inserting named graph data through Sparql
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-simpleaqr.md b/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
index 9188c2a..e6d03d4 100644
--- a/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
+++ b/extras/rya.manual/src/site/markdown/sm-simpleaqr.md
@@ -53,9 +53,9 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statement
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createURI(litdupsNS, "cpu");
-URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-URI uri1 = vf.createURI(litdupsNS, "uri1");
+URI cpu = vf.createIRI(litdupsNS, "cpu");
+URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+URI uri1 = vf.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-sparqlquery.md b/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
index 639ca02..ffa537a 100644
--- a/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
+++ b/extras/rya.manual/src/site/markdown/sm-sparqlquery.md
@@ -53,11 +53,11 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statements
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createURI(litdupsNS, "cpu");
-URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-URI uri1 = vf.createURI(litdupsNS, "uri1");
-URI pred2 = vf.createURI(litdupsNS, "pred2");
-URI uri2 = vf.createURI(litdupsNS, "uri2");
+URI cpu = vf.createIRI(litdupsNS, "cpu");
+URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+URI uri1 = vf.createIRI(litdupsNS, "uri1");
+URI pred2 = vf.createIRI(litdupsNS, "pred2");
+URI uri2 = vf.createIRI(litdupsNS, "uri2");
conn.add(cpu, loadPerc, uri1);
conn.commit();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-updatedata.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-updatedata.md b/extras/rya.manual/src/site/markdown/sm-updatedata.md
index f0fe664..6d5165f 100644
--- a/extras/rya.manual/src/site/markdown/sm-updatedata.md
+++ b/extras/rya.manual/src/site/markdown/sm-updatedata.md
@@ -21,7 +21,7 @@
-->
# Sparql Update
-OpenRDF supports the Sparql Update functionality. Here are a few samples:
+RDF4J supports the Sparql Update functionality. Here are a few samples:
Remember, you have to use `RepositoryConnection.prepareUpdate(..)` to perform these queries
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/BaseRuleMapper.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/BaseRuleMapper.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/BaseRuleMapper.java
index aca2dbc..862d3bf 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/BaseRuleMapper.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/BaseRuleMapper.java
@@ -27,10 +27,6 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Or;
-import org.openrdf.query.algebra.ValueExpr;
-
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.accumulo.mr.merge.MergeTool;
@@ -46,6 +42,9 @@ import org.apache.rya.api.resolver.triple.TripleRowResolver;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
import org.apache.rya.rdftriplestore.evaluation.ParallelEvaluationStrategyImpl;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Or;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
/**
* Take in rows from a table and range defined by query-based rules, convert the rows to
@@ -55,7 +54,7 @@ public abstract class BaseRuleMapper<KEYOUT, VALUEOUT> extends BaseCopyToolMappe
/**
* Hadoop counters for tracking the number of statements and/or raw rows that have been processed.
*/
- public static enum Counters { STATEMENTS_COPIED, DIRECT_ROWS_COPIED };
+ public enum Counters { STATEMENTS_COPIED, DIRECT_ROWS_COPIED }
private static final Logger log = Logger.getLogger(BaseRuleMapper.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/MergeToolMapper.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/MergeToolMapper.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/MergeToolMapper.java
index f5a9dae..8050ea2 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/MergeToolMapper.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/mappers/MergeToolMapper.java
@@ -40,9 +40,6 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.log4j.Logger;
-
-import com.google.common.base.Charsets;
-
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRdfConstants;
import org.apache.rya.accumulo.AccumuloRyaDAO;
@@ -61,6 +58,8 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
+import com.google.common.base.Charsets;
+
/**
* Reads from the Parent and Child tables comparing their the keys and adds or deletes the keys
* from the parent as necessary in order to reflect changes that the child made since the provided
@@ -116,7 +115,7 @@ public class MergeToolMapper extends Mapper<Key, Value, Text, Mutation> {
/**
* The result of comparing a child key and parent key which determines what should be done with them.
*/
- private static enum CompareKeysResult {
+ private enum CompareKeysResult {
/**
* Indicates that the child iterator should move to the next key in the child
* table in order to be compared to the current key in the parent table.
@@ -147,7 +146,7 @@ public class MergeToolMapper extends Mapper<Key, Value, Text, Mutation> {
/**
* Indicates that there are no more keys to compare in the child and parent tables.
*/
- FINISHED;
+ FINISHED
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloQueryRuleset.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloQueryRuleset.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloQueryRuleset.java
index caae9f5..aa0f615 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloQueryRuleset.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloQueryRuleset.java
@@ -28,12 +28,6 @@ import org.apache.accumulo.core.client.mapreduce.InputTableConfig;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.hadoop.io.Text;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
@@ -43,6 +37,11 @@ import org.apache.rya.api.query.strategy.TriplePatternStrategy;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.utils.NullableStatementImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* A {@link QueryRuleset} that additionally maps rules to ranges in Accumulo tables. Also enables
@@ -85,7 +84,7 @@ public class AccumuloQueryRuleset extends QueryRuleset {
private Map.Entry<TABLE_LAYOUT, ByteRange> getRange(final StatementPattern sp) throws IOException {
final Var context = sp.getContextVar();
final Statement stmt = new NullableStatementImpl((Resource) sp.getSubjectVar().getValue(),
- (URI) sp.getPredicateVar().getValue(), sp.getObjectVar().getValue(),
+ (IRI) sp.getPredicateVar().getValue(), sp.getObjectVar().getValue(),
context == null ? null : (Resource) context.getValue());
final RyaStatement rs = RdfToRyaConversions.convertStatement(stmt);
final TriplePatternStrategy strategy = ryaContext.retrieveStrategy(rs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
index 5a3b928..8a02672 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
@@ -60,14 +60,13 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.openrdf.model.Literal;
-import org.openrdf.model.ValueFactory;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.ValueFactory;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Utility methods for an Accumulo Rya instance.
*/
@@ -123,7 +122,7 @@ public final class AccumuloRyaUtils {
* @return the {@link RyraURI}.
*/
public static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createURI(namespace, localName));
+ return RdfToRyaConversions.convertURI(VALUE_FACTORY.createIRI(namespace, localName));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/CopyRule.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/CopyRule.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/CopyRule.java
index 2f78efa..2bf1e0e 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/CopyRule.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/CopyRule.java
@@ -22,30 +22,29 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.And;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.QueryModelNodeBase;
-import org.openrdf.query.algebra.QueryModelVisitor;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.EvaluationStrategy;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-
import org.apache.rya.accumulo.mr.merge.util.QueryRuleset.QueryRulesetException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode;
+import org.eclipse.rdf4j.query.algebra.And;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* A rule that defines a subset of statements to copy at the RDF level. Consists of a
* statement pattern and an optional filter expression.
*/
-public class CopyRule extends QueryModelNodeBase {
- private static final ValueConstant TRUE = new ValueConstant(ValueFactoryImpl.getInstance().createLiteral(true));
+public class CopyRule extends AbstractQueryModelNode {
+ private static final ValueConstant TRUE = new ValueConstant(SimpleValueFactory.getInstance().createLiteral(true));
private static final String SUFFIX = UUID.randomUUID().toString();
private static final Var SUBJ_VAR = new Var("subject_" + SUFFIX);
@@ -101,7 +100,7 @@ public class CopyRule extends QueryModelNodeBase {
/**
* Visitor that checks a tree for the existence of a given variable name.
*/
- private static class VarSearchVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class VarSearchVisitor extends AbstractQueryModelVisitor<RuntimeException> {
boolean found = false;
private final String queryVar;
public VarSearchVisitor(final String queryVar) {
@@ -126,7 +125,7 @@ public class CopyRule extends QueryModelNodeBase {
* operators to preserve meaningful expressions while eliminating undefined
* conditions.
*/
- private static class RuleVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private static class RuleVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final CopyRule rule;
RuleVisitor(final CopyRule rule) {
this.rule = rule;
@@ -335,11 +334,8 @@ public class CopyRule extends QueryModelNodeBase {
|| (statement == null && other.statement != null)) {
return false;
}
- if ((condition != null && !condition.equals(other.condition))
- || (condition == null && other.condition != null)) {
- return false;
- }
- return true;
+ return (condition == null || condition.equals(other.condition))
+ && (condition != null || other.condition == null);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/QueryRuleset.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/QueryRuleset.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/QueryRuleset.java
index 42109db..f20d16c 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/QueryRuleset.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/QueryRuleset.java
@@ -29,7 +29,6 @@ import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.apache.rya.accumulo.mr.merge.CopyTool;
-import org.apache.rya.accumulo.mr.merge.util.QueryRuleset.QueryRulesetException;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.inference.InferJoin;
@@ -44,30 +43,30 @@ import org.apache.rya.rdftriplestore.inference.TransitivePropertyVisitor;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
import org.apache.rya.rdftriplestore.utils.TransitivePropertySP;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.UnsupportedQueryLanguageException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.ListMemberOperator;
-import org.openrdf.query.algebra.Or;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedTupleQuery;
-import org.openrdf.query.parser.QueryParserUtil;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.UnsupportedQueryLanguageException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.ListMemberOperator;
+import org.eclipse.rdf4j.query.algebra.Or;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedTupleQuery;
+import org.eclipse.rdf4j.query.parser.QueryParserUtil;
+import org.eclipse.rdf4j.sail.SailException;
/**
* Represents a set of {@link CopyRule} instances derived from a query. The ruleset determines a logical
@@ -93,7 +92,7 @@ public class QueryRuleset {
/**
* Takes in a parsed query tree and extracts the rules defining relevant statements.
*/
- private static class RulesetVisitor extends QueryModelVisitorBase<QueryRulesetException> {
+ private static class RulesetVisitor extends AbstractQueryModelVisitor<QueryRulesetException> {
List<CopyRule> rules = new LinkedList<>();
private final Set<Value> superclasses = new HashSet<>();
private final Set<Value> superproperties = new HashSet<>();
@@ -257,11 +256,11 @@ public class QueryRuleset {
if (node instanceof InferUnion) {
// If this is the result of inference, search each tree for (non-standard) properties and add them
// to the set of properties for which to include schema information.
- final QueryModelVisitorBase<QueryRulesetException> propertyVisitor = new QueryModelVisitorBase<QueryRulesetException>() {
+ final AbstractQueryModelVisitor<QueryRulesetException> propertyVisitor = new AbstractQueryModelVisitor<QueryRulesetException>() {
@Override
public void meet(final StatementPattern node) {
if (node.getPredicateVar().hasValue()) {
- final URI predValue = (URI) node.getPredicateVar().getValue();
+ final IRI predValue = (IRI) node.getPredicateVar().getValue();
final String ns = predValue.getNamespace();
if (node instanceof FixedStatementPattern
&& (RDFS.SUBPROPERTYOF.equals(predValue) || OWL.EQUIVALENTPROPERTY.equals(predValue))) {
@@ -341,7 +340,7 @@ public class QueryRuleset {
* @param objValues Either null or a Set of Values that the object variable can have, tested using a filter
* @throws QueryRulesetException if the rule can't be created
*/
- private void addListRule(final Var subjVar, final Set<Value> subjValues, final URI predicate,
+ private void addListRule(final Var subjVar, final Set<Value> subjValues, final IRI predicate,
final Var objVar, final Set<Value> objValues) throws QueryRulesetException {
ListMemberOperator subjCondition = null;
ListMemberOperator objCondition = null;
@@ -463,7 +462,7 @@ public class QueryRuleset {
// consist of only variables (this would result in a rule that matches every triple).
// Needs to be done before inference, since inference rules may create such statement patterns
// that are OK because they won'd be converted to rules directly.
- te.visit(new QueryModelVisitorBase<QueryRulesetException>() {
+ te.visit(new AbstractQueryModelVisitor<QueryRulesetException>() {
@Override
public void meet(final StatementPattern node) throws QueryRulesetException {
if (!(node.getSubjectVar().hasValue() || node.getPredicateVar().hasValue() || node.getObjectVar().hasValue())) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/CopyToolTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/CopyToolTest.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/CopyToolTest.java
index fcf4d9e..d785052 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/CopyToolTest.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/CopyToolTest.java
@@ -57,6 +57,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -64,8 +65,6 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Tests for {@link CopyTool}.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
index 54e5b44..a1c731a 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
@@ -40,13 +40,6 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.hadoop.io.Text;
import org.apache.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.accumulo.mr.MRUtils;
@@ -59,6 +52,12 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
/**
* Tests for {@link MergeTool}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
index 1c83378..6a6a53c 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
@@ -49,35 +49,38 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-
-import info.aduna.iteration.CloseableIteration;
+
import junit.framework.Assert;
public class RulesetCopyIT {
private static final Logger log = Logger.getLogger(RulesetCopyIT.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private static final boolean IS_MOCK = false;
private static final String CHILD_SUFFIX = MergeTool.CHILD_SUFFIX;
@@ -141,7 +144,7 @@ public class RulesetCopyIT {
return new RyaType(lit);
}
- private static RyaType literal(final String lit, final URI type) {
+ private static RyaType literal(final String lit, final IRI type) {
return new RyaType(type, lit);
}
@@ -226,7 +229,7 @@ public class RulesetCopyIT {
makeArgument(MRUtils.AC_USERNAME_PROP + CHILD_SUFFIX, accumuloDualInstanceDriver.getChildUser()),
makeArgument(MRUtils.AC_PWD_PROP + CHILD_SUFFIX, CHILD_PASSWORD),
makeArgument(MRUtils.TABLE_PREFIX_PROPERTY + CHILD_SUFFIX, CHILD_TABLE_PREFIX),
- makeArgument(MRUtils.AC_AUTH_PROP + CHILD_SUFFIX, accumuloDualInstanceDriver.getChildAuth() != null ? accumuloDualInstanceDriver.getChildAuth() : null),
+ makeArgument(MRUtils.AC_AUTH_PROP + CHILD_SUFFIX, accumuloDualInstanceDriver.getChildAuth()),
makeArgument(MRUtils.AC_ZK_PROP + CHILD_SUFFIX, accumuloDualInstanceDriver.getChildZooKeepers() != null ? accumuloDualInstanceDriver.getChildZooKeepers() : "localhost"),
makeArgument(CopyTool.CHILD_TOMCAT_URL_PROP, CHILD_TOMCAT_URL),
makeArgument(CopyTool.CREATE_CHILD_INSTANCE_TYPE_PROP, (IS_MOCK ? InstanceType.MOCK : InstanceType.MINI).toString()),
@@ -348,7 +351,7 @@ public class RulesetCopyIT {
statement("test:University1", "test:telephone", literal("555")),
statement("test:FullProfessor1", "test:worksFor", "test:University1"),
statement("test:FullProfessor1", "test:hired", literal("2001-01-01T04:01:02.000Z", XMLSchema.DATETIME)),
- statement("test:University1", "geo:asWKT", literal("Point(-77.03524 38.889468)", new URIImpl("http://www.opengis.net/ont/geosparql#wktLiteral")))
+ statement("test:University1", "geo:asWKT", literal("Point(-77.03524 38.889468)", VF.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral")))
};
// These aren't solutions but should be copied:
final RyaStatement[] copyStatements = {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
index 8901461..3b4358b 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
@@ -23,12 +23,12 @@ import static org.junit.Assert.assertTrue;
import java.util.Date;
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RyaDAOException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Utility methods for testing merging/copying.
@@ -54,7 +54,7 @@ public final class TestUtils {
/**
* Indicates when something occurred: before or after.
*/
- public static enum Occurrence {
+ public enum Occurrence {
BEFORE(-1),
AFTER(1);
@@ -82,7 +82,7 @@ public final class TestUtils {
* is similar to {@code java.util.concurrent.TimeUnit} but adds the week,
* month, and year units and only converts to milliseconds.
*/
- public static enum CalendarUnit {
+ public enum CalendarUnit {
MILLISECOND(1L),
SECOND(1000L * MILLISECOND.getMilliseconds()),
MINUTE(60L * SECOND.getMilliseconds()),
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
index a988bc7..731952a 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
@@ -57,11 +57,11 @@ import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.calrissian.mango.collect.CloseableIterable;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
@@ -430,10 +430,10 @@ public class CreateFluoPcj {
}
if (predVal != null) {
- if(!(predVal instanceof URI)) {
+ if(!(predVal instanceof IRI)) {
throw new AssertionError("Predicate must be a URI.");
}
- predURI = RdfToRyaConversions.convertURI((URI) predVal);
+ predURI = RdfToRyaConversions.convertURI((IRI) predVal);
}
if (objVal != null ) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
index 24adde9..0e7c7cf 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreatePeriodicQuery.java
@@ -32,8 +32,8 @@ import org.apache.rya.indexing.pcj.storage.PeriodicQueryResultStorage;
import org.apache.rya.indexing.pcj.storage.PeriodicQueryStorageException;
import org.apache.rya.periodic.notification.api.PeriodicNotificationClient;
import org.apache.rya.periodic.notification.notification.PeriodicNotification;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/DeleteFluoPcj.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/DeleteFluoPcj.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/DeleteFluoPcj.java
index e0123be..0aaed64 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/DeleteFluoPcj.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/DeleteFluoPcj.java
@@ -39,7 +39,7 @@ import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryMetadataDAO;
import org.apache.rya.indexing.pcj.fluo.app.query.StatementPatternIdManager;
import org.apache.rya.indexing.pcj.fluo.app.query.UnsupportedQueryException;
import org.apache.rya.indexing.pcj.fluo.app.util.FluoQueryUtils;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java
index 8f5bbfe..170711f 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/ListFluoQueries.java
@@ -28,9 +28,9 @@ import org.apache.rya.api.client.CreatePCJ.ExportStrategy;
import org.apache.rya.api.client.CreatePCJ.QueryType;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryMetadataDAO;
import org.apache.rya.indexing.pcj.fluo.app.query.QueryMetadata;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/pom.xml b/extras/rya.pcj.fluo/pcj.fluo.app/pom.xml
index b62beaf..1c6d189 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/pom.xml
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/pom.xml
@@ -79,8 +79,8 @@ under the License.
<artifactId>fluo-recipes-accumulo</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/AggregationResultUpdater.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/AggregationResultUpdater.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/AggregationResultUpdater.java
index 4fbaad9..a3473ec 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/AggregationResultUpdater.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/AggregationResultUpdater.java
@@ -46,7 +46,7 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.query.AggregationMetadata;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import com.google.common.collect.ImmutableMap;
@@ -195,19 +195,24 @@ public class AggregationResultUpdater extends AbstractNodeUpdater {
// System.out.println("vois.accept(" + className + ".class, ");};};
) {
// These classes are allowed to be deserialized. Others throw InvalidClassException.
- vois.accept(AggregationState.class,
- AverageState.class,
- java.util.HashMap.class,
- java.math.BigInteger.class,
- java.lang.Number.class,
- java.math.BigDecimal.class,
- org.openrdf.query.impl.MapBindingSet.class,
- java.util.LinkedHashMap.class,
- org.openrdf.query.impl.BindingImpl.class,
- org.openrdf.model.impl.URIImpl.class,
- org.openrdf.model.impl.LiteralImpl.class,
- org.openrdf.model.impl.DecimalLiteralImpl.class,
- org.openrdf.model.impl.IntegerLiteralImpl.class);
+ vois.accept(
+ AggregationState.class,
+ AverageState.class,
+ java.lang.Long.class,
+ java.lang.Number.class,
+ java.math.BigDecimal.class,
+ java.math.BigInteger.class,
+ java.util.HashMap.class,
+ java.util.LinkedHashMap.class,
+ org.eclipse.rdf4j.query.impl.MapBindingSet.class,
+ org.eclipse.rdf4j.query.impl.SimpleBinding.class,
+ org.eclipse.rdf4j.model.impl.SimpleIRI.class,
+ org.eclipse.rdf4j.model.impl.SimpleLiteral.class,
+ org.eclipse.rdf4j.model.impl.DecimalLiteral.class,
+ org.eclipse.rdf4j.model.impl.IntegerLiteral.class,
+ org.eclipse.rdf4j.model.impl.NumericLiteral.class,
+ org.eclipse.rdf4j.query.AbstractBindingSet.class
+ );
vois.accept("[B"); // Array of Bytes
final Object o = vois.readObject();
if(o instanceof AggregationState) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraph.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraph.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraph.java
index ed3c7ce..e0b5df9 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraph.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraph.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -27,10 +28,10 @@ import java.util.UUID;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
import com.google.common.base.Preconditions;
@@ -85,7 +86,7 @@ public class ConstructGraph {
private Map<String, BNode> getBNodeMap() {
Map<String, BNode> bNodeMap = new HashMap<>();
for(String name: bNodeNames) {
- bNodeMap.put(name, new BNodeImpl(UUID.randomUUID().toString()));
+ bNodeMap.put(name, SimpleValueFactory.getInstance().createBNode(UUID.randomUUID().toString()));
}
return bNodeMap;
}
@@ -100,7 +101,7 @@ public class ConstructGraph {
/**
* Creates a construct query graph represented as a Set of {@link RyaStatement}s
- * @param bs - VisiblityBindingSet used to build statement BindingSets
+ * @param bs - VisibilityBindingSet used to build statement BindingSets
* @return - Set of RyaStatements that represent a construct query graph.
*/
public Set<RyaStatement> createGraphFromBindingSet(VisibilityBindingSet bs) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
index 1563bb5..fbf95fc 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
@@ -18,6 +18,7 @@ package org.apache.rya.indexing.pcj.fluo.app;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.Optional;
@@ -27,16 +28,18 @@ import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
@@ -44,9 +47,9 @@ import com.google.common.base.Preconditions;
/**
* This class projects a VisibilityBindingSet onto a RyaStatement. The Binding
* {@link Value}s that get projected onto subject, predicate and object are
- * indicated by the names {@link ConstructProjection#getSubjectSourceVar()},
- * {@link ConstructProjection#getPredicateSourceVar()} and
- * {@link ConstructProjection#getObjectSourceVar()} and must satisfy standard
+ * indicated by the names {@link ConstructProjection#getSubjectSourceName()},
+ * {@link ConstructProjection#getPredicateSourceName()} and
+ * {@link ConstructProjection#getObjectSourceName()} and must satisfy standard
* RDF constraints for RDF subjects, predicates and objects. The purpose of
* projecting {@link BindingSet}s in this way is to provide functionality for
* SPARQL Construct queries which create RDF statements from query results.
@@ -55,6 +58,7 @@ import com.google.common.base.Preconditions;
public class ConstructProjection {
private static final Logger log = Logger.getLogger(ConstructProjection.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private String subjName;
private String predName;
private String objName;
@@ -69,17 +73,17 @@ public class ConstructProjection {
Preconditions.checkNotNull(subjectVar);
Preconditions.checkNotNull(predicateVar);
Preconditions.checkNotNull(objectVar);
- subjName = subjectVar.getName();
- predName = predicateVar.getName();
- objName = objectVar.getName();
+ subjName = VarNameUtils.createSimpleConstVarName(subjectVar);
+ predName = VarNameUtils.createSimpleConstVarName(predicateVar);
+ objName = VarNameUtils.createSimpleConstVarName(objectVar);
Preconditions.checkNotNull(subjName);
Preconditions.checkNotNull(predName);
Preconditions.checkNotNull(objName);
this.subjVar = subjectVar;
this.predVar = predicateVar;
this.objVar = objectVar;
- if((subjVar.isAnonymous() || subjName.startsWith("-anon-")) && subjectVar.getValue() == null) {
- subjValue = Optional.of(new BNodeImpl(""));
+ if ((subjVar.isAnonymous() || VarNameUtils.isAnonymous(subjName)) && subjectVar.getValue() == null) {
+ subjValue = Optional.of(VF.createBNode(""));
} else {
subjValue = Optional.ofNullable(subjectVar.getValue());
}
@@ -93,12 +97,12 @@ public class ConstructProjection {
/**
* Returns a Var with info about the Value projected onto the RyaStatement
- * subject. If the org.openrdf.query.algebra.Var returned by this method is
+ * subject. If the org.eclipse.rdf4j.query.algebra.Var returned by this method is
* not constant (as indicated by {@link Var#isConstant()}, then
* {@link Var#getName()} is the Binding name that gets projected. If the Var
* is constant, then {@link Var#getValue()} is assigned to the subject
*
- * @return {@link org.openrdf.query.algebra.Var} containing info about
+ * @return {@link org.eclipse.rdf4j.query.algebra.Var} containing info about
* Binding that gets projected onto the subject
*/
public String getSubjectSourceName() {
@@ -107,12 +111,12 @@ public class ConstructProjection {
/**
* Returns a Var with info about the Value projected onto the RyaStatement
- * predicate. If the org.openrdf.query.algebra.Var returned by this method
+ * predicate. If the org.eclipse.rdf4j.query.algebra.Var returned by this method
* is not constant (as indicated by {@link Var#isConstant()}, then
* {@link Var#getName()} is the Binding name that gets projected. If the Var
* is constant, then {@link Var#getValue()} is assigned to the predicate
*
- * @return {@link org.openrdf.query.algebra.Var} containing info about
+ * @return {@link org.eclipse.rdf4j.query.algebra.Var} containing info about
* Binding that gets projected onto the predicate
*/
public String getPredicateSourceName() {
@@ -121,12 +125,12 @@ public class ConstructProjection {
/**
* Returns a Var with info about the Value projected onto the RyaStatement
- * object. If the org.openrdf.query.algebra.Var returned by this method is
+ * object. If the org.eclipse.rdf4j.query.algebra.Var returned by this method is
* not constant (as indicated by {@link Var#isConstant()}, then
* {@link Var#getName()} is the Binding name that gets projected. If the Var
* is constant, then {@link Var#getValue()} is assigned to the object
*
- * @return {@link org.openrdf.query.algebra.Var} containing info about
+ * @return {@link org.eclipse.rdf4j.query.algebra.Var} containing info about
* Binding that gets projected onto the object
*/
public String getObjectSourceName() {
@@ -157,9 +161,9 @@ public class ConstructProjection {
/**
* @return SubjectPattern representation of this ConstructProjection
- * containing the {@link ConstructProjection#subjectSourceVar},
- * {@link ConstructProjection#predicateSourceVar},
- * {@link ConstructProjection#objectSourceVar}
+ * containing the {@link ConstructProjection#getSubjectSourceName},
+ * {@link ConstructProjection#getPredicateSourceName},
+ * {@link ConstructProjection#getObjectSourceName}
*/
public StatementPattern getStatementPatternRepresentation() {
return new StatementPattern(subjVar, predVar, objVar);
@@ -168,22 +172,22 @@ public class ConstructProjection {
/**
* Projects a given BindingSet onto a RyaStatement. The subject, predicate,
* and object are extracted from the input VisibilityBindingSet (if the
- * subjectSourceVar, predicateSourceVar, objectSourceVar is resp.
- * non-constant) and from the Var Value itself (if subjectSourceVar,
- * predicateSource, objectSourceVar is resp. constant).
+ * getSubjectSourceName, getPredicateSourceName, getObjectSourceName is resp.
+ * non-constant) and from the Var Value itself (if getSubjectSourceName,
+ * predicateSource, getObjectSourceName is resp. constant).
*
*
* @param vBs
* - Visibility BindingSet that gets projected onto an RDF
* Statement BindingSet with Binding names subject, predicate and
* object
- * @param bNodeMap - Optional Map used to pass {@link BNode}s for given variable names into
+ * @param bNodes - Optional Map used to pass {@link BNode}s for given variable names into
* multiple {@link ConstructProjection}s. This allows a ConstructGraph to create
* RyaStatements with the same BNode for a given variable name across multiple ConstructProjections.
* @return - RyaStatement whose values are determined by
- * {@link ConstructProjection#getSubjectSourceVar()},
- * {@link ConstructProjection#getPredicateSourceVar()},
- * {@link ConstructProjection#getObjectSourceVar()}.
+ * {@link ConstructProjection#getSubjectSourceName()},
+ * {@link ConstructProjection#getPredicateSourceName()},
+ * {@link ConstructProjection#getObjectSourceName()}.
*
*/
public RyaStatement projectBindingSet(VisibilityBindingSet vBs, Map<String, BNode> bNodes) {
@@ -199,10 +203,10 @@ public class ConstructProjection {
Preconditions.checkNotNull(pred);
Preconditions.checkNotNull(obj);
Preconditions.checkArgument(subj instanceof Resource);
- Preconditions.checkArgument(pred instanceof URI);
+ Preconditions.checkArgument(pred instanceof IRI);
RyaURI subjType = RdfToRyaConversions.convertResource((Resource) subj);
- RyaURI predType = RdfToRyaConversions.convertURI((URI) pred);
+ RyaURI predType = RdfToRyaConversions.convertURI((IRI) pred);
RyaType objectType = RdfToRyaConversions.convertValue(obj);
RyaStatement statement = new RyaStatement(subjType, predType, objectType);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FilterResultUpdater.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FilterResultUpdater.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FilterResultUpdater.java
index 23d9fdf..d34b949 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FilterResultUpdater.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FilterResultUpdater.java
@@ -28,28 +28,28 @@ import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.util.FilterSerializer;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.TripleSource;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl;
-import org.openrdf.query.algebra.evaluation.util.QueryEvaluationUtil;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.StrictEvaluationStrategy;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* Updates the results of a Filter node when its child has added a new Binding
@@ -65,9 +65,9 @@ public class FilterResultUpdater extends AbstractNodeUpdater {
/**
* Is used to evaluate the conditions of a {@link Filter}.
*/
- private static final EvaluationStrategyImpl evaluator = new EvaluationStrategyImpl(
+ private static final StrictEvaluationStrategy evaluator = new StrictEvaluationStrategy(
new TripleSource() {
- private final ValueFactory valueFactory = new ValueFactoryImpl();
+ private final ValueFactory valueFactory = SimpleValueFactory.getInstance();
@Override
public ValueFactory getValueFactory() {
@@ -77,12 +77,12 @@ public class FilterResultUpdater extends AbstractNodeUpdater {
@Override
public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements(
final Resource arg0,
- final URI arg1,
+ final IRI arg1,
final Value arg2,
final Resource... arg3) throws QueryEvaluationException {
throw new UnsupportedOperationException();
}
- });
+ },null);
/**
* Updates the results of a Filter node when one of its child has added a
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverter.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverter.java
index 43a36de..ca98faf 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverter.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/FluoStringConverter.java
@@ -23,38 +23,37 @@ import static org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants.DE
import static org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants.TYPE_DELIM;
import static org.apache.rya.indexing.pcj.fluo.app.IncrementalUpdateConstants.URI_TYPE;
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-import org.openrdf.model.BNode;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-
-import com.google.common.base.Preconditions;
-
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+
+import com.google.common.base.Preconditions;
+
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
/**
- * Contains method that convert between the Sesame representations of RDF
+ * Contains method that convert between the RDF4J representations of RDF
* components and the Strings that are used by the Fluo PCJ application.
*/
@DefaultAnnotation(NonNull.class)
public class FluoStringConverter {
/**
- * Extract the {@link Binding} strings from a {@link BindingSet}'s string form.
+ * Extract the {@link BindingSet} strings from a {@link BindingSet}'s string form.
*
* @param bindingSetString - A {@link BindingSet} in its Fluo String form. (not null)
- * @return The set's {@link Binding}s in Fluo String form. (not null)
+ * @return The set's {@link BindingSet}s in Fluo String form. (not null)
*/
public static String[] toBindingStrings(final String bindingSetString) {
checkNotNull(bindingSetString);
@@ -66,7 +65,7 @@ public class FluoStringConverter {
* into the object version.
*
* @param patternString - The {@link StatementPattern} represented as a String. (not null)
- * @return A {@link StatementPatter} built from the string.
+ * @return A {@link StatementPattern} built from the string.
*/
public static StatementPattern toStatementPattern(final String patternString) {
checkNotNull(patternString);
@@ -93,29 +92,30 @@ public class FluoStringConverter {
checkNotNull(varString);
final String[] varParts = varString.split(TYPE_DELIM);
final String name = varParts[0];
-
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+
// The variable is a constant value.
if(varParts.length > 1) {
final String dataTypeString = varParts[1];
if(dataTypeString.equals(URI_TYPE)) {
// Handle a URI object.
Preconditions.checkArgument(varParts.length == 2);
- final String valueString = name.substring("-const-".length());
- final Var var = new Var(name, new URIImpl(valueString));
+ final String valueString = VarNameUtils.removeConstant(name);
+ final Var var = new Var(name, vf.createIRI(valueString));
var.setConstant(true);
return var;
- } else if(dataTypeString.equals(RyaSchema.BNODE_NAMESPACE)) {
+ } else if(dataTypeString.equals(RyaSchema.BNODE_NAMESPACE)) {
// Handle a BNode object
Preconditions.checkArgument(varParts.length == 3);
- Var var = new Var(name);
- var.setValue(new BNodeImpl(varParts[2]));
+ final Var var = new Var(name);
+ var.setValue(vf.createBNode(varParts[2]));
return var;
} else {
// Handle a Literal Value.
Preconditions.checkArgument(varParts.length == 2);
- final String valueString = name.substring("-const-".length());
- final URI dataType = new URIImpl(dataTypeString);
- final Literal value = new LiteralImpl(valueString, dataType);
+ final String valueString = VarNameUtils.removeConstant(name);
+ final IRI dataType = vf.createIRI(dataTypeString);
+ final Literal value = vf.createLiteral(valueString, dataType);
final Var var = new Var(name, value);
var.setConstant(true);
return var;
@@ -141,24 +141,28 @@ public class FluoStringConverter {
final Var subjVar = sp.getSubjectVar();
String subj = subjVar.getName();
if(subjVar.getValue() != null) {
- Value subjValue = subjVar.getValue();
+ final Value subjValue = subjVar.getValue();
+ subj = VarNameUtils.createSimpleConstVarName(subjVar);
if (subjValue instanceof BNode ) {
- subj = subj + TYPE_DELIM + RyaSchema.BNODE_NAMESPACE + TYPE_DELIM + ((BNode) subjValue).getID();
+ subj = subj + TYPE_DELIM + RyaSchema.BNODE_NAMESPACE + TYPE_DELIM + ((BNode) subjValue).getID();
} else {
subj = subj + TYPE_DELIM + URI_TYPE;
}
- }
+ }
final Var predVar = sp.getPredicateVar();
String pred = predVar.getName();
if(predVar.getValue() != null) {
+ pred = VarNameUtils.createSimpleConstVarName(predVar);
pred = pred + TYPE_DELIM + URI_TYPE;
}
final Var objVar = sp.getObjectVar();
String obj = objVar.getName();
if (objVar.getValue() != null) {
- final RyaType rt = RdfToRyaConversions.convertValue(objVar.getValue());
+ final Value objValue = objVar.getValue();
+ obj = VarNameUtils.createSimpleConstVarName(objVar);
+ final RyaType rt = RdfToRyaConversions.convertValue(objValue);
obj = obj + TYPE_DELIM + rt.getDataType().stringValue();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/PeriodicQueryUpdater.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/PeriodicQueryUpdater.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/PeriodicQueryUpdater.java
index 5171eee..e487802 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/PeriodicQueryUpdater.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/PeriodicQueryUpdater.java
@@ -29,11 +29,11 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQueryColumns;
import org.apache.rya.indexing.pcj.fluo.app.query.PeriodicQueryMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
/**
* This class adds the appropriate BinId Binding to each BindingSet that it processes. The BinIds
@@ -44,7 +44,7 @@ import org.openrdf.query.algebra.evaluation.QueryBindingSet;
public class PeriodicQueryUpdater extends AbstractNodeUpdater {
private static final Logger log = Logger.getLogger(PeriodicQueryUpdater.class);
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final VisibilityBindingSetSerDe BS_SERDE = new VisibilityBindingSetSerDe();
/**
@@ -61,7 +61,7 @@ public class PeriodicQueryUpdater extends AbstractNodeUpdater {
for(Long id: binIds) {
//create binding set value bytes
QueryBindingSet binnedBs = new QueryBindingSet(bs);
- binnedBs.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, vf.createLiteral(id));
+ binnedBs.addBinding(IncrementalUpdateConstants.PERIODIC_BIN_ID, VF.createLiteral(id));
VisibilityBindingSet visibilityBindingSet = new VisibilityBindingSet(binnedBs, bs.getVisibility());
Bytes periodicBsBytes = BS_SERDE.serialize(visibilityBindingSet);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ProjectionResultUpdater.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ProjectionResultUpdater.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ProjectionResultUpdater.java
index eacbf99..8f94e36 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ProjectionResultUpdater.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ProjectionResultUpdater.java
@@ -29,7 +29,7 @@ import org.apache.rya.indexing.pcj.fluo.app.query.ProjectionMetadata;
import org.apache.rya.indexing.pcj.fluo.app.util.BindingSetUtil;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSetSerDe;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
index ace9e76..e57ec88 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.pcj.fluo.app.batch;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.Objects;
import org.apache.fluo.api.data.Column;
@@ -24,7 +25,7 @@ import org.apache.fluo.api.data.Span;
import org.apache.rya.api.function.join.LazyJoiningIterator.Side;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType;
-import org.openrdf.query.Binding;
+import org.eclipse.rdf4j.query.Binding;
/**
* This class updates join results based on parameters specified for the join's
[28/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/ApproxEqualsDetector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/ApproxEqualsDetector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/ApproxEqualsDetector.java
index c450951..fbd0aff 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/ApproxEqualsDetector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/ApproxEqualsDetector.java
@@ -19,7 +19,7 @@
package org.apache.rya.indexing.smarturi.duplication;
import org.apache.rya.indexing.smarturi.SmartUriException;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
/**
* Interface for detecting if two objects of type {@code T} are considered
@@ -57,10 +57,10 @@ public interface ApproxEqualsDetector<T> {
public Class<?> getTypeClass();
/**
- * @return the {@link URI} for the XML schema type this detector is used
+ * @return the {@link IRI} for the XML schema type this detector is used
* for.
*/
- public URI getXmlSchemaUri();
+ public IRI getXmlSchemaUri();
/**
* Checks if two string representations of objects are approximately equal.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
index 220db30..1d17097 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
@@ -44,10 +44,10 @@ import org.apache.rya.indexing.smarturi.SmartUriAdapter;
import org.apache.rya.indexing.smarturi.SmartUriException;
import org.apache.rya.indexing.smarturi.duplication.conf.DuplicateDataConfig;
import org.calrissian.mango.types.exception.TypeEncodingException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.joda.time.DateTime;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.ImmutableMap;
@@ -63,7 +63,7 @@ import com.google.common.collect.ImmutableMap;
* compared.
*/
public class DuplicateDataDetector {
- private final Map<URI, ApproxEqualsDetector<?>> uriMap = new HashMap<>();
+ private final Map<IRI, ApproxEqualsDetector<?>> uriMap = new HashMap<>();
private final Map<Class<?>, ApproxEqualsDetector<?>> classMap = new HashMap<>();
private boolean isDetectionEnabled;
@@ -137,7 +137,7 @@ public class DuplicateDataDetector {
* if not specified.
* @param stringTolerance the {@link String} tolerance value or {@code null}
* if not specified.
- * @param uriTolerance the {@link URI} tolerance value or {@code null} if
+ * @param uriTolerance the {@link IRI} tolerance value or {@code null} if
* not specified.
* @param equivalentTermsMap the {@link Map} of terms that are considered
* equivalent to each other. (not {@code null})
@@ -224,13 +224,13 @@ public class DuplicateDataDetector {
/**
* Compares two Smart URI's to determine if they have nearly identical data.
- * @param uri1 the first Smart {@link URI}. (not {@code null})
- * @param uri2 the second Smart {@link URI}. (not {@code null})
+ * @param uri1 the first Smart {@link IRI}. (not {@code null})
+ * @param uri2 the second Smart {@link IRI}. (not {@code null})
* @return {@code true} if the two Smart URI's have nearly identical data.
* {@code false} otherwise.
* @throws SmartUriException
*/
- public boolean compareSmartUris(final URI uri1, final URI uri2) throws SmartUriException {
+ public boolean compareSmartUris(final IRI uri1, final IRI uri2) throws SmartUriException {
requireNonNull(uri1);
requireNonNull(uri2);
final Entity entity1 = SmartUriAdapter.deserializeUriEntity(uri1);
@@ -270,7 +270,7 @@ public class DuplicateDataDetector {
final RyaType value2 = property2.getValue();
final String data1 = value1.getData();
final String data2 = value2.getData();
- final URI xmlSchemaUri1 = value1.getDataType();
+ final IRI xmlSchemaUri1 = value1.getDataType();
final ApproxEqualsDetector<?> approxEqualsDetector = uriMap.get(xmlSchemaUri1);
if (approxEqualsDetector == null) {
throw new SmartUriException("No appropriate detector found for the type: " + xmlSchemaUri1);
@@ -328,7 +328,7 @@ public class DuplicateDataDetector {
public boolean areObjectsApproxEquals(final Boolean lhs, final Boolean rhs) {
// Should never be almost equals when tolerance is 0, only exactly equals
// Otherwise if there's any tolerance specified everything is equal
- return tolerance.getValue() == 0 ? Objects.equals(lhs, rhs) : true;
+ return tolerance.getValue() != 0 || Objects.equals(lhs, rhs);
}
@Override
@@ -347,7 +347,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.BOOLEAN;
}
}
@@ -412,7 +412,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.BYTE;
}
}
@@ -486,7 +486,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.DATE;
}
}
@@ -559,7 +559,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.DATETIME;
}
}
@@ -638,7 +638,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.DOUBLE;
}
}
@@ -718,7 +718,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.FLOAT;
}
}
@@ -783,7 +783,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.INTEGER;
}
}
@@ -848,7 +848,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.LONG;
}
}
@@ -913,7 +913,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.SHORT;
}
}
@@ -988,7 +988,7 @@ public class DuplicateDataDetector {
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.STRING;
}
}
@@ -997,7 +997,7 @@ public class DuplicateDataDetector {
* Class to detect if two URIs are considered approximately equal to each
* other.
*/
- public static class UriApproxEqualsDetector implements ApproxEqualsDetector<URI> {
+ public static class UriApproxEqualsDetector implements ApproxEqualsDetector<IRI> {
private static final Tolerance DEFAULT_TOLERANCE = new Tolerance(1.0, ToleranceType.DIFFERENCE);
private final Tolerance tolerance;
@@ -1010,7 +1010,7 @@ public class DuplicateDataDetector {
}
@Override
- public boolean areObjectsApproxEquals(final URI lhs, final URI rhs) {
+ public boolean areObjectsApproxEquals(final IRI lhs, final IRI rhs) {
if (isOnlyOneNull(lhs, rhs)) {
return false;
}
@@ -1049,17 +1049,17 @@ public class DuplicateDataDetector {
}
@Override
- public URI convertStringToObject(final String string) throws SmartUriException {
- return new URIImpl(string);
+ public IRI convertStringToObject(final String string) throws SmartUriException {
+ return SimpleValueFactory.getInstance().createIRI(string);
}
@Override
public Class<?> getTypeClass() {
- return URI.class;
+ return IRI.class;
}
@Override
- public URI getXmlSchemaUri() {
+ public IRI getXmlSchemaUri() {
return XMLSchema.ANYURI;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/MetadataNodeToSegmentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/MetadataNodeToSegmentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/MetadataNodeToSegmentConverter.java
index 9ee21d0..4b3322b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/MetadataNodeToSegmentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/MetadataNodeToSegmentConverter.java
@@ -17,19 +17,19 @@ package org.apache.rya.indexing.statement.metadata.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.HashMap;
import java.util.List;
import java.util.Set;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
import org.apache.rya.indexing.external.matching.ExternalSetConverter;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.external.matching.QuerySegment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.ValueExpr;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
public class MetadataNodeToSegmentConverter implements ExternalSetConverter<StatementMetadataNode<?>> {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/OWLReify.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/OWLReify.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/OWLReify.java
index 640f358..cb81773 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/OWLReify.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/OWLReify.java
@@ -17,31 +17,32 @@ package org.apache.rya.indexing.statement.metadata.matching;
* specific language governing permissions and limitations
* under the License.
*/
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
+
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
public class OWLReify {
/** http://www.w3.org/2002/07/owl#Annotation*/
- public final static URI ANNOTATION;
+ public final static IRI ANNOTATION;
/** http://www.w3.org/2002/07/owl#annotatedSource*/
- public static final URI SOURCE;
+ public static final IRI SOURCE;
/** http://www.w3.org/2002/07/owl#annotatedProperty*/
- public static final URI PROPERTY;
+ public static final IRI PROPERTY;
/** http://www.w3.org/2002/07/owl#annotatedTarget*/
- public static final URI TARGET;
+ public static final IRI TARGET;
static {
- ValueFactory factory = ValueFactoryImpl.getInstance();
- ANNOTATION = factory.createURI(OWL.NAMESPACE, "Annotation");
- PROPERTY = factory.createURI(OWL.NAMESPACE, "annotatedProperty");
- SOURCE = factory.createURI(OWL.NAMESPACE, "annotatedSource");
- TARGET = factory.createURI(OWL.NAMESPACE, "annotatedTarget");
+ ValueFactory factory = SimpleValueFactory.getInstance();
+ ANNOTATION = factory.createIRI(OWL.NAMESPACE, "Annotation");
+ PROPERTY = factory.createIRI(OWL.NAMESPACE, "annotatedProperty");
+ SOURCE = factory.createIRI(OWL.NAMESPACE, "annotatedSource");
+ TARGET = factory.createIRI(OWL.NAMESPACE, "annotatedTarget");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
index bfa0dfa..6571c83 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -30,11 +31,11 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.external.matching.ExternalSetProvider;
import org.apache.rya.indexing.external.matching.QuerySegment;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -100,8 +101,8 @@ public class StatementMetadataExternalSetProvider implements ExternalSetProvider
for (StatementPattern pattern : patterns) {
Var var = pattern.getPredicateVar();
- if (var.getValue() != null && var.getValue() instanceof URI) {
- RyaURI uri = RdfToRyaConversions.convertURI((URI) var.getValue());
+ if (var.getValue() != null && var.getValue() instanceof IRI) {
+ RyaURI uri = RdfToRyaConversions.convertURI((IRI) var.getValue());
if(expectedURI.contains(uri) || metadataProperties.contains(uri)) {
finalPatterns.add(pattern);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
index 363dba2..3d3b7ba 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
@@ -18,6 +18,7 @@ package org.apache.rya.indexing.statement.metadata.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import static java.util.Objects.requireNonNull;
import java.io.IOException;
@@ -45,24 +46,23 @@ import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
-import org.openrdf.model.BNode;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.EmptyIteration;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.EmptyIteration;
-
/**
* This class provides users with the ability to issue reified queries to Rya.
* As opposed to a single triple representing a statement, a reified query
@@ -361,13 +361,13 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
RyaURI context = null;
if (subjValue != null) {
- Preconditions.checkArgument(subjValue instanceof URI);
- subj = RdfToRyaConversions.convertURI((URI) subjValue);
+ Preconditions.checkArgument(subjValue instanceof IRI);
+ subj = RdfToRyaConversions.convertURI((IRI) subjValue);
}
if (predValue != null) {
- Preconditions.checkArgument(predValue instanceof URI);
- pred = RdfToRyaConversions.convertURI((URI) predValue);
+ Preconditions.checkArgument(predValue instanceof IRI);
+ pred = RdfToRyaConversions.convertURI((IRI) predValue);
}
if (objValue != null) {
@@ -375,7 +375,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
}
if(contextValue != null) {
- context = RdfToRyaConversions.convertURI((URI) contextValue);
+ context = RdfToRyaConversions.convertURI((IRI) contextValue);
}
return new RyaStatement(subj, pred, obj, context);
}
@@ -480,7 +480,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
* This is an {@link CloseableIteration} class that serves a number of
* purposes. It's primary purpose is to filter a CloseableIteration over
* {@link Map.Entry<RyaStatement,BindingSet>} using a specified property Map
- * from {@link RyaURI} to {@link org.openrdf.query.algebra.Var}. This
+ * from {@link RyaURI} to {@link org.eclipse.rdf4j.query.algebra.Var}. This
* Iteration iterates over the Entries in the user specified Iteration,
* comparing properties in the {@link StatementMetadata} Map contained in
* the RyaStatements with the property Map for this class. If the properties
@@ -657,7 +657,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
* Builds the BindingSet from the specified RyaStatement by using the
* StatementPattern for this class. This method checks whether
* StatementPattern has a {@link Value} for each position
- * {@link org.openrdf.query.algebra.Var} (Subject, Predicate, Object).
+ * {@link org.eclipse.rdf4j.query.algebra.Var} (Subject, Predicate, Object).
* If it doesn't have a Value, a Binding is created from the
* RyaStatement using the {@link RyaType} for the corresponding position
* (Subject, Predicate, Object).
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataOptimizer.java
index 02c174e..9207e26 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataOptimizer.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import static com.google.common.base.Preconditions.checkNotNull;
import org.apache.hadoop.conf.Configurable;
@@ -28,9 +29,9 @@ import org.apache.rya.indexing.external.matching.ExternalSetMatcher;
import org.apache.rya.indexing.external.matching.ExternalSetProvider;
import org.apache.rya.indexing.external.matching.QueryNodeListRater;
import org.apache.rya.indexing.external.matching.QuerySegment;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailConfig.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailConfig.java b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailConfig.java
index 23b6ee7..43af1fb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailConfig.java
+++ b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailConfig.java
@@ -1,16 +1,3 @@
-package org.apache.rya.sail.config;
-
-import org.openrdf.model.Graph;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.util.GraphUtil;
-import org.openrdf.model.util.GraphUtilException;
-import org.openrdf.sail.config.SailConfigException;
-import org.openrdf.sail.config.SailImplConfigBase;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -29,30 +16,41 @@ import org.openrdf.sail.config.SailImplConfigBase;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.sail.config;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Model;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.util.GraphUtil;
+import org.eclipse.rdf4j.model.util.GraphUtilException;
+import org.eclipse.rdf4j.sail.config.AbstractSailImplConfig;
+import org.eclipse.rdf4j.sail.config.SailConfigException;
/**
* @deprecated Use {@link AccumuloRdfConfiguration} instead.
*/
@Deprecated
-public class RyaAccumuloSailConfig extends SailImplConfigBase {
+public class RyaAccumuloSailConfig extends AbstractSailImplConfig {
public static final String NAMESPACE = "http://rya.apache.org/RyaAccumuloSail/Config#";
- public static final URI INSTANCE;
- public static final URI USER;
- public static final URI PASSWORD;
- public static final URI ZOOKEEPERS;
- public static final URI IS_MOCK;
+ public static final IRI INSTANCE;
+ public static final IRI USER;
+ public static final IRI PASSWORD;
+ public static final IRI ZOOKEEPERS;
+ public static final IRI IS_MOCK;
static {
- final ValueFactory factory = ValueFactoryImpl.getInstance();
- USER = factory.createURI(NAMESPACE, "user");
- PASSWORD = factory.createURI(NAMESPACE, "password");
- INSTANCE = factory.createURI(NAMESPACE, "instance");
- ZOOKEEPERS = factory.createURI(NAMESPACE, "zookeepers");
- IS_MOCK = factory.createURI(NAMESPACE, "isMock");
+ final ValueFactory factory = SimpleValueFactory.getInstance();
+ USER = factory.createIRI(NAMESPACE, "user");
+ PASSWORD = factory.createIRI(NAMESPACE, "password");
+ INSTANCE = factory.createIRI(NAMESPACE, "instance");
+ ZOOKEEPERS = factory.createIRI(NAMESPACE, "zookeepers");
+ IS_MOCK = factory.createIRI(NAMESPACE, "isMock");
}
private String user = "root";
@@ -116,45 +114,45 @@ public class RyaAccumuloSailConfig extends SailImplConfigBase {
}
@Override
- public Resource export(final Graph graph) {
- final Resource implNode = super.export(graph);
+ public Resource export(final Model model) {
+ final Resource implNode = super.export(model);
@SuppressWarnings("deprecation")
final
- ValueFactory v = graph.getValueFactory();
+ ValueFactory v = model.getValueFactory();
- graph.add(implNode, USER, v.createLiteral(user));
- graph.add(implNode, PASSWORD, v.createLiteral(password));
- graph.add(implNode, INSTANCE, v.createLiteral(instance));
- graph.add(implNode, ZOOKEEPERS, v.createLiteral(zookeepers));
- graph.add(implNode, IS_MOCK, v.createLiteral(isMock));
+ model.add(implNode, USER, v.createLiteral(user));
+ model.add(implNode, PASSWORD, v.createLiteral(password));
+ model.add(implNode, INSTANCE, v.createLiteral(instance));
+ model.add(implNode, ZOOKEEPERS, v.createLiteral(zookeepers));
+ model.add(implNode, IS_MOCK, v.createLiteral(isMock));
return implNode;
}
@Override
- public void parse(final Graph graph, final Resource implNode) throws SailConfigException {
- super.parse(graph, implNode);
+ public void parse(final Model model, final Resource implNode) throws SailConfigException {
+ super.parse(model, implNode);
System.out.println("parsing");
try {
- final Literal userLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, USER);
+ final Literal userLit = GraphUtil.getOptionalObjectLiteral(model, implNode, USER);
if (userLit != null) {
setUser(userLit.getLabel());
}
- final Literal pwdLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, PASSWORD);
+ final Literal pwdLit = GraphUtil.getOptionalObjectLiteral(model, implNode, PASSWORD);
if (pwdLit != null) {
setPassword(pwdLit.getLabel());
}
- final Literal instLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, INSTANCE);
+ final Literal instLit = GraphUtil.getOptionalObjectLiteral(model, implNode, INSTANCE);
if (instLit != null) {
setInstance(instLit.getLabel());
}
- final Literal zooLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, ZOOKEEPERS);
+ final Literal zooLit = GraphUtil.getOptionalObjectLiteral(model, implNode, ZOOKEEPERS);
if (zooLit != null) {
setZookeepers(zooLit.getLabel());
}
- final Literal mockLit = GraphUtil.getOptionalObjectLiteral(graph, implNode, IS_MOCK);
+ final Literal mockLit = GraphUtil.getOptionalObjectLiteral(model, implNode, IS_MOCK);
if (mockLit != null) {
setMock(Boolean.parseBoolean(mockLit.getLabel()));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailFactory.java b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailFactory.java
index 6f4d6c5..492dcbe 100644
--- a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaAccumuloSailFactory.java
@@ -1,17 +1,3 @@
-package org.apache.rya.sail.config;
-
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.ZooKeeperInstance;
-import org.apache.accumulo.core.client.mock.MockInstance;
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.config.SailConfigException;
-import org.openrdf.sail.config.SailFactory;
-import org.openrdf.sail.config.SailImplConfig;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -30,12 +16,24 @@ import org.openrdf.sail.config.SailImplConfig;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.sail.config;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.ZooKeeperInstance;
+import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.config.SailConfigException;
+import org.eclipse.rdf4j.sail.config.SailFactory;
+import org.eclipse.rdf4j.sail.config.SailImplConfig;
/**
* @deprecated Use {@link RyaSailFactory} instead.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaSailFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaSailFactory.java b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaSailFactory.java
index 56af9b4..15c89eb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaSailFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/sail/config/RyaSailFactory.java
@@ -47,8 +47,8 @@ import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/resources/META-INF/services/org.eclipse.rdf4j.sail.config.SailFactory
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/resources/META-INF/services/org.eclipse.rdf4j.sail.config.SailFactory b/extras/indexing/src/main/resources/META-INF/services/org.eclipse.rdf4j.sail.config.SailFactory
new file mode 100644
index 0000000..df3610d
--- /dev/null
+++ b/extras/indexing/src/main/resources/META-INF/services/org.eclipse.rdf4j.sail.config.SailFactory
@@ -0,0 +1 @@
+org.apache.rya.sail.config.RyaAccumuloSailFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/resources/META-INF/services/org.openrdf.sail.config.SailFactory
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/resources/META-INF/services/org.openrdf.sail.config.SailFactory b/extras/indexing/src/main/resources/META-INF/services/org.openrdf.sail.config.SailFactory
deleted file mode 100644
index 56f4407..0000000
--- a/extras/indexing/src/main/resources/META-INF/services/org.openrdf.sail.config.SailFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.rya.sail.config.RyaAccumuloSailFactory
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/resources/org/eclipse/rdf4j/repository/config/RyaAccumuloSail.ttl
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/resources/org/eclipse/rdf4j/repository/config/RyaAccumuloSail.ttl b/extras/indexing/src/main/resources/org/eclipse/rdf4j/repository/config/RyaAccumuloSail.ttl
new file mode 100644
index 0000000..0e9a6f8
--- /dev/null
+++ b/extras/indexing/src/main/resources/org/eclipse/rdf4j/repository/config/RyaAccumuloSail.ttl
@@ -0,0 +1,20 @@
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+@prefix rep: <http://www.openrdf.org/config/repository#>.
+@prefix sr: <http://www.openrdf.org/config/repository/sail#>.
+@prefix sail: <http://www.openrdf.org/config/sail#>.
+@prefix rac: <http://rya.apache.org/RyaAccumuloSail/Config#>.
+
+[] a rep:Repository ;
+ rep:repositoryID "{%Repository ID|RyaAccumuloSail%}" ;
+ rdfs:label "{%Repository title|RyaAccumuloSail Store%}" ;
+ rep:repositoryImpl [
+ rep:repositoryType "openrdf:SailRepository" ;
+ sr:sailImpl [
+ sail:sailType "rya:RyaAccumuloSail" ;
+ rac:user "{%Rya Accumulo user|root%}" ;
+ rac:password "{%Rya Accumulo password|root%}" ;
+ rac:instance "{%Rya Accumulo instance|dev%}" ;
+ rac:zookeepers "{%Rya Accumulo zookeepers|zoo1,zoo2,zoo3%}" ;
+ rac:isMock "{%Rya Accumulo is mock|false|true%}" ;
+ ]
+ ].
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/resources/org/openrdf/repository/config/RyaAccumuloSail.ttl
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/resources/org/openrdf/repository/config/RyaAccumuloSail.ttl b/extras/indexing/src/main/resources/org/openrdf/repository/config/RyaAccumuloSail.ttl
deleted file mode 100644
index 0e9a6f8..0000000
--- a/extras/indexing/src/main/resources/org/openrdf/repository/config/RyaAccumuloSail.ttl
+++ /dev/null
@@ -1,20 +0,0 @@
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
-@prefix rep: <http://www.openrdf.org/config/repository#>.
-@prefix sr: <http://www.openrdf.org/config/repository/sail#>.
-@prefix sail: <http://www.openrdf.org/config/sail#>.
-@prefix rac: <http://rya.apache.org/RyaAccumuloSail/Config#>.
-
-[] a rep:Repository ;
- rep:repositoryID "{%Repository ID|RyaAccumuloSail%}" ;
- rdfs:label "{%Repository title|RyaAccumuloSail Store%}" ;
- rep:repositoryImpl [
- rep:repositoryType "openrdf:SailRepository" ;
- sr:sailImpl [
- sail:sailType "rya:RyaAccumuloSail" ;
- rac:user "{%Rya Accumulo user|root%}" ;
- rac:password "{%Rya Accumulo password|root%}" ;
- rac:instance "{%Rya Accumulo instance|dev%}" ;
- rac:zookeepers "{%Rya Accumulo zookeepers|zoo1,zoo2,zoo3%}" ;
- rac:isMock "{%Rya Accumulo is mock|false|true%}" ;
- ]
- ].
[03/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizerTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizerTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizerTest.java
index 63c5d13..5be8e7e 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizerTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/QueryJoinSelectOptimizerTest.java
@@ -19,23 +19,12 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
-import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
-import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
-import org.apache.rya.rdftriplestore.evaluation.QueryJoinSelectOptimizer;
-import org.apache.rya.rdftriplestore.evaluation.RdfCloudTripleStoreSelectivityEvaluationStatistics;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
@@ -53,14 +42,20 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
+import org.apache.rya.api.persist.RdfEvalStatsDAO;
+import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
+import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.FilterOptimizer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.impl.FilterOptimizer;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class QueryJoinSelectOptimizerTest {
@@ -950,7 +945,7 @@ public class QueryJoinSelectOptimizerTest {
}
TupleExpr te = getTupleExpr(q6);
- TupleExpr te2 = (TupleExpr) te.clone();
+ TupleExpr te2 = te.clone();
System.out.println("Bindings are " + te.getBindingNames());
RdfCloudTripleStoreSelectivityEvaluationStatistics ars = new RdfCloudTripleStoreSelectivityEvaluationStatistics(arc, res, accc);
QueryJoinSelectOptimizer qjs = new QueryJoinSelectOptimizer(ars, accc);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatisticsTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatisticsTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatisticsTest.java
index bac1b11..77598e7 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatisticsTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/RdfCloudTripleStoreSelectivityEvaluationStatisticsTest.java
@@ -19,45 +19,37 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.TimeUnit;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
-import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
-import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
+import org.apache.rya.api.persist.RdfEvalStatsDAO;
+import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
+import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class RdfCloudTripleStoreSelectivityEvaluationStatisticsTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
index c1e7d10..f40b4e9 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/evaluation/StatementPatternEvalTest.java
@@ -37,23 +37,24 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.rdftriplestore.RdfCloudTripleStoreConnection.StoreTripleSource;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-
-import info.aduna.iteration.CloseableIteration;
public class StatementPatternEvalTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private AccumuloRyaDAO dao;
private AccumuloRdfConfiguration conf;
@@ -109,16 +110,16 @@ public class StatementPatternEvalTest {
Assert.assertEquals(3, bsList.size());
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new URIImpl("uri:Joe"));
- expected1.addBinding("c", new URIImpl("uri:context1"));
+ expected1.addBinding("x", VF.createIRI("uri:Joe"));
+ expected1.addBinding("c", VF.createIRI("uri:context1"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new URIImpl("uri:Doug"));
- expected2.addBinding("c", new URIImpl("uri:context2"));
+ expected2.addBinding("x", VF.createIRI("uri:Doug"));
+ expected2.addBinding("c", VF.createIRI("uri:context2"));
QueryBindingSet expected3 = new QueryBindingSet();
- expected3.addBinding("x", new URIImpl("uri:Eric"));
- expected3.addBinding("c", new URIImpl("uri:context3"));
+ expected3.addBinding("x", VF.createIRI("uri:Eric"));
+ expected3.addBinding("c", VF.createIRI("uri:context3"));
Set<BindingSet> expected = new HashSet<>(Arrays.asList(expected1, expected2, expected3));
Set<BindingSet> actual = new HashSet<>(bsList);
@@ -149,10 +150,10 @@ public class StatementPatternEvalTest {
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("c", new URIImpl("uri:context2"));
+ bsConstraint1.addBinding("c", VF.createIRI("uri:context2"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("c", new URIImpl("uri:context1"));
+ bsConstraint2.addBinding("c", VF.createIRI("uri:context1"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = eval.evaluate(spList.get(0), Arrays.asList(bsConstraint1, bsConstraint2));
@@ -165,12 +166,12 @@ public class StatementPatternEvalTest {
Assert.assertEquals(2, bsList.size());
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new URIImpl("uri:Joe"));
- expected1.addBinding("c", new URIImpl("uri:context1"));
+ expected1.addBinding("x", VF.createIRI("uri:Joe"));
+ expected1.addBinding("c", VF.createIRI("uri:context1"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new URIImpl("uri:Doug"));
- expected2.addBinding("c", new URIImpl("uri:context2"));
+ expected2.addBinding("x", VF.createIRI("uri:Doug"));
+ expected2.addBinding("c", VF.createIRI("uri:context2"));
Set<BindingSet> expected = new HashSet<>(Arrays.asList(expected1, expected2));
Set<BindingSet> actual = new HashSet<>(bsList);
@@ -203,10 +204,10 @@ public class StatementPatternEvalTest {
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("c", new URIImpl("uri:context1"));
+ bsConstraint1.addBinding("c", VF.createIRI("uri:context1"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("c", new URIImpl("uri:context1"));
+ bsConstraint2.addBinding("c", VF.createIRI("uri:context1"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = eval.evaluate(spList.get(0), Arrays.asList(bsConstraint1, bsConstraint2));
@@ -219,8 +220,8 @@ public class StatementPatternEvalTest {
Assert.assertEquals(1, bsList.size());
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("x", new URIImpl("uri:Joe"));
- expected.addBinding("c", new URIImpl("uri:context1"));
+ expected.addBinding("x", VF.createIRI("uri:Joe"));
+ expected.addBinding("c", VF.createIRI("uri:context1"));
Assert.assertEquals(expected, bsList.get(0));
@@ -260,7 +261,7 @@ public class StatementPatternEvalTest {
Assert.assertEquals(1, bsList.size());
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("x", new URIImpl("uri:Joe"));
+ expected.addBinding("x", VF.createIRI("uri:Joe"));
Assert.assertEquals(expected, bsList.get(0));
@@ -289,7 +290,7 @@ public class StatementPatternEvalTest {
dao.add(statement3);
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new URIImpl("uri:Doug"));
+ bsConstraint1.addBinding("x", VF.createIRI("uri:Doug"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = eval.evaluate(spList.get(0), Arrays.asList(bsConstraint1));
@@ -301,7 +302,7 @@ public class StatementPatternEvalTest {
Assert.assertEquals(1, bsList.size());
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("x", new URIImpl("uri:Doug"));
+ expected.addBinding("x", VF.createIRI("uri:Doug"));
Assert.assertEquals(expected, bsList.get(0));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitorTest.java
index d239577..9c08468 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/AllValuesFromVisitorTest.java
@@ -29,44 +29,44 @@ import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
public class AllValuesFromVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
// Value types
- private final URI person = vf.createURI("urn:Person");
- private final URI dog = vf.createURI("urn:Dog");
+ private final IRI person = VF.createIRI("urn:Person");
+ private final IRI dog = VF.createIRI("urn:Dog");
// Predicates
- private final URI parent = vf.createURI("urn:parent");
- private final URI relative = vf.createURI("urn:relative");
+ private final IRI parent = VF.createIRI("urn:parent");
+ private final IRI relative = VF.createIRI("urn:relative");
// Restriction types
- private final URI parentsAreTallPeople = vf.createURI("urn:parentsAreTallPeople");
- private final URI parentsArePeople = vf.createURI("urn:parentsArePeople");
- private final URI relativesArePeople = vf.createURI("urn:relativesArePeople");
- private final URI parentsAreDogs = vf.createURI("urn:parentsAreDogs");
+ private final IRI parentsAreTallPeople = VF.createIRI("urn:parentsAreTallPeople");
+ private final IRI parentsArePeople = VF.createIRI("urn:parentsArePeople");
+ private final IRI relativesArePeople = VF.createIRI("urn:relativesArePeople");
+ private final IRI parentsAreDogs = VF.createIRI("urn:parentsAreDogs");
@Test
public void testRewriteTypePattern() throws Exception {
// Configure a mock instance engine with an ontology:
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- Map<Resource, Set<URI>> personAVF = new HashMap<>();
+ Map<Resource, Set<IRI>> personAVF = new HashMap<>();
personAVF.put(parentsAreTallPeople, new HashSet<>());
personAVF.put(parentsArePeople, new HashSet<>());
personAVF.put(relativesArePeople, new HashSet<>());
@@ -74,7 +74,7 @@ public class AllValuesFromVisitorTest {
personAVF.get(parentsArePeople).add(parent);
personAVF.get(relativesArePeople).add(relative);
personAVF.get(relativesArePeople).add(parent);
- Map<Resource, Set<URI>> dogAVF = new HashMap<>();
+ Map<Resource, Set<IRI>> dogAVF = new HashMap<>();
dogAVF.put(parentsAreDogs, new HashSet<>());
dogAVF.get(parentsAreDogs).add(parent);
when(inferenceEngine.getAllValuesFromByValueType(person)).thenReturn(personAVF);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitorTest.java
index 40f9098..0c5542e 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/DomainRangeVisitorTest.java
@@ -27,36 +27,36 @@ import java.util.Stack;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
public class DomainRangeVisitorTest {
private static final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory vf = new ValueFactoryImpl();
- private static final URI person = vf.createURI("lubm:Person");
- private static final URI advisor = vf.createURI("lubm:advisor");
- private static final URI takesCourse = vf.createURI("lubm:takesCourse");
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final IRI person = VF.createIRI("lubm:Person");
+ private static final IRI advisor = VF.createIRI("lubm:advisor");
+ private static final IRI takesCourse = VF.createIRI("lubm:takesCourse");
@Test
public void testRewriteTypePattern() throws Exception {
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- final Set<URI> domainPredicates = new HashSet<>();
- final Set<URI> rangePredicates = new HashSet<>();
+ final Set<IRI> domainPredicates = new HashSet<>();
+ final Set<IRI> rangePredicates = new HashSet<>();
domainPredicates.add(advisor);
domainPredicates.add(takesCourse);
rangePredicates.add(advisor);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitorTest.java
index ba6b7da..3ce93c0 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasSelfVisitorTest.java
@@ -25,34 +25,34 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
public class HasSelfVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- private static final URI narcissist = VF.createURI("urn:Narcissist");
- private static final URI love = VF.createURI("urn:love");
- private static final URI self = VF.createURI("urn:self");
+ private static final IRI narcissist = VF.createIRI("urn:Narcissist");
+ private static final IRI love = VF.createIRI("urn:love");
+ private static final IRI self = VF.createIRI("urn:self");
@Test
public void testTypePattern() throws Exception {
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- final Set<URI> narcissistProps = new HashSet<>();
+ final Set<IRI> narcissistProps = new HashSet<>();
narcissistProps.add(love);
when(inferenceEngine.getHasSelfImplyingType(narcissist)).thenReturn(narcissistProps);
final Var subj = new Var("s");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java
index c5f2a90..483d593 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/HasValueVisitorTest.java
@@ -23,50 +23,51 @@ import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.rdftriplestore.inference.HasValueVisitor;
-import org.apache.rya.rdftriplestore.inference.InferenceEngine;
+import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
public class HasValueVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- private final URI chordate = vf.createURI("urn:Chordate");
- private final URI vertebrate = vf.createURI("urn:Vertebrate");
- private final URI mammal = vf.createURI("urn:Mammal");
- private final URI tunicate = vf.createURI("urn:Tunicate");
- private final URI hasCharacteristic = vf.createURI("urn:anatomicalCharacteristic");
- private final URI notochord = vf.createURI("urn:notochord");
- private final URI skull = vf.createURI("urn:skull");
- private final URI belongsTo = vf.createURI("urn:belongsToTaxon");
- private final URI chordata = vf.createURI("urn:Chordata");
+ private final IRI chordate = VF.createIRI("urn:Chordate");
+ private final IRI vertebrate = VF.createIRI("urn:Vertebrate");
+ private final IRI mammal = VF.createIRI("urn:Mammal");
+ private final IRI tunicate = VF.createIRI("urn:Tunicate");
+ private final IRI hasCharacteristic = VF.createIRI("urn:anatomicalCharacteristic");
+ private final IRI notochord = VF.createIRI("urn:notochord");
+ private final IRI skull = VF.createIRI("urn:skull");
+ private final IRI belongsTo = VF.createIRI("urn:belongsToTaxon");
+ private final IRI chordata = VF.createIRI("urn:Chordata");
@Test
public void testRewriteTypePattern() throws Exception {
// Configure a mock instance engine with an ontology:
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- Map<URI, Set<Value>> vertebrateValues = new HashMap<>();
+ Map<IRI, Set<Value>> vertebrateValues = new HashMap<>();
vertebrateValues.put(hasCharacteristic, new HashSet<>());
vertebrateValues.put(belongsTo, new HashSet<>());
vertebrateValues.get(hasCharacteristic).add(notochord);
@@ -133,10 +134,10 @@ public class HasValueVisitorTest {
Assert.assertNotNull(belongsToFSP);
// Verify the expected FSPs for the appropriate properties:
Assert.assertEquals(2, hasCharacteristicFSP.statements.size());
- Assert.assertTrue(hasCharacteristicFSP.statements.contains(vf.createStatement(vertebrate, hasCharacteristic, skull)));
- Assert.assertTrue(hasCharacteristicFSP.statements.contains(vf.createStatement(vertebrate, hasCharacteristic, notochord)));
+ Assert.assertTrue(hasCharacteristicFSP.statements.contains(VF.createStatement(vertebrate, hasCharacteristic, skull)));
+ Assert.assertTrue(hasCharacteristicFSP.statements.contains(VF.createStatement(vertebrate, hasCharacteristic, notochord)));
Assert.assertEquals(1, belongsToFSP.statements.size());
- Assert.assertTrue(belongsToFSP.statements.contains(vf.createStatement(vertebrate, belongsTo, chordata)));
+ Assert.assertTrue(belongsToFSP.statements.contains(VF.createStatement(vertebrate, belongsTo, chordata)));
}
@Test
@@ -183,15 +184,24 @@ public class HasValueVisitorTest {
Assert.assertEquals(fsp.getSubjectVar(), sp.getObjectVar());
Assert.assertEquals(originalSP.getObjectVar(), fsp.getObjectVar());
// Verify FSP: should provide (type, value) pairs
- final Set<Statement> expectedStatements = new HashSet<>();
- final URI fspPred = (URI) fsp.getPredicateVar().getValue();
- expectedStatements.add(vf.createStatement(chordate, fspPred, notochord));
- expectedStatements.add(vf.createStatement(tunicate, fspPred, notochord));
- expectedStatements.add(vf.createStatement(vertebrate, fspPred, notochord));
- expectedStatements.add(vf.createStatement(mammal, fspPred, notochord));
- expectedStatements.add(vf.createStatement(vertebrate, fspPred, skull));
- expectedStatements.add(vf.createStatement(mammal, fspPred, skull));
- final Set<Statement> actualStatements = new HashSet<>(fsp.statements);
- Assert.assertEquals(expectedStatements, actualStatements);
+ final List<Statement> expectedStatements = new LinkedList<>();
+ final IRI fspPred = (IRI) fsp.getPredicateVar().getValue();
+ expectedStatements.add(new NullableStatementImpl(chordate, fspPred, notochord));
+ expectedStatements.add(new NullableStatementImpl(tunicate, fspPred, notochord));
+ expectedStatements.add(new NullableStatementImpl(vertebrate, fspPred, notochord));
+ expectedStatements.add(new NullableStatementImpl(mammal, fspPred, notochord));
+ expectedStatements.add(new NullableStatementImpl(vertebrate, fspPred, skull));
+ expectedStatements.add(new NullableStatementImpl(mammal, fspPred, skull));
+ final List<Statement> actualStatements = new LinkedList<>(fsp.statements);
+ Assert.assertTrue(containsAll(expectedStatements, actualStatements));
+
+ }
+ private boolean containsAll(List<Statement> expected, List<Statement> actual){
+ for( Statement a : actual){
+ if (!expected.contains(a)){
+ return false;
+ }
+ }
+ return true;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceEngineTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceEngineTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceEngineTest.java
index b3eb900..3ef9e96 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceEngineTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceEngineTest.java
@@ -32,17 +32,17 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.collect.Sets;
@@ -51,7 +51,7 @@ import junit.framework.TestCase;
public class InferenceEngineTest extends TestCase {
private Connector connector;
private AccumuloRyaDAO dao;
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private AccumuloRdfConfiguration conf;
private RdfCloudTripleStore store;
private InferenceEngine inferenceEngine;
@@ -102,19 +102,19 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
- final URI a = vf.createURI("urn:A");
- final URI b = vf.createURI("urn:B");
- final URI c = vf.createURI("urn:C");
- final URI d = vf.createURI("urn:D");
- final URI e = vf.createURI("urn:E");
- final URI f = vf.createURI("urn:F");
- final URI g = vf.createURI("urn:G");
- final URI z = vf.createURI("urn:Z");
- final URI missing = vf.createURI("urn:Missing");
- final Set<URI> empty = new HashSet<>();
- final Set<URI> belowLevel2 = new HashSet<>(Arrays.asList(new URI[] { a, b }));
- final Set<URI> belowLevel3 = new HashSet<>(Arrays.asList(new URI[] { a, b, c, d, e }));
- final Set<URI> belowLevel4 = new HashSet<>(Arrays.asList(new URI[] { a, b, c, d, e, f, g }));
+ final IRI a = VF.createIRI("urn:A");
+ final IRI b = VF.createIRI("urn:B");
+ final IRI c = VF.createIRI("urn:C");
+ final IRI d = VF.createIRI("urn:D");
+ final IRI e = VF.createIRI("urn:E");
+ final IRI f = VF.createIRI("urn:F");
+ final IRI g = VF.createIRI("urn:G");
+ final IRI z = VF.createIRI("urn:Z");
+ final IRI missing = VF.createIRI("urn:Missing");
+ final Set<IRI> empty = new HashSet<>();
+ final Set<IRI> belowLevel2 = new HashSet<>(Arrays.asList(a, b));
+ final Set<IRI> belowLevel3 = new HashSet<>(Arrays.asList(a, b, c, d, e));
+ final Set<IRI> belowLevel4 = new HashSet<>(Arrays.asList(a, b, c, d, e, f, g));
Assert.assertEquals(empty, inferenceEngine.getSubClasses(a));
Assert.assertEquals(empty, inferenceEngine.getSubClasses(b));
Assert.assertEquals(empty, inferenceEngine.getSubClasses(z));
@@ -141,20 +141,20 @@ public class InferenceEngineTest extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
final Graph graph = inferenceEngine.getSubPropertyOfGraph();
- final URI p = vf.createURI("urn:p");
- final URI q = vf.createURI("urn:q");
- final URI r = vf.createURI("urn:r");
- final URI s = vf.createURI("urn:s");
- final URI t = vf.createURI("urn:t");
- final URI u = vf.createURI("urn:u");
- final URI v = vf.createURI("urn:v");
- final URI w = vf.createURI("urn:w");
- final URI missing = vf.createURI("urn:Missing");
- final Set<URI> empty = new HashSet<>();
- final Set<URI> belowQ = new HashSet<>(Arrays.asList(new URI[] { p }));
- final Set<URI> belowR = new HashSet<>(Arrays.asList(new URI[] { p, r, s }));
- final Set<URI> belowT = new HashSet<>(Arrays.asList(new URI[] { p, q }));
- final Set<URI> belowU = new HashSet<>(Arrays.asList(new URI[] { p, q, r, s, t, u, v }));
+ final IRI p = VF.createIRI("urn:p");
+ final IRI q = VF.createIRI("urn:q");
+ final IRI r = VF.createIRI("urn:r");
+ final IRI s = VF.createIRI("urn:s");
+ final IRI t = VF.createIRI("urn:t");
+ final IRI u = VF.createIRI("urn:u");
+ final IRI v = VF.createIRI("urn:v");
+ final IRI w = VF.createIRI("urn:w");
+ final IRI missing = VF.createIRI("urn:Missing");
+ final Set<IRI> empty = new HashSet<>();
+ final Set<IRI> belowQ = new HashSet<>(Arrays.asList(p));
+ final Set<IRI> belowR = new HashSet<>(Arrays.asList(p, r, s));
+ final Set<IRI> belowT = new HashSet<>(Arrays.asList(p, q));
+ final Set<IRI> belowU = new HashSet<>(Arrays.asList(p, q, r, s, t, u, v));
Assert.assertEquals(empty, InferenceEngine.findParents(graph, p));
Assert.assertEquals(empty, InferenceEngine.findParents(graph, w));
Assert.assertEquals(empty, InferenceEngine.findParents(graph, missing));
@@ -189,29 +189,29 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
- final Set<URI> hasDomainD1 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:D1"));
- final Set<URI> hasDomainD2 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:D2"));
- final Set<URI> hasDomainD3 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:D3"));
- final Set<URI> hasRangeD1 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:D1"));
- final Set<URI> hasRangeD2 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:D2"));
- final Set<URI> hasRangeD3 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:D3"));
- final Set<URI> hasDomainR1 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:R1"));
- final Set<URI> hasDomainR2 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:R2"));
- final Set<URI> hasDomainR3 = inferenceEngine.getPropertiesWithDomain(vf.createURI("urn:R3"));
- final Set<URI> hasRangeR1 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:R1"));
- final Set<URI> hasRangeR2 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:R2"));
- final Set<URI> hasRangeR3 = inferenceEngine.getPropertiesWithRange(vf.createURI("urn:R3"));
- final Set<URI> empty = new HashSet<>();
- final Set<URI> expectedForward = new HashSet<>();
- expectedForward.add(vf.createURI("urn:p2"));
- expectedForward.add(vf.createURI("urn:p1"));
- expectedForward.add(vf.createURI("urn:q2"));
- expectedForward.add(vf.createURI("urn:q1"));
- final Set<URI> expectedInverse = new HashSet<>();
- expectedInverse.add(vf.createURI("urn:i1"));
- expectedInverse.add(vf.createURI("urn:i2"));
- expectedInverse.add(vf.createURI("urn:j1"));
- expectedInverse.add(vf.createURI("urn:j2"));
+ final Set<IRI> hasDomainD1 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:D1"));
+ final Set<IRI> hasDomainD2 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:D2"));
+ final Set<IRI> hasDomainD3 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:D3"));
+ final Set<IRI> hasRangeD1 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:D1"));
+ final Set<IRI> hasRangeD2 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:D2"));
+ final Set<IRI> hasRangeD3 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:D3"));
+ final Set<IRI> hasDomainR1 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:R1"));
+ final Set<IRI> hasDomainR2 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:R2"));
+ final Set<IRI> hasDomainR3 = inferenceEngine.getPropertiesWithDomain(VF.createIRI("urn:R3"));
+ final Set<IRI> hasRangeR1 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:R1"));
+ final Set<IRI> hasRangeR2 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:R2"));
+ final Set<IRI> hasRangeR3 = inferenceEngine.getPropertiesWithRange(VF.createIRI("urn:R3"));
+ final Set<IRI> empty = new HashSet<>();
+ final Set<IRI> expectedForward = new HashSet<>();
+ expectedForward.add(VF.createIRI("urn:p2"));
+ expectedForward.add(VF.createIRI("urn:p1"));
+ expectedForward.add(VF.createIRI("urn:q2"));
+ expectedForward.add(VF.createIRI("urn:q1"));
+ final Set<IRI> expectedInverse = new HashSet<>();
+ expectedInverse.add(VF.createIRI("urn:i1"));
+ expectedInverse.add(VF.createIRI("urn:i2"));
+ expectedInverse.add(VF.createIRI("urn:j1"));
+ expectedInverse.add(VF.createIRI("urn:j2"));
Assert.assertEquals(empty, hasDomainD1);
Assert.assertEquals(empty, hasRangeD1);
Assert.assertEquals(empty, hasDomainR1);
@@ -248,24 +248,24 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
- final Set<URI> properties = new HashSet<>();
- properties.add(vf.createURI("urn:headOf"));
- properties.add(vf.createURI("urn:temporaryHeadOf"));
- final Map<Resource, Set<URI>> chairDerivations = new HashMap<>();
- chairDerivations.put(vf.createURI("urn:Department"), properties);
- chairDerivations.put(vf.createURI("urn:ScienceDepartment"), properties);
- chairDerivations.put(vf.createURI("urn:HumanitiesDepartment"), properties);
- final Map<Resource, Set<URI>> deanDerivations = new HashMap<>();
- deanDerivations.put(vf.createURI("urn:College"), properties);
- final Map<Resource, Set<URI>> combinedDerivations = new HashMap<>(chairDerivations);
- combinedDerivations.put(vf.createURI("urn:College"), properties);
+ final Set<IRI> properties = new HashSet<>();
+ properties.add(VF.createIRI("urn:headOf"));
+ properties.add(VF.createIRI("urn:temporaryHeadOf"));
+ final Map<Resource, Set<IRI>> chairDerivations = new HashMap<>();
+ chairDerivations.put(VF.createIRI("urn:Department"), properties);
+ chairDerivations.put(VF.createIRI("urn:ScienceDepartment"), properties);
+ chairDerivations.put(VF.createIRI("urn:HumanitiesDepartment"), properties);
+ final Map<Resource, Set<IRI>> deanDerivations = new HashMap<>();
+ deanDerivations.put(VF.createIRI("urn:College"), properties);
+ final Map<Resource, Set<IRI>> combinedDerivations = new HashMap<>(chairDerivations);
+ combinedDerivations.put(VF.createIRI("urn:College"), properties);
// Get someValuesFrom restrictions given the direct types
- Assert.assertEquals(deanDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(vf.createURI("urn:Dean")));
- Assert.assertEquals(chairDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(vf.createURI("urn:Chair")));
+ Assert.assertEquals(deanDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(VF.createIRI("urn:Dean")));
+ Assert.assertEquals(chairDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(VF.createIRI("urn:Chair")));
// Finds the subtype's restrictions given the supertype
- Assert.assertEquals(combinedDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(vf.createURI("urn:Person")));
+ Assert.assertEquals(combinedDerivations, inferenceEngine.getSomeValuesFromByRestrictionType(VF.createIRI("urn:Person")));
// Finds nothing if given a subtype which is not a restriction
- Assert.assertEquals(new HashMap<>(), inferenceEngine.getSomeValuesFromByRestrictionType(vf.createURI("urn:ScienceDepartmentChair")));
+ Assert.assertEquals(new HashMap<>(), inferenceEngine.getSomeValuesFromByRestrictionType(VF.createIRI("urn:ScienceDepartmentChair")));
}
@Test
@@ -283,20 +283,20 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
- final Map<Resource, Set<URI>> restrictionsImplyingTerrier = new HashMap<>();
- final Set<URI> properties = new HashSet<>();
- properties.add(vf.createURI("urn:parent"));
- properties.add(vf.createURI("urn:relative"));
- restrictionsImplyingTerrier.put(vf.createURI("urn:Terrier"), properties);
- restrictionsImplyingTerrier.put(vf.createURI("urn:Cairn_Terrier"), properties);
- Assert.assertEquals(restrictionsImplyingTerrier, inferenceEngine.getAllValuesFromByValueType(vf.createURI("urn:Terrier")));
- final Map<Resource, Set<URI>> restrictionsImplyingDog = new HashMap<>(restrictionsImplyingTerrier);
- restrictionsImplyingDog.put(vf.createURI("urn:Dog"), properties);
- restrictionsImplyingDog.put(vf.createURI("urn:Retriever"), properties);
- Assert.assertEquals(restrictionsImplyingDog, inferenceEngine.getAllValuesFromByValueType(vf.createURI("urn:Dog")));
- final Map<Resource, Set<URI>> restrictionsImplyingMammal = new HashMap<>(restrictionsImplyingDog);
- restrictionsImplyingMammal.put(vf.createURI("urn:Person"), properties);
- Assert.assertEquals(restrictionsImplyingMammal, inferenceEngine.getAllValuesFromByValueType(vf.createURI("urn:Mammal")));
+ final Map<Resource, Set<IRI>> restrictionsImplyingTerrier = new HashMap<>();
+ final Set<IRI> properties = new HashSet<>();
+ properties.add(VF.createIRI("urn:parent"));
+ properties.add(VF.createIRI("urn:relative"));
+ restrictionsImplyingTerrier.put(VF.createIRI("urn:Terrier"), properties);
+ restrictionsImplyingTerrier.put(VF.createIRI("urn:Cairn_Terrier"), properties);
+ Assert.assertEquals(restrictionsImplyingTerrier, inferenceEngine.getAllValuesFromByValueType(VF.createIRI("urn:Terrier")));
+ final Map<Resource, Set<IRI>> restrictionsImplyingDog = new HashMap<>(restrictionsImplyingTerrier);
+ restrictionsImplyingDog.put(VF.createIRI("urn:Dog"), properties);
+ restrictionsImplyingDog.put(VF.createIRI("urn:Retriever"), properties);
+ Assert.assertEquals(restrictionsImplyingDog, inferenceEngine.getAllValuesFromByValueType(VF.createIRI("urn:Dog")));
+ final Map<Resource, Set<IRI>> restrictionsImplyingMammal = new HashMap<>(restrictionsImplyingDog);
+ restrictionsImplyingMammal.put(VF.createIRI("urn:Person"), properties);
+ Assert.assertEquals(restrictionsImplyingMammal, inferenceEngine.getAllValuesFromByValueType(VF.createIRI("urn:Mammal")));
}
@Test
@@ -320,14 +320,14 @@ public class InferenceEngineTest extends TestCase {
final Map<Resource, Set<Value>> typeToValueImplications = new HashMap<>();
final Set<Value> vertebrateTaxa = new HashSet<>();
final Set<Value> tunicateTaxa = new HashSet<>();
- vertebrateTaxa.add(vf.createURI("urn:Vertebrata"));
- tunicateTaxa.add(vf.createURI("urn:Tunicata"));
+ vertebrateTaxa.add(VF.createIRI("urn:Vertebrata"));
+ tunicateTaxa.add(VF.createIRI("urn:Tunicata"));
final Set<Value> mammalTaxa = new HashSet<>(vertebrateTaxa);
- mammalTaxa.add(vf.createURI("urn:Mammalia"));
- typeToValueImplications.put(vf.createURI("urn:Vertebrate"), vertebrateTaxa);
- typeToValueImplications.put(vf.createURI("urn:Tunicate"), tunicateTaxa);
- typeToValueImplications.put(vf.createURI("urn:Mammal"), mammalTaxa);
- Assert.assertEquals(typeToValueImplications, inferenceEngine.getHasValueByProperty(vf.createURI("urn:taxon")));
+ mammalTaxa.add(VF.createIRI("urn:Mammalia"));
+ typeToValueImplications.put(VF.createIRI("urn:Vertebrate"), vertebrateTaxa);
+ typeToValueImplications.put(VF.createIRI("urn:Tunicate"), tunicateTaxa);
+ typeToValueImplications.put(VF.createIRI("urn:Mammal"), mammalTaxa);
+ Assert.assertEquals(typeToValueImplications, inferenceEngine.getHasValueByProperty(VF.createIRI("urn:taxon")));
}
@Test
@@ -350,35 +350,35 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, insert).execute();
inferenceEngine.refreshGraph();
- final URI legs = vf.createURI("urn:walksUsingLegs");
- final URI taxon = vf.createURI("urn:taxon");
+ final IRI legs = VF.createIRI("urn:walksUsingLegs");
+ final IRI taxon = VF.createIRI("urn:taxon");
// Verify direct restrictions:
- final Map<URI, Set<Value>> valuesImplyingBiped = new HashMap<>();
+ final Map<IRI, Set<Value>> valuesImplyingBiped = new HashMap<>();
valuesImplyingBiped.put(legs, new HashSet<>());
- valuesImplyingBiped.get(legs).add(vf.createLiteral("2"));
- Assert.assertEquals(valuesImplyingBiped, inferenceEngine.getHasValueByType(vf.createURI("urn:Biped")));
- final Map<URI, Set<Value>> valuesImplyingMammal = new HashMap<>();
+ valuesImplyingBiped.get(legs).add(VF.createLiteral("2"));
+ Assert.assertEquals(valuesImplyingBiped, inferenceEngine.getHasValueByType(VF.createIRI("urn:Biped")));
+ final Map<IRI, Set<Value>> valuesImplyingMammal = new HashMap<>();
valuesImplyingMammal.put(taxon, new HashSet<>());
- valuesImplyingMammal.get(taxon).add(vf.createURI("urn:Mammalia"));
- Assert.assertEquals(valuesImplyingMammal, inferenceEngine.getHasValueByType(vf.createURI("urn:Mammal")));
- final Map<URI, Set<Value>> valuesImplyingTunicate = new HashMap<>();
+ valuesImplyingMammal.get(taxon).add(VF.createIRI("urn:Mammalia"));
+ Assert.assertEquals(valuesImplyingMammal, inferenceEngine.getHasValueByType(VF.createIRI("urn:Mammal")));
+ final Map<IRI, Set<Value>> valuesImplyingTunicate = new HashMap<>();
valuesImplyingTunicate.put(taxon, new HashSet<>());
- valuesImplyingTunicate.get(taxon).add(vf.createURI("urn:Tunicata"));
- Assert.assertEquals(valuesImplyingTunicate, inferenceEngine.getHasValueByType(vf.createURI("urn:Tunicate")));
- final Map<URI, Set<Value>> valuesImplyingPlant = new HashMap<>();
+ valuesImplyingTunicate.get(taxon).add(VF.createIRI("urn:Tunicata"));
+ Assert.assertEquals(valuesImplyingTunicate, inferenceEngine.getHasValueByType(VF.createIRI("urn:Tunicate")));
+ final Map<IRI, Set<Value>> valuesImplyingPlant = new HashMap<>();
valuesImplyingPlant.put(taxon, new HashSet<>());
- valuesImplyingPlant.get(taxon).add(vf.createURI("urn:Plantae"));
- Assert.assertEquals(valuesImplyingPlant, inferenceEngine.getHasValueByType(vf.createURI("urn:Plant")));
+ valuesImplyingPlant.get(taxon).add(VF.createIRI("urn:Plantae"));
+ Assert.assertEquals(valuesImplyingPlant, inferenceEngine.getHasValueByType(VF.createIRI("urn:Plant")));
// Verify indirect restrictions given a supertype, including multiple properties where relevant:
- final Map<URI, Set<Value>> valuesImplyingVertebrate = new HashMap<>();
+ final Map<IRI, Set<Value>> valuesImplyingVertebrate = new HashMap<>();
valuesImplyingVertebrate.put(taxon, new HashSet<>(valuesImplyingMammal.get(taxon)));
- valuesImplyingVertebrate.get(taxon).add(vf.createURI("urn:Vertebrata"));
- Assert.assertEquals(valuesImplyingVertebrate, inferenceEngine.getHasValueByType(vf.createURI("urn:Vertebrate")));
- final Map<URI, Set<Value>> valuesImplyingAnimal = new HashMap<>();
+ valuesImplyingVertebrate.get(taxon).add(VF.createIRI("urn:Vertebrata"));
+ Assert.assertEquals(valuesImplyingVertebrate, inferenceEngine.getHasValueByType(VF.createIRI("urn:Vertebrate")));
+ final Map<IRI, Set<Value>> valuesImplyingAnimal = new HashMap<>();
valuesImplyingAnimal.put(legs, valuesImplyingBiped.get(legs));
valuesImplyingAnimal.put(taxon, new HashSet<>(valuesImplyingVertebrate.get(taxon)));
valuesImplyingAnimal.get(taxon).addAll(valuesImplyingTunicate.get(taxon));
- Assert.assertEquals(valuesImplyingAnimal, inferenceEngine.getHasValueByType(vf.createURI("urn:Animal")));
+ Assert.assertEquals(valuesImplyingAnimal, inferenceEngine.getHasValueByType(VF.createIRI("urn:Animal")));
}
@Test
@@ -396,15 +396,15 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
inferenceEngine.refreshGraph();
- final Set<URI> subClassesA = inferenceEngine.getSubClasses(vf.createURI("urn:A"));
- final Set<URI> subClassesB = inferenceEngine.getSubClasses(vf.createURI("urn:B"));
- final Set<URI> expectedA = new HashSet<>();
- final Set<URI> expectedB = new HashSet<>();
- expectedB.add(vf.createURI("urn:Y"));
- expectedB.add(vf.createURI("urn:SubY"));
- expectedB.add(vf.createURI("urn:Z"));
+ final Set<IRI> subClassesA = inferenceEngine.getSubClasses(VF.createIRI("urn:A"));
+ final Set<IRI> subClassesB = inferenceEngine.getSubClasses(VF.createIRI("urn:B"));
+ final Set<IRI> expectedA = new HashSet<>();
+ final Set<IRI> expectedB = new HashSet<>();
+ expectedB.add(VF.createIRI("urn:Y"));
+ expectedB.add(VF.createIRI("urn:SubY"));
+ expectedB.add(VF.createIRI("urn:Z"));
expectedA.addAll(expectedB);
- expectedA.add(vf.createURI("urn:X"));
+ expectedA.add(VF.createIRI("urn:X"));
Assert.assertEquals(expectedA, subClassesA);
Assert.assertEquals(expectedB, subClassesB);
}
@@ -433,14 +433,14 @@ public class InferenceEngineTest extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
inferenceEngine.refreshGraph();
- final URI mother = vf.createURI("urn:Mother");
- final URI father = vf.createURI("urn:Father");
- final URI woman = vf.createURI("urn:Woman");
- final URI parent = vf.createURI("urn:Parent");
- final URI man = vf.createURI("urn:Man");
- final URI mom = vf.createURI("urn:Mom");
- final URI immediateFamilyMember = vf.createURI("urn:ImmediateFamilyMember");
- final URI relative = vf.createURI("urn:Relative");
+ final IRI mother = VF.createIRI("urn:Mother");
+ final IRI father = VF.createIRI("urn:Father");
+ final IRI woman = VF.createIRI("urn:Woman");
+ final IRI parent = VF.createIRI("urn:Parent");
+ final IRI man = VF.createIRI("urn:Man");
+ final IRI mom = VF.createIRI("urn:Mom");
+ final IRI immediateFamilyMember = VF.createIRI("urn:ImmediateFamilyMember");
+ final IRI relative = VF.createIRI("urn:Relative");
final List<Set<Resource>> intersectionsImplyingMother = Arrays.asList(Sets.newHashSet(woman, parent));
Assert.assertEquals(intersectionsImplyingMother, inferenceEngine.getIntersectionsImplying(mother));
@@ -450,7 +450,7 @@ public class InferenceEngineTest extends TestCase {
// Check that Mother is a subclassOf Parent and Woman and
// ImmediateFamilyMember and Relative. Also, Mother is a subclassOf
// Mother and Mom through inferring equivalentClass.
- final Set<URI> motherSuperClassUris = inferenceEngine.getSuperClasses(mother);
+ final Set<IRI> motherSuperClassUris = inferenceEngine.getSuperClasses(mother);
Assert.assertNotNull(motherSuperClassUris);
Assert.assertEquals(6, motherSuperClassUris.size());
Assert.assertTrue(motherSuperClassUris.contains(parent));
@@ -460,7 +460,7 @@ public class InferenceEngineTest extends TestCase {
Assert.assertTrue(motherSuperClassUris.contains(mother));
Assert.assertTrue(motherSuperClassUris.contains(mom));
// Check that Father is a subclassOf Parent and Man
- final Set<URI> fatherSuperClassUris = inferenceEngine.getSuperClasses(father);
+ final Set<IRI> fatherSuperClassUris = inferenceEngine.getSuperClasses(father);
Assert.assertNotNull(fatherSuperClassUris);
Assert.assertEquals(2, fatherSuperClassUris.size());
Assert.assertTrue(fatherSuperClassUris.contains(parent));
@@ -470,7 +470,7 @@ public class InferenceEngineTest extends TestCase {
// ImmediateFamilyMember and Relative. The last 2 should be inferred
// from having the same intersection as Mother. Also, Mom is a
// subclassOf Mother and Mom through inferring equivalentClass.
- final Set<URI> momSuperClassUris = inferenceEngine.getSuperClasses(mom);
+ final Set<IRI> momSuperClassUris = inferenceEngine.getSuperClasses(mom);
Assert.assertNotNull(momSuperClassUris);
Assert.assertEquals(6, momSuperClassUris.size());
Assert.assertTrue(momSuperClassUris.contains(parent));
@@ -525,29 +525,29 @@ public class InferenceEngineTest extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
inferenceEngine.refreshGraph();
- final URI suits = vf.createURI("urn:Suits");
- final URI ranks = vf.createURI("urn:Ranks");
-
- final URI clubs = vf.createURI("urn:Clubs");
- final URI diamonds = vf.createURI("urn:Diamonds");
- final URI hearts = vf.createURI("urn:Hearts");
- final URI spades = vf.createURI("urn:Spades");
-
- final URI ace = vf.createURI("urn:Ace");
- final URI two = vf.createURI("urn:2");
- final URI three = vf.createURI("urn:3");
- final URI four = vf.createURI("urn:4");
- final URI five = vf.createURI("urn:5");
- final URI six = vf.createURI("urn:6");
- final URI seven = vf.createURI("urn:7");
- final URI eight = vf.createURI("urn:8");
- final URI nine = vf.createURI("urn:9");
- final URI ten = vf.createURI("urn:10");
- final URI jack = vf.createURI("urn:Jack");
- final URI queen = vf.createURI("urn:Queen");
- final URI king = vf.createURI("urn:King");
-
- final URI joker = vf.createURI("urn:Joker");
+ final IRI suits = VF.createIRI("urn:Suits");
+ final IRI ranks = VF.createIRI("urn:Ranks");
+
+ final IRI clubs = VF.createIRI("urn:Clubs");
+ final IRI diamonds = VF.createIRI("urn:Diamonds");
+ final IRI hearts = VF.createIRI("urn:Hearts");
+ final IRI spades = VF.createIRI("urn:Spades");
+
+ final IRI ace = VF.createIRI("urn:Ace");
+ final IRI two = VF.createIRI("urn:2");
+ final IRI three = VF.createIRI("urn:3");
+ final IRI four = VF.createIRI("urn:4");
+ final IRI five = VF.createIRI("urn:5");
+ final IRI six = VF.createIRI("urn:6");
+ final IRI seven = VF.createIRI("urn:7");
+ final IRI eight = VF.createIRI("urn:8");
+ final IRI nine = VF.createIRI("urn:9");
+ final IRI ten = VF.createIRI("urn:10");
+ final IRI jack = VF.createIRI("urn:Jack");
+ final IRI queen = VF.createIRI("urn:Queen");
+ final IRI king = VF.createIRI("urn:King");
+
+ final IRI joker = VF.createIRI("urn:Joker");
final boolean isJokerEnumeratedType = inferenceEngine.isEnumeratedType(joker);
Assert.assertFalse(isJokerEnumeratedType);
@@ -572,12 +572,12 @@ public class InferenceEngineTest extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
inferenceEngine.refreshGraph();
final Set<Resource> expectedTypes = new HashSet<>();
- expectedTypes.add(vf.createURI("urn:Narcissist"));
- Assert.assertEquals(expectedTypes, inferenceEngine.getHasSelfImplyingProperty(vf.createURI("urn:love")));
+ expectedTypes.add(VF.createIRI("urn:Narcissist"));
+ Assert.assertEquals(expectedTypes, inferenceEngine.getHasSelfImplyingProperty(VF.createIRI("urn:love")));
- final Set<URI> expectedProperties = new HashSet<>();
- expectedProperties.add(vf.createURI("urn:love"));
- Assert.assertEquals(expectedProperties, inferenceEngine.getHasSelfImplyingType(vf.createURI("urn:Narcissist")));
+ final Set<IRI> expectedProperties = new HashSet<>();
+ expectedProperties.add(VF.createIRI("urn:love"));
+ Assert.assertEquals(expectedProperties, inferenceEngine.getHasSelfImplyingType(VF.createIRI("urn:Narcissist")));
}
@Test
@@ -592,12 +592,12 @@ public class InferenceEngineTest extends TestCase {
+ "}}";
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
inferenceEngine.refreshGraph();
- final URI comment = vf.createURI("urn:comment"); // none of the three supported types
- final URI older = vf.createURI("urn:olderThan"); // transitive only
- final URI notYounger = vf.createURI("urn:notYoungerThan"); // transitive and reflexive
- final URI related = vf.createURI("urn:related"); // transitive and symmetric
- final URI knows = vf.createURI("urn:knows"); // reflexive and symmetric
- final URI sameAge = vf.createURI("urn:sameAgeAs"); // all three
+ final IRI comment = VF.createIRI("urn:comment"); // none of the three supported types
+ final IRI older = VF.createIRI("urn:olderThan"); // transitive only
+ final IRI notYounger = VF.createIRI("urn:notYoungerThan"); // transitive and reflexive
+ final IRI related = VF.createIRI("urn:related"); // transitive and symmetric
+ final IRI knows = VF.createIRI("urn:knows"); // reflexive and symmetric
+ final IRI sameAge = VF.createIRI("urn:sameAgeAs"); // all three
// symmetry
Assert.assertFalse(inferenceEngine.isSymmetricProperty(comment));
Assert.assertFalse(inferenceEngine.isSymmetricProperty(older));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceIT.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceIT.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceIT.java
index 375db4a..b53f5ee 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceIT.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/InferenceIT.java
@@ -32,23 +32,23 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.impl.ListBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.impl.ListBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import junit.framework.TestCase;
@@ -57,7 +57,7 @@ public class InferenceIT extends TestCase {
private Connector connector;
private AccumuloRyaDAO dao;
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private AccumuloRdfConfiguration conf;
private RdfCloudTripleStore store;
private InferenceEngine inferenceEngine;
@@ -142,9 +142,9 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate(resultHandler);
final Set<Value> expected = new HashSet<>();
- expected.add(vf.createURI("urn:Alice"));
- expected.add(vf.createURI("urn:Bob"));
- expected.add(vf.createURI("urn:Eve"));
+ expected.add(VF.createIRI("urn:Alice"));
+ expected.add(VF.createIRI("urn:Bob"));
+ expected.add(VF.createIRI("urn:Eve"));
final Set<Value> returned = new HashSet<>();
for (final BindingSet bs : solutions) {
returned.add(bs.getBinding("x").getValue());
@@ -185,10 +185,10 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate(resultHandler);
final Set<Value> expected = new HashSet<>();
- expected.add(vf.createURI("urn:Professor1"));
- expected.add(vf.createURI("urn:Professor2"));
- expected.add(vf.createURI("urn:Professor3"));
- expected.add(vf.createURI("urn:Professor4"));
+ expected.add(VF.createIRI("urn:Professor1"));
+ expected.add(VF.createIRI("urn:Professor2"));
+ expected.add(VF.createIRI("urn:Professor3"));
+ expected.add(VF.createIRI("urn:Professor4"));
final Set<Value> returned = new HashSet<>();
for (final BindingSet bs : solutions) {
returned.add(bs.getBinding("x").getValue());
@@ -244,9 +244,9 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate(resultHandler);
Map<Value, Integer> expected = new HashMap<>();
- expected.put(vf.createURI("urn:Alice"), 2); // from both courses
- expected.put(vf.createURI("urn:Bob"), 1); // from course
- expected.put(vf.createURI("urn:Carol"), 2); // from course and explicit type
+ expected.put(VF.createIRI("urn:Alice"), 2); // from both courses
+ expected.put(VF.createIRI("urn:Bob"), 1); // from course
+ expected.put(VF.createIRI("urn:Carol"), 2); // from course and explicit type
Map<Value, Integer> returned = new HashMap<>();
for (BindingSet bs : solutions) {
Value v = bs.getBinding("individual").getValue();
@@ -281,15 +281,15 @@ public class InferenceIT extends TestCase {
for (final BindingSet solution : solutions) {
answers.add(solution.getBinding("x").getValue());
}
- Assert.assertTrue(answers.contains(vf.createURI("urn:Terry")));
- Assert.assertTrue(answers.contains(vf.createURI("urn:Rommy")));
+ Assert.assertTrue(answers.contains(VF.createIRI("urn:Terry")));
+ Assert.assertTrue(answers.contains(VF.createIRI("urn:Rommy")));
// If allValuesFrom inference were applied recursively, this triple wouldn't be needed:
conn.prepareUpdate(QueryLanguage.SPARQL, "INSERT DATA { GRAPH <http://updated/test> {\n"
+ " <urn:Terry> a <urn:Cairn_Terrier> .\n"
+ "}}").execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, "SELECT ?x { ?x a <urn:FictionalDog> }").evaluate(resultHandler);
Assert.assertEquals(1, solutions.size());
- Assert.assertEquals(vf.createURI("urn:Toto"), solutions.get(0).getBinding("x").getValue());
+ Assert.assertEquals(VF.createIRI("urn:Toto"), solutions.get(0).getBinding("x").getValue());
}
@Test
@@ -318,11 +318,11 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate(resultHandler);
final Set<Value> expected = new HashSet<>();
- expected.add(vf.createURI("urn:Alice"));
- expected.add(vf.createURI("urn:Bob"));
- expected.add(vf.createURI("urn:Carol"));
- expected.add(vf.createURI("urn:Dan"));
- expected.add(vf.createURI("urn:Lucy"));
+ expected.add(VF.createIRI("urn:Alice"));
+ expected.add(VF.createIRI("urn:Bob"));
+ expected.add(VF.createIRI("urn:Carol"));
+ expected.add(VF.createIRI("urn:Dan"));
+ expected.add(VF.createIRI("urn:Lucy"));
final Set<Value> returned = new HashSet<>();
for (final BindingSet bs : solutions) {
returned.add(bs.getBinding("x").getValue());
@@ -358,12 +358,12 @@ public class InferenceIT extends TestCase {
final List<String> varNames = new LinkedList<>();
varNames.add("individual");
varNames.add("taxon");
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice"), vf.createURI("urn:Hominidae")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice"), vf.createURI("urn:Mammalia")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Bigfoot"), vf.createURI("urn:Mammalia")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Carol"), vf.createURI("urn:Hominidae")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Hank"), vf.createURI("urn:Carnivora")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Hank"), vf.createURI("urn:Mammalia")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice"), VF.createIRI("urn:Hominidae")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice"), VF.createIRI("urn:Mammalia")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Bigfoot"), VF.createIRI("urn:Mammalia")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Carol"), VF.createIRI("urn:Hominidae")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Hank"), VF.createIRI("urn:Carnivora")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Hank"), VF.createIRI("urn:Mammalia")));
Assert.assertEquals(expected, new HashSet<>(solutions));
}
@@ -393,9 +393,9 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
conn.prepareTupleQuery(QueryLanguage.SPARQL, query).evaluate(resultHandler);
final Set<Value> expected = new HashSet<>();
- expected.add(vf.createURI("urn:Bob"));
- expected.add(vf.createURI("urn:Carol"));
- expected.add(vf.createURI("urn:Eve"));
+ expected.add(VF.createIRI("urn:Bob"));
+ expected.add(VF.createIRI("urn:Carol"));
+ expected.add(VF.createIRI("urn:Eve"));
final Set<Value> returned = new HashSet<>();
for (final BindingSet bs : solutions) {
returned.add(bs.getBinding("x").getValue());
@@ -433,36 +433,36 @@ public class InferenceIT extends TestCase {
final String motherQuery = "SELECT ?individual { GRAPH <http://updated/test> { ?individual rdf:type <urn:Mother> } } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, motherQuery).evaluate(resultHandler);
final Set<BindingSet> expectedMothers = new HashSet<>();
- expectedMothers.add(new ListBindingSet(varNames, vf.createURI("urn:Susan")));
+ expectedMothers.add(new ListBindingSet(varNames, VF.createIRI("urn:Susan")));
Assert.assertEquals(expectedMothers, new HashSet<>(solutions));
// Find all <urn:Father> types (expect 1 result)
final String fatherQuery = "SELECT ?individual { GRAPH <http://updated/test> { ?individual rdf:type <urn:Father> } } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, fatherQuery).evaluate(resultHandler);
final Set<BindingSet> expectedFathers = new HashSet<>();
- expectedFathers.add(new ListBindingSet(varNames, vf.createURI("urn:Bob")));
+ expectedFathers.add(new ListBindingSet(varNames, VF.createIRI("urn:Bob")));
Assert.assertEquals(expectedFathers, new HashSet<>(solutions));
// Find all <urn:Parent> types (expect 2 results)
final String parentQuery = "SELECT ?individual { GRAPH <http://updated/test> { ?individual rdf:type <urn:Parent> } } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, parentQuery).evaluate(resultHandler);
final Set<BindingSet> expectedParents = new HashSet<>();
- expectedParents.add(new ListBindingSet(varNames, vf.createURI("urn:Bob")));
- expectedParents.add(new ListBindingSet(varNames, vf.createURI("urn:Susan")));
+ expectedParents.add(new ListBindingSet(varNames, VF.createIRI("urn:Bob")));
+ expectedParents.add(new ListBindingSet(varNames, VF.createIRI("urn:Susan")));
Assert.assertEquals(expectedParents, new HashSet<>(solutions));
// Find all <urn:Woman> types (expect 1 result)
final String womanQuery = "SELECT ?individual { GRAPH <http://updated/test> { ?individual rdf:type <urn:Woman> } } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, womanQuery).evaluate(resultHandler);
final Set<BindingSet> expectedWomen = new HashSet<>();
- expectedWomen.add(new ListBindingSet(varNames, vf.createURI("urn:Susan")));
+ expectedWomen.add(new ListBindingSet(varNames, VF.createIRI("urn:Susan")));
Assert.assertEquals(expectedWomen, new HashSet<>(solutions));
// Find all <urn:Man> types (expect 1 result)
final String manQuery = "SELECT ?individual { GRAPH <http://updated/test> { ?individual rdf:type <urn:Man> } } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, manQuery).evaluate(resultHandler);
final Set<BindingSet> expectedMen = new HashSet<>();
- expectedMen.add(new ListBindingSet(varNames, vf.createURI("urn:Bob")));
+ expectedMen.add(new ListBindingSet(varNames, VF.createIRI("urn:Bob")));
Assert.assertEquals(expectedMen, new HashSet<>(solutions));
}
@@ -540,11 +540,11 @@ public class InferenceIT extends TestCase {
final String cardSuitQuery = "SELECT ?card { GRAPH <http://updated/test> { ?card a <urn:Card> . ?suit a <urn:Suits> . ?card <urn:HasSuit> ?suit} } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, cardSuitQuery).evaluate(resultHandler);
final Set<BindingSet> expectedCardSuits = new HashSet<>();
- expectedCardSuits.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard1")));
- expectedCardSuits.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard2")));
- expectedCardSuits.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard3")));
- expectedCardSuits.add(new ListBindingSet(varNames, vf.createURI("urn:TurnCard")));
- expectedCardSuits.add(new ListBindingSet(varNames, vf.createURI("urn:RiverCard")));
+ expectedCardSuits.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard1")));
+ expectedCardSuits.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard2")));
+ expectedCardSuits.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard3")));
+ expectedCardSuits.add(new ListBindingSet(varNames, VF.createIRI("urn:TurnCard")));
+ expectedCardSuits.add(new ListBindingSet(varNames, VF.createIRI("urn:RiverCard")));
Assert.assertEquals(expectedCardSuits.size(), solutions.size());
Assert.assertEquals(expectedCardSuits, new HashSet<>(solutions));
@@ -552,11 +552,11 @@ public class InferenceIT extends TestCase {
final String cardRankQuery = "SELECT ?card { GRAPH <http://updated/test> { ?card a <urn:Card> . ?rank a <urn:Ranks> . ?card <urn:HasRank> ?rank} } \n";
conn.prepareTupleQuery(QueryLanguage.SPARQL, cardRankQuery).evaluate(resultHandler);
final Set<BindingSet> expectedCardRanks = new HashSet<>();
- expectedCardRanks.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard1")));
- expectedCardRanks.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard2")));
- expectedCardRanks.add(new ListBindingSet(varNames, vf.createURI("urn:FlopCard3")));
- expectedCardRanks.add(new ListBindingSet(varNames, vf.createURI("urn:TurnCard")));
- expectedCardRanks.add(new ListBindingSet(varNames, vf.createURI("urn:RiverCard")));
+ expectedCardRanks.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard1")));
+ expectedCardRanks.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard2")));
+ expectedCardRanks.add(new ListBindingSet(varNames, VF.createIRI("urn:FlopCard3")));
+ expectedCardRanks.add(new ListBindingSet(varNames, VF.createIRI("urn:TurnCard")));
+ expectedCardRanks.add(new ListBindingSet(varNames, VF.createIRI("urn:RiverCard")));
Assert.assertEquals(expectedCardRanks.size(), solutions.size());
Assert.assertEquals(expectedCardRanks, new HashSet<>(solutions));
}
@@ -580,8 +580,8 @@ public class InferenceIT extends TestCase {
final List<String> varNames = new LinkedList<>();
varNames.add("who");
varNames.add("self");
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice"), vf.createURI("urn:Alice")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Narcissus"), vf.createURI("urn:Narcissus")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice"), VF.createIRI("urn:Alice")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Narcissus"), VF.createIRI("urn:Narcissus")));
Assert.assertEquals(expected, new HashSet<>(solutions));
query = "SELECT ?self { GRAPH <http://updated/test> { <urn:Alice> <urn:love> ?self } } \n";
@@ -589,7 +589,7 @@ public class InferenceIT extends TestCase {
expected.clear();
varNames.clear();
varNames.add("self");
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice")));
Assert.assertEquals(expected, new HashSet<>(solutions));
query = "SELECT ?who { GRAPH <http://updated/test> { ?who <urn:love> <urn:Alice> } } \n";
@@ -597,7 +597,7 @@ public class InferenceIT extends TestCase {
expected.clear();
varNames.clear();
varNames.add("who");
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice")));
Assert.assertEquals(expected, new HashSet<>(solutions));
query = "SELECT ?who { GRAPH <http://updated/test> { ?who a <urn:Narcissist> } } \n";
@@ -605,8 +605,8 @@ public class InferenceIT extends TestCase {
expected.clear();
varNames.clear();
varNames.add("who");
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Narcissus")));
- expected.add(new ListBindingSet(varNames, vf.createURI("urn:Alice")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Narcissus")));
+ expected.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice")));
Assert.assertEquals(expected, new HashSet<>(solutions));
}
@@ -622,10 +622,10 @@ public class InferenceIT extends TestCase {
conn.prepareUpdate(QueryLanguage.SPARQL, ontology).execute();
conn.prepareUpdate(QueryLanguage.SPARQL, instances).execute();
inferenceEngine.refreshGraph();
- final URI alice = vf.createURI("urn:Alice");
- final URI bob = vf.createURI("urn:Bob");
- final URI carol = vf.createURI("urn:Carol");
- final URI eve = vf.createURI("urn:Eve");
+ final IRI alice = VF.createIRI("urn:Alice");
+ final IRI bob = VF.createIRI("urn:Bob");
+ final IRI carol = VF.createIRI("urn:Carol");
+ final IRI eve = VF.createIRI("urn:Eve");
final List<String> varNames = new LinkedList<>();
varNames.add("x");
final Set<BindingSet> aliceAndBob = new HashSet<>();
@@ -665,8 +665,8 @@ public class InferenceIT extends TestCase {
// Query where subject and object are unrestricted variables: match
// every known node (dangerous, but correct)
- final URI hasFamily = vf.createURI("urn:hasFamilyMember");
- final URI rp = vf.createURI(OWL.NAMESPACE, "ReflexiveProperty");
+ final IRI hasFamily = VF.createIRI("urn:hasFamilyMember");
+ final IRI rp = VF.createIRI(OWL.NAMESPACE, "ReflexiveProperty");
final Set<BindingSet> everything = new HashSet<>();
everything.add(new ListBindingSet(varNames, alice, alice));
everything.add(new ListBindingSet(varNames, bob, bob));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitorTest.java
index 58551a5..93585e5 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitorTest.java
@@ -31,19 +31,19 @@ import java.util.Map;
import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.Sets;
@@ -52,22 +52,22 @@ import com.google.common.collect.Sets;
*/
public class IntersectionOfVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- private static final URI MOTHER = VF.createURI("urn:Mother");
- private static final URI FATHER = VF.createURI("urn:Father");
+ private static final IRI MOTHER = VF.createIRI("urn:Mother");
+ private static final IRI FATHER = VF.createIRI("urn:Father");
// Definition #1: :Mother owl:intersectionOf(:Animal, :Female, :Parent)
- private static final URI ANIMAL = VF.createURI("urn:Animal");
- private static final URI FEMALE = VF.createURI("urn:Female");
- private static final URI PARENT = VF.createURI("urn:Parent");
+ private static final IRI ANIMAL = VF.createIRI("urn:Animal");
+ private static final IRI FEMALE = VF.createIRI("urn:Female");
+ private static final IRI PARENT = VF.createIRI("urn:Parent");
// Definition #2: :Mother owl:intersectionOf(:Female, :Leader, :Nun)
- private static final URI NUN = VF.createURI("urn:Nun");
- private static final URI LEADER = VF.createURI("urn:Leader");
+ private static final IRI NUN = VF.createIRI("urn:Nun");
+ private static final IRI LEADER = VF.createIRI("urn:Leader");
// Definition #3: :Father owl:intersectionOf(:Man, :Parent)
- private static final URI MAN = VF.createURI("urn:Man");
+ private static final IRI MAN = VF.createIRI("urn:Man");
@Test
public void testIntersectionOf() throws Exception {
@@ -226,7 +226,7 @@ public class IntersectionOfVisitorTest {
assertEquals(expectedFatherSp, actualFatherSp);
}
- private static void assertStatementPattern(final StatementPattern statementPattern, final URI uri) {
+ private static void assertStatementPattern(final StatementPattern statementPattern, final IRI uri) {
assertNotNull(statementPattern.getPredicateVar());
assertEquals(RDF.TYPE, statementPattern.getPredicateVar().getValue());
assertNotNull(statementPattern.getObjectVar());
[32/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementBindingSetKeyValueIterator.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementBindingSetKeyValueIterator.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementBindingSetKeyValueIterator.java
index 076ce0f..fe34e0a 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementBindingSetKeyValueIterator.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementBindingSetKeyValueIterator.java
@@ -19,30 +19,24 @@ package org.apache.rya.accumulo.query;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
+import org.apache.accumulo.core.client.BatchScanner;
+import org.apache.accumulo.core.client.ScannerBase;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
-import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-
-import org.apache.accumulo.core.client.BatchScanner;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.ScannerBase;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Date: 7/17/12
@@ -60,7 +54,8 @@ public class RyaStatementBindingSetKeyValueIterator implements CloseableIteratio
private RyaTripleContext ryaContext;
public RyaStatementBindingSetKeyValueIterator(TABLE_LAYOUT tableLayout, RyaTripleContext context, ScannerBase scannerBase, RangeBindingSetEntries rangeMap) {
- this(tableLayout, ((scannerBase instanceof BatchScanner) ? ((BatchScanner) scannerBase).iterator() : ((Scanner) scannerBase).iterator()), rangeMap, context);
+ this(tableLayout, ((scannerBase instanceof BatchScanner) ? scannerBase.iterator() : scannerBase
+ .iterator()), rangeMap, context);
this.scanner = scannerBase;
isBatchScanner = scanner instanceof BatchScanner;
}
@@ -76,7 +71,7 @@ public class RyaStatementBindingSetKeyValueIterator implements CloseableIteratio
public void close() throws RyaDAOException {
dataIterator = null;
if (scanner != null && isBatchScanner) {
- ((BatchScanner) scanner).close();
+ scanner.close();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementKeyValueIterator.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementKeyValueIterator.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementKeyValueIterator.java
index fb66e70..8f6fe34 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementKeyValueIterator.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RyaStatementKeyValueIterator.java
@@ -19,23 +19,18 @@ package org.apache.rya.accumulo.query;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Iterator;
import java.util.Map;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
-import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Date: 7/17/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
index e22bdde..75e5861 100644
--- a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
+++ b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
@@ -19,19 +19,22 @@ package org.apache.rya.accumulo;
* under the License.
*/
-
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import info.aduna.iteration.CloseableIteration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.iterators.FirstEntryInRowIterator;
import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
@@ -41,20 +44,14 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQuery;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
-
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.IteratorSetting;
-import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.mock.MockInstance;
-import org.apache.accumulo.core.iterators.FirstEntryInRowIterator;
import org.calrissian.mango.collect.FluentCloseableIterable;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
/**
* Class AccumuloRdfDAOTest
@@ -64,7 +61,7 @@ import org.openrdf.model.vocabulary.XMLSchema;
public class AccumuloRyaDAOTest {
private AccumuloRyaDAO dao;
- private ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
static String litdupsNS = "urn:test:litdups#";
private AccumuloRdfConfiguration conf;
private Connector connector;
@@ -87,9 +84,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testAdd() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "uri1"));
+ RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
+ RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
dao.add(new RyaStatement(cpu, loadPerc, uri1));
CloseableIteration<RyaStatement, RyaDAOException> iter = dao.getQueryEngine().query(new RyaStatement(cpu, loadPerc, null), conf);
@@ -115,9 +112,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testDeleteDiffVisibility() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "uri1"));
+ RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
+ RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
RyaStatement stmt1 = new RyaStatement(cpu, loadPerc, uri1, null, "1", new StatementMetadata(), "vis1".getBytes());
dao.add(stmt1);
RyaStatement stmt2 = new RyaStatement(cpu, loadPerc, uri1, null, "2", new StatementMetadata(), "vis2".getBytes());
@@ -149,9 +146,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testDeleteDiffTimestamp() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "uri1"));
+ RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
+ RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
RyaStatement stmt1 = new RyaStatement(cpu, loadPerc, uri1, null, "1", null, null, 100l);
dao.add(stmt1);
RyaStatement stmt2 = new RyaStatement(cpu, loadPerc, uri1, null, "2", null, null, 100l);
@@ -173,14 +170,14 @@ public class AccumuloRyaDAOTest {
@Test
public void testDelete() throws Exception {
- RyaURI predicate = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "pred"));
- RyaURI subj = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "subj"));
+ RyaURI predicate = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred"));
+ RyaURI subj = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "subj"));
// create a "bulk load" of 10,000 statements
int statement_count = 10000;
for (int i = 0 ; i < statement_count ; i++){
//make the statement very large so we will get a lot of random flushes
- RyaURI obj = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, String.format("object%050d",i)));
+ RyaURI obj = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, String.format("object%050d",i)));
RyaStatement stmt = new RyaStatement(subj, predicate, obj);
dao.add(stmt);
}
@@ -211,8 +208,8 @@ public class AccumuloRyaDAOTest {
@Test
public void testAddEmptyString() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(vf.createURI(litdupsNS, "loadPerc"));
+ RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
+ RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
RyaType empty = new RyaType("");
dao.add(new RyaStatement(cpu, loadPerc, empty));
@@ -375,7 +372,7 @@ public class AccumuloRyaDAOTest {
AccumuloRyaQueryEngine queryEngine = dao.getQueryEngine();
- Collection<RyaStatement> coll = new ArrayList();
+ Collection<RyaStatement> coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
CloseableIteration<RyaStatement, RyaDAOException> iter = queryEngine.batchQuery(coll, conf);
@@ -391,7 +388,7 @@ public class AccumuloRyaDAOTest {
AccumuloRdfConfiguration queryConf = new AccumuloRdfConfiguration(conf);
queryConf.setMaxRangesForScanner(2);
- coll = new ArrayList();
+ coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
coll.add(new RyaStatement(null, loadPerc, uri3));
@@ -438,7 +435,7 @@ public class AccumuloRyaDAOTest {
AccumuloRyaQueryEngine queryEngine = dao.getQueryEngine();
- Collection<RyaStatement> coll = new ArrayList();
+ Collection<RyaStatement> coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri0));
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
@@ -455,7 +452,7 @@ public class AccumuloRyaDAOTest {
AccumuloRdfConfiguration queryConf = new AccumuloRdfConfiguration(conf);
queryConf.setMaxRangesForScanner(2);
- coll = new ArrayList();
+ coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri0));
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
@@ -495,7 +492,7 @@ public class AccumuloRyaDAOTest {
AccumuloRyaQueryEngine queryEngine = dao.getQueryEngine();
- Collection<RyaStatement> coll = new ArrayList();
+ Collection<RyaStatement> coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
conf.setRegexPredicate(loadPerc.getData());
@@ -540,7 +537,7 @@ public class AccumuloRyaDAOTest {
AccumuloRdfConfiguration queryConf = new AccumuloRdfConfiguration(conf);
queryConf.setMaxRangesForScanner(1);
- Collection<RyaStatement> coll = new ArrayList();
+ Collection<RyaStatement> coll = new ArrayList<>();
coll.add(new RyaStatement(null, loadPerc, uri1));
coll.add(new RyaStatement(null, loadPerc, uri2));
conf.setRegexPredicate(loadPerc.getData());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
index 3537f74..cf2ae4f 100644
--- a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
+++ b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactoryTest.java
@@ -27,10 +27,10 @@
//import org.apache.rya.accumulo.DefineTripleQueryRangeFactory;
//import org.apache.rya.api.domain.RangeValue;
//import org.apache.accumulo.core.data.Range;
-//import org.openrdf.model.URI;
-//import org.openrdf.model.Value;
-//import org.openrdf.model.ValueFactory;
-//import org.openrdf.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.IRI;
+//import org.eclipse.rdf4j.model.Value;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
//
//import java.util.Map;
//
@@ -50,9 +50,9 @@
// private AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
//
// public void testSPOCases() throws Exception {
-// URI cpu = vf.createURI(litdupsNS, "cpu");
-// URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-// URI obj = vf.createURI(litdupsNS, "uri1");
+// URI cpu = vf.createIRI(litdupsNS, "cpu");
+// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// URI obj = vf.createIRI(litdupsNS, "uri1");
//
// //spo
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -96,12 +96,12 @@
// }
//
// public void testSPOCasesWithRanges() throws Exception {
-// URI subj_start = vf.createURI(litdupsNS, "subj_start");
-// URI subj_end = vf.createURI(litdupsNS, "subj_stop");
-// URI pred_start = vf.createURI(litdupsNS, "pred_start");
-// URI pred_end = vf.createURI(litdupsNS, "pred_stop");
-// URI obj_start = vf.createURI(litdupsNS, "obj_start");
-// URI obj_end = vf.createURI(litdupsNS, "obj_stop");
+// URI subj_start = vf.createIRI(litdupsNS, "subj_start");
+// URI subj_end = vf.createIRI(litdupsNS, "subj_stop");
+// URI pred_start = vf.createIRI(litdupsNS, "pred_start");
+// URI pred_end = vf.createIRI(litdupsNS, "pred_stop");
+// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value subj = new RangeValue(subj_start, subj_end);
// Value pred = new RangeValue(pred_start, pred_end);
@@ -146,8 +146,8 @@
// }
//
// public void testPOCases() throws Exception {
-// URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-// URI obj = vf.createURI(litdupsNS, "uri1");
+// URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+// URI obj = vf.createIRI(litdupsNS, "uri1");
//
// //po
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -171,10 +171,10 @@
// }
//
// public void testPOCasesWithRanges() throws Exception {
-// URI pred_start = vf.createURI(litdupsNS, "pred_start");
-// URI pred_end = vf.createURI(litdupsNS, "pred_stop");
-// URI obj_start = vf.createURI(litdupsNS, "obj_start");
-// URI obj_end = vf.createURI(litdupsNS, "obj_stop");
+// URI pred_start = vf.createIRI(litdupsNS, "pred_start");
+// URI pred_end = vf.createIRI(litdupsNS, "pred_stop");
+// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value pred = new RangeValue(pred_start, pred_end);
// Value obj = new RangeValue(obj_start, obj_end);
@@ -204,8 +204,8 @@
// }
//
// public void testOSPCases() throws Exception {
-// URI cpu = vf.createURI(litdupsNS, "cpu");
-// URI obj = vf.createURI(litdupsNS, "uri1");
+// URI cpu = vf.createIRI(litdupsNS, "cpu");
+// URI obj = vf.createIRI(litdupsNS, "uri1");
//
// //so
// Map.Entry<TABLE_LAYOUT, Range> entry =
@@ -230,10 +230,10 @@
//
//
// public void testOSPCasesWithRanges() throws Exception {
-// URI subj_start = vf.createURI(litdupsNS, "subj_start");
-// URI subj_end = vf.createURI(litdupsNS, "subj_stop");
-// URI obj_start = vf.createURI(litdupsNS, "obj_start");
-// URI obj_end = vf.createURI(litdupsNS, "obj_stop");
+// URI subj_start = vf.createIRI(litdupsNS, "subj_start");
+// URI subj_end = vf.createIRI(litdupsNS, "subj_stop");
+// URI obj_start = vf.createIRI(litdupsNS, "obj_start");
+// URI obj_end = vf.createIRI(litdupsNS, "obj_stop");
//
// Value subj = new RangeValue(subj_start, subj_end);
// Value obj = new RangeValue(obj_start, obj_end);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java
index 9ddb15a..d95f7d8 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBQueryEngine.java
@@ -41,8 +41,9 @@ import org.apache.rya.mongodb.iter.RyaStatementCursorIterator;
import org.bson.Document;
import org.calrissian.mango.collect.CloseableIterable;
import org.calrissian.mango.collect.CloseableIterables;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
@@ -50,8 +51,6 @@ import com.google.common.collect.Multimap;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Date: 7/17/12
* Time: 9:28 AM
@@ -144,7 +143,7 @@ public class MongoDBQueryEngine implements RyaQueryEngine<StatefulMongoDBRdfConf
}
Iterator<RyaStatement> iterator = new RyaStatementCursorIterator(queryWithBindingSet(queries.entrySet(), getConf()));
- return CloseableIterables.wrap((Iterable<RyaStatement>) () -> iterator);
+ return CloseableIterables.wrap(() -> iterator);
}
private MongoCollection<Document> getCollection(final StatefulMongoDBRdfConfiguration conf) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfiguration.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfiguration.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfiguration.java
index 44dc851..d49f2ee 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfiguration.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRdfConfiguration.java
@@ -27,7 +27,7 @@ import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.conf.Configuration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.mongodb.aggregation.AggregationPipelineQueryOptimizer;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
import edu.umd.cs.findbugs.annotations.Nullable;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
index 45092e4..769d2de 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
@@ -54,22 +54,23 @@ import org.apache.rya.mongodb.document.operators.query.ConditionalOperators;
import org.apache.rya.mongodb.document.visibility.DocumentVisibilityAdapter;
import org.bson.Document;
import org.bson.conversions.Bson;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Compare;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Compare;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
@@ -83,8 +84,6 @@ import com.mongodb.client.model.BsonField;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.Projections;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Represents a portion of a query tree as MongoDB aggregation pipeline. Should
* be built bottom-up: start with a statement pattern implemented as a $match
@@ -264,14 +263,14 @@ public class AggregationPipelineQueryNode extends ExternalSet {
if (subjVar != null && subjVar.getValue() instanceof Resource) {
s = RdfToRyaConversions.convertResource((Resource) subjVar.getValue());
}
- if (predVar != null && predVar.getValue() instanceof URI) {
- p = RdfToRyaConversions.convertURI((URI) predVar.getValue());
+ if (predVar != null && predVar.getValue() instanceof IRI) {
+ p = RdfToRyaConversions.convertURI((IRI) predVar.getValue());
}
if (objVar != null && objVar.getValue() != null) {
o = RdfToRyaConversions.convertValue(objVar.getValue());
}
- if (contextVar != null && contextVar.getValue() instanceof URI) {
- c = RdfToRyaConversions.convertURI((URI) contextVar.getValue());
+ if (contextVar != null && contextVar.getValue() instanceof IRI) {
+ c = RdfToRyaConversions.convertURI((IRI) contextVar.getValue());
}
RyaStatement rs = new RyaStatement(s, p, o, c);
DBObject obj = strategy.getQuery(rs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryOptimizer.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryOptimizer.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryOptimizer.java
index fb1f558..afef7e0 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryOptimizer.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryOptimizer.java
@@ -21,10 +21,10 @@ package org.apache.rya.mongodb.aggregation;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/PipelineResultIteration.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/PipelineResultIteration.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/PipelineResultIteration.java
index c533efc..fbbe6f0 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/PipelineResultIteration.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/PipelineResultIteration.java
@@ -21,28 +21,27 @@ package org.apache.rya.mongodb.aggregation;
import java.util.Map;
import org.bson.Document;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import com.google.common.base.Preconditions;
import com.mongodb.client.AggregateIterable;
import com.mongodb.client.MongoCursor;
-import info.aduna.iteration.CloseableIteration;
-
/**
* An iterator that converts the documents resulting from an
* {@link AggregationPipelineQueryNode} into {@link BindingSet}s.
*/
public class PipelineResultIteration implements CloseableIteration<BindingSet, QueryEvaluationException> {
private static final int BATCH_SIZE = 1000;
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final MongoCursor<Document> cursor;
private final Map<String, String> varToOriginalName;
@@ -114,10 +113,10 @@ public class PipelineResultIteration implements CloseableIteration<BindingSet, Q
String varName = varToOriginalName.getOrDefault(fieldName, fieldName);
Value varValue;
if (typeString == null || typeString.equals(XMLSchema.ANYURI.stringValue())) {
- varValue = VF.createURI(valueString);
+ varValue = VF.createIRI(valueString);
}
else {
- varValue = VF.createLiteral(valueString, VF.createURI(typeString));
+ varValue = VF.createLiteral(valueString, VF.createIRI(typeString));
}
Binding existingBinding = bindingSet.getBinding(varName);
// If this variable is not already bound, add it.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitor.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitor.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitor.java
index b7f5a67..23797a8 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitor.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitor.java
@@ -20,17 +20,20 @@ package org.apache.rya.mongodb.aggregation;
import java.util.Arrays;
+import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.bson.Document;
-import org.openrdf.query.algebra.Distinct;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.Reduced;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Distinct;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.Reduced;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.base.Preconditions;
import com.mongodb.MongoClient;
@@ -73,7 +76,7 @@ import com.mongodb.client.MongoDatabase;
* {@code AggregationPipelineQueryNode}.
* </ul>
*/
-public class SparqlToPipelineTransformVisitor extends QueryModelVisitorBase<Exception> {
+public class SparqlToPipelineTransformVisitor extends AbstractQueryModelVisitor<Exception> {
private final MongoCollection<Document> inputCollection;
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBNamespaceManager.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBNamespaceManager.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBNamespaceManager.java
index 2be0785..758f334 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBNamespaceManager.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBNamespaceManager.java
@@ -26,15 +26,14 @@ import java.util.Map;
import org.apache.commons.codec.binary.Hex;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.model.Namespace;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Namespace;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
-import info.aduna.iteration.CloseableIteration;
-
public class SimpleMongoDBNamespaceManager implements MongoDBNamespaceManager {
public class NamespaceImplementation implements Namespace {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
index ecad9c6..a868e3d 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
@@ -18,7 +18,7 @@
*/
package org.apache.rya.mongodb.dao;
-import static org.openrdf.model.vocabulary.XMLSchema.ANYURI;
+import static org.eclipse.rdf4j.model.vocabulary.XMLSchema.ANYURI;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
@@ -36,8 +36,8 @@ import org.apache.rya.api.persist.query.RyaQuery;
import org.apache.rya.mongodb.document.visibility.DocumentVisibility;
import org.apache.rya.mongodb.document.visibility.DocumentVisibilityAdapter;
import org.apache.rya.mongodb.document.visibility.DocumentVisibilityAdapter.MalformedDocumentVisibilityException;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCollection;
@@ -72,7 +72,7 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
return DigestUtils.sha256Hex(value);
}
- protected ValueFactoryImpl factory = new ValueFactoryImpl();
+ protected SimpleValueFactory factory = SimpleValueFactory.getInstance();
@Override
public void createIndices(final DBCollection coll){
@@ -136,7 +136,7 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
objectRya = new RyaURI(object);
}
else {
- objectRya = new RyaType(factory.createURI(objectType), object);
+ objectRya = new RyaType(factory.createIRI(objectType), object);
}
final RyaStatement statement;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementBindingSetCursorIterator.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementBindingSetCursorIterator.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementBindingSetCursorIterator.java
index 727538b..462da1c 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementBindingSetCursorIterator.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementBindingSetCursorIterator.java
@@ -34,7 +34,8 @@ import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.dao.MongoDBStorageStrategy;
import org.apache.rya.mongodb.document.operators.aggregation.AggregationUtil;
import org.bson.Document;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Iterators;
@@ -44,8 +45,6 @@ import com.mongodb.client.AggregateIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.util.JSON;
-import info.aduna.iteration.CloseableIteration;
-
public class RyaStatementBindingSetCursorIterator implements CloseableIteration<Entry<RyaStatement, BindingSet>, RyaDAOException> {
private static final Logger log = Logger.getLogger(RyaStatementBindingSetCursorIterator.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java
index 82eed6f..97bbc8b 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/iter/RyaStatementCursorIterator.java
@@ -21,13 +21,11 @@ package org.apache.rya.mongodb.iter;
import java.util.Iterator;
import java.util.Map.Entry;
+import com.google.common.base.Throwables;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
-import org.openrdf.query.BindingSet;
-
-import com.google.common.base.Throwables;
-
-import info.aduna.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
public class RyaStatementCursorIterator implements Iterator<RyaStatement>, CloseableIteration<RyaStatement, RyaDAOException> {
private final CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> iterator;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
index 3a216ec..4aef8cd 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
@@ -1,5 +1,5 @@
/*
-* * Licensed to the Apache Software Foundation (ASF) under one
+ * 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
@@ -20,25 +20,6 @@ package org.apache.rya.mongodb;
import static org.junit.Assert.assertEquals;
-/*
- * 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.
- */
-
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
@@ -47,18 +28,20 @@ import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
import org.apache.rya.api.domain.RyaURI;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
/**
* Integration tests the methods of {@link MongoDBQueryEngine}.
*/
public class MongoDBQueryEngineIT extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private RyaStatement getStatement(final String s, final String p, final String o) {
final RyaStatementBuilder builder = new RyaStatementBuilder();
@@ -119,7 +102,7 @@ public class MongoDBQueryEngineIT extends MongoITBase {
final RyaStatement s1 = getStatement(null, null, "u:b");
final MapBindingSet bs1 = new MapBindingSet();
- bs1.addBinding("foo", new URIImpl("u:x"));
+ bs1.addBinding("foo", VF.createIRI("u:x"));
final Map.Entry<RyaStatement, BindingSet> e1 = new RdfCloudTripleStoreUtils.CustomEntry<>(s1, bs1);
final Collection<Entry<RyaStatement, BindingSet>> stmts1 = Lists.newArrayList(e1);
@@ -127,7 +110,7 @@ public class MongoDBQueryEngineIT extends MongoITBase {
final MapBindingSet bs2 = new MapBindingSet();
- bs2.addBinding("foo", new URIImpl("u:y"));
+ bs2.addBinding("foo", VF.createIRI("u:y"));
final RyaStatement s2 = getStatement(null, null, "u:c");
@@ -164,7 +147,7 @@ public class MongoDBQueryEngineIT extends MongoITBase {
final RyaStatement s = getStatement("u:a", null, null);
final MapBindingSet bs1 = new MapBindingSet();
- bs1.addBinding("foo", new URIImpl("u:x"));
+ bs1.addBinding("foo", VF.createIRI("u:x"));
final Map.Entry<RyaStatement, BindingSet> e1 = new RdfCloudTripleStoreUtils.CustomEntry<>(s, bs1);
final Collection<Entry<RyaStatement, BindingSet>> stmts1 = Lists.newArrayList(e1);
@@ -172,7 +155,7 @@ public class MongoDBQueryEngineIT extends MongoITBase {
final MapBindingSet bs2 = new MapBindingSet();
- bs2.addBinding("foo", new URIImpl("u:y"));
+ bs2.addBinding("foo", VF.createIRI("u:y"));
final Map.Entry<RyaStatement, BindingSet> e2 = new RdfCloudTripleStoreUtils.CustomEntry<>(s, bs2);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
index 15bd636..9f61dfd 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
@@ -18,8 +18,8 @@ package org.apache.rya.mongodb;
* under the License.
*/
+import static org.eclipse.rdf4j.model.vocabulary.XMLSchema.ANYURI;
import static org.junit.Assert.assertEquals;
-import static org.openrdf.model.vocabulary.XMLSchema.ANYURI;
import java.io.IOException;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNodeTest.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNodeTest.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNodeTest.java
index 1e056c4..f33ca96 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNodeTest.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNodeTest.java
@@ -23,23 +23,23 @@ import java.util.LinkedList;
import java.util.List;
import org.bson.Document;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Compare;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.IsLiteral;
+import org.eclipse.rdf4j.query.algebra.Not;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Compare;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.IsLiteral;
-import org.openrdf.query.algebra.Not;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Sets;
@@ -47,13 +47,13 @@ import com.mongodb.MongoNamespace;
import com.mongodb.client.MongoCollection;
public class AggregationPipelineQueryNodeTest {
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String LUBM = "urn:lubm";
- private static final URI UNDERGRAD = VF.createURI(LUBM, "UndergraduateStudent");
- private static final URI TAKES = VF.createURI(LUBM, "takesCourse");
+ private static final IRI UNDERGRAD = VF.createIRI(LUBM, "UndergraduateStudent");
+ private static final IRI TAKES = VF.createIRI(LUBM, "takesCourse");
- private static Var constant(URI value) {
+ private static Var constant(IRI value) {
return new Var(value.stringValue(), value);
}
@@ -137,7 +137,7 @@ public class AggregationPipelineQueryNodeTest {
Assert.assertEquals(Sets.newHashSet("s", "p", "o"), node.getAssuredBindingNames());
Assert.assertEquals(2, node.getPipeline().size());
// All constants
- sp = new StatementPattern(constant(VF.createURI("urn:Alice")), constant(RDF.TYPE), constant(UNDERGRAD));
+ sp = new StatementPattern(constant(VF.createIRI("urn:Alice")), constant(RDF.TYPE), constant(UNDERGRAD));
node = new AggregationPipelineQueryNode(collection, sp);
Assert.assertEquals(Sets.newHashSet(), node.getBindingNames());
Assert.assertEquals(Sets.newHashSet(), node.getAssuredBindingNames());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
index 0552ac0..8dbf4b5 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
@@ -32,41 +32,40 @@ import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.mongodb.dao.SimpleMongoDBStorageStrategy;
import org.bson.Document;
import org.bson.conversions.Bson;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.FOAF;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.EmptyBindingSet;
+import org.eclipse.rdf4j.query.impl.ListBindingSet;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.FOAF;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.EmptyBindingSet;
-import org.openrdf.query.impl.ListBindingSet;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;
-import info.aduna.iteration.CloseableIteration;
-
public class PipelineQueryIT extends MongoITBase {
- private static ValueFactory VF = ValueFactoryImpl.getInstance();
- private static SPARQLParser PARSER = new SPARQLParser();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final SPARQLParser PARSER = new SPARQLParser();
private MongoDBRyaDAO dao;
@@ -79,11 +78,11 @@ public class PipelineQueryIT extends MongoITBase {
dao.init();
}
- private void insert(Resource subject, URI predicate, Value object) throws RyaDAOException {
+ private void insert(Resource subject, IRI predicate, Value object) throws RyaDAOException {
insert(subject, predicate, object, 0);
}
- private void insert(Resource subject, URI predicate, Value object, int derivationLevel) throws RyaDAOException {
+ private void insert(Resource subject, IRI predicate, Value object, int derivationLevel) throws RyaDAOException {
final RyaStatementBuilder builder = new RyaStatementBuilder();
builder.setSubject(RdfToRyaConversions.convertResource(subject));
builder.setPredicate(RdfToRyaConversions.convertURI(predicate));
@@ -121,7 +120,7 @@ public class PipelineQueryIT extends MongoITBase {
insert(OWL.THING, RDF.TYPE, OWL.CLASS);
insert(FOAF.PERSON, RDF.TYPE, OWL.CLASS, 1);
insert(FOAF.PERSON, RDFS.SUBCLASSOF, OWL.THING);
- insert(VF.createURI("urn:Alice"), RDF.TYPE, FOAF.PERSON);
+ insert(VF.createIRI("urn:Alice"), RDF.TYPE, FOAF.PERSON);
dao.flush();
// Define query and expected results
final String query = "SELECT * WHERE {\n"
@@ -131,7 +130,7 @@ public class PipelineQueryIT extends MongoITBase {
Multiset<BindingSet> expectedSolutions = HashMultiset.create();
expectedSolutions.add(new ListBindingSet(varNames, OWL.THING, OWL.CLASS));
expectedSolutions.add(new ListBindingSet(varNames, FOAF.PERSON, OWL.CLASS));
- expectedSolutions.add(new ListBindingSet(varNames, VF.createURI("urn:Alice"), FOAF.PERSON));
+ expectedSolutions.add(new ListBindingSet(varNames, VF.createIRI("urn:Alice"), FOAF.PERSON));
// Execute pipeline and verify results
testPipelineQuery(query, expectedSolutions);
}
@@ -142,7 +141,7 @@ public class PipelineQueryIT extends MongoITBase {
insert(OWL.THING, RDF.TYPE, OWL.CLASS);
insert(FOAF.PERSON, RDF.TYPE, OWL.CLASS, 1);
insert(FOAF.PERSON, RDFS.SUBCLASSOF, OWL.THING);
- insert(VF.createURI("urn:Alice"), RDF.TYPE, FOAF.PERSON);
+ insert(VF.createIRI("urn:Alice"), RDF.TYPE, FOAF.PERSON);
dao.flush();
// Define query and expected results
final String query = "SELECT * WHERE {\n"
@@ -169,11 +168,11 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testJoinTwoSharedVariables() throws Exception {
// Insert data
- URI person = VF.createURI("urn:Person");
- URI livingThing = VF.createURI("urn:LivingThing");
- URI human = VF.createURI("urn:Human");
- URI programmer = VF.createURI("urn:Programmer");
- URI thing = VF.createURI("urn:Thing");
+ IRI person = VF.createIRI("urn:Person");
+ IRI livingThing = VF.createIRI("urn:LivingThing");
+ IRI human = VF.createIRI("urn:Human");
+ IRI programmer = VF.createIRI("urn:Programmer");
+ IRI thing = VF.createIRI("urn:Thing");
insert(programmer, RDFS.SUBCLASSOF, person);
insert(person, RDFS.SUBCLASSOF, FOAF.PERSON);
insert(FOAF.PERSON, RDFS.SUBCLASSOF, person);
@@ -201,12 +200,12 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testVariableRename() throws Exception {
// Insert data
- URI alice = VF.createURI("urn:Alice");
- URI bob = VF.createURI("urn:Bob");
- URI carol = VF.createURI("urn:Carol");
- URI dan = VF.createURI("urn:Dan");
- URI eve = VF.createURI("urn:Eve");
- URI friend = VF.createURI("urn:friend");
+ IRI alice = VF.createIRI("urn:Alice");
+ IRI bob = VF.createIRI("urn:Bob");
+ IRI carol = VF.createIRI("urn:Carol");
+ IRI dan = VF.createIRI("urn:Dan");
+ IRI eve = VF.createIRI("urn:Eve");
+ IRI friend = VF.createIRI("urn:friend");
insert(alice, friend, bob);
insert(alice, friend, carol);
insert(bob, friend, eve);
@@ -247,10 +246,10 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testFilterQuery() throws Exception {
// Insert data
- URI alice = VF.createURI("urn:Alice");
- URI bob = VF.createURI("urn:Bob");
- URI eve = VF.createURI("urn:Eve");
- URI relatedTo = VF.createURI("urn:relatedTo");
+ IRI alice = VF.createIRI("urn:Alice");
+ IRI bob = VF.createIRI("urn:Bob");
+ IRI eve = VF.createIRI("urn:Eve");
+ IRI relatedTo = VF.createIRI("urn:relatedTo");
insert(alice, FOAF.KNOWS, bob);
insert(alice, FOAF.KNOWS, alice);
insert(alice, FOAF.KNOWS, eve);
@@ -285,12 +284,12 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testMultiConstruct() throws Exception {
// Insert data
- URI alice = VF.createURI("urn:Alice");
- URI bob = VF.createURI("urn:Bob");
- URI eve = VF.createURI("urn:Eve");
- URI friend = VF.createURI("urn:friend");
- URI knows = VF.createURI("urn:knows");
- URI person = VF.createURI("urn:Person");
+ IRI alice = VF.createIRI("urn:Alice");
+ IRI bob = VF.createIRI("urn:Bob");
+ IRI eve = VF.createIRI("urn:Eve");
+ IRI friend = VF.createIRI("urn:friend");
+ IRI knows = VF.createIRI("urn:knows");
+ IRI person = VF.createIRI("urn:Person");
insert(alice, friend, bob);
insert(bob, knows, eve);
insert(eve, knows, alice);
@@ -311,12 +310,12 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testTriplePipeline() throws Exception {
- URI alice = VF.createURI("urn:Alice");
- URI bob = VF.createURI("urn:Bob");
- URI eve = VF.createURI("urn:Eve");
- URI friend = VF.createURI("urn:friend");
- URI knows = VF.createURI("urn:knows");
- URI year = VF.createURI("urn:year");
+ IRI alice = VF.createIRI("urn:Alice");
+ IRI bob = VF.createIRI("urn:Bob");
+ IRI eve = VF.createIRI("urn:Eve");
+ IRI friend = VF.createIRI("urn:friend");
+ IRI knows = VF.createIRI("urn:knows");
+ IRI year = VF.createIRI("urn:year");
Literal yearLiteral = VF.createLiteral("2017", XMLSchema.GYEAR);
final String query = "CONSTRUCT {\n"
+ " ?x <urn:knows> ?y .\n"
@@ -350,11 +349,11 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testRequiredDerivationLevel() throws Exception {
// Insert data
- URI person = VF.createURI("urn:Person");
- URI livingThing = VF.createURI("urn:LivingThing");
- URI human = VF.createURI("urn:Human");
- URI programmer = VF.createURI("urn:Programmer");
- URI thing = VF.createURI("urn:Thing");
+ IRI person = VF.createIRI("urn:Person");
+ IRI livingThing = VF.createIRI("urn:LivingThing");
+ IRI human = VF.createIRI("urn:Human");
+ IRI programmer = VF.createIRI("urn:Programmer");
+ IRI thing = VF.createIRI("urn:Thing");
insert(programmer, RDFS.SUBCLASSOF, person);
insert(person, RDFS.SUBCLASSOF, FOAF.PERSON);
insert(FOAF.PERSON, RDFS.SUBCLASSOF, person);
@@ -405,11 +404,11 @@ public class PipelineQueryIT extends MongoITBase {
@Test
public void testRequiredTimestamp() throws Exception {
// Insert data
- URI person = VF.createURI("urn:Person");
- URI livingThing = VF.createURI("urn:LivingThing");
- URI human = VF.createURI("urn:Human");
- URI programmer = VF.createURI("urn:Programmer");
- URI thing = VF.createURI("urn:Thing");
+ IRI person = VF.createIRI("urn:Person");
+ IRI livingThing = VF.createIRI("urn:LivingThing");
+ IRI human = VF.createIRI("urn:Human");
+ IRI programmer = VF.createIRI("urn:Programmer");
+ IRI thing = VF.createIRI("urn:Thing");
insert(programmer, RDFS.SUBCLASSOF, person);
insert(person, RDFS.SUBCLASSOF, FOAF.PERSON, 2);
insert(FOAF.PERSON, RDFS.SUBCLASSOF, person);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineResultIterationTest.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineResultIterationTest.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineResultIterationTest.java
index 6775235..c71a183 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineResultIterationTest.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineResultIterationTest.java
@@ -23,24 +23,24 @@ import java.util.HashMap;
import java.util.Iterator;
import org.bson.Document;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.ListBindingSet;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.ListBindingSet;
import com.google.common.collect.Sets;
import com.mongodb.client.AggregateIterable;
import com.mongodb.client.MongoCursor;
public class PipelineResultIterationTest {
- ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@SuppressWarnings("unchecked")
private AggregateIterable<Document> documentIterator(Document ... documents) {
@@ -107,7 +107,7 @@ public class PipelineResultIterationTest {
@Test
public void testIterationGivenBindingSet() throws QueryEvaluationException {
BindingSet solution = new ListBindingSet(Arrays.asList("b", "c"),
- VF.createURI("urn:Bob"), VF.createURI("urn:Charlie"));
+ VF.createIRI("urn:Bob"), VF.createIRI("urn:Charlie"));
HashMap<String, String> nameMap = new HashMap<>();
nameMap.put("bName", "b");
nameMap.put("cName", "c");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitorTest.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitorTest.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitorTest.java
index 506b8af..715e6bd 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitorTest.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/SparqlToPipelineTransformVisitorTest.java
@@ -22,28 +22,28 @@ import java.util.Arrays;
import java.util.List;
import org.bson.Document;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Not;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Not;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.Sets;
import com.mongodb.MongoNamespace;
@@ -51,16 +51,16 @@ import com.mongodb.client.MongoCollection;
public class SparqlToPipelineTransformVisitorTest {
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String LUBM = "urn:lubm";
- private static final URI UNDERGRAD = VF.createURI(LUBM, "UndergraduateStudent");
- private static final URI PROFESSOR = VF.createURI(LUBM, "Professor");
- private static final URI COURSE = VF.createURI(LUBM, "Course");
- private static final URI TAKES = VF.createURI(LUBM, "takesCourse");
- private static final URI TEACHES = VF.createURI(LUBM, "teachesCourse");
+ private static final IRI UNDERGRAD = VF.createIRI(LUBM, "UndergraduateStudent");
+ private static final IRI PROFESSOR = VF.createIRI(LUBM, "Professor");
+ private static final IRI COURSE = VF.createIRI(LUBM, "Course");
+ private static final IRI TAKES = VF.createIRI(LUBM, "takesCourse");
+ private static final IRI TEACHES = VF.createIRI(LUBM, "teachesCourse");
- private static Var constant(URI value) {
+ private static Var constant(IRI value) {
return new Var(value.stringValue(), value);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/extras/indexing/pom.xml b/extras/indexing/pom.xml
index 7abc83c..357c552 100644
--- a/extras/indexing/pom.xml
+++ b/extras/indexing/pom.xml
@@ -57,7 +57,7 @@
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
- <artifactId>lucene-analyzers</artifactId>
+ <artifactId>lucene-analyzers-common</artifactId>
</dependency>
<dependency>
@@ -84,10 +84,10 @@
<groupId>org.apache.rya</groupId>
<artifactId>rya.periodic.notification.api</artifactId>
</dependency>
- <!-- OpenRDF -->
+ <!-- RDF4J -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-text</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-text</artifactId>
</dependency>
<!-- testing dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/BindingSetHashJoinIterator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/BindingSetHashJoinIterator.java b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/BindingSetHashJoinIterator.java
index 79036ff..200f845 100644
--- a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/BindingSetHashJoinIterator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/BindingSetHashJoinIterator.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo.pcj.iterators;
* under the License.
*/
-import info.aduna.iteration.CloseableIteration;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -31,11 +29,12 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
@@ -74,9 +73,9 @@ public class BindingSetHashJoinIterator implements
*/
public enum HashJoinType {
CONSTANT_JOIN_VAR, VARIABLE_JOIN_VAR
- };
+ }
- public BindingSetHashJoinIterator(
+ public BindingSetHashJoinIterator(
Multimap<String, BindingSet> bindingJoinVarHash,
CloseableIteration<Map.Entry<String, BindingSet>, QueryEvaluationException> joinIter,
Set<String> unAssuredVariables, HashJoinType type) {
@@ -104,10 +103,8 @@ public class BindingSetHashJoinIterator implements
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -213,7 +210,7 @@ public class BindingSetHashJoinIterator implements
private BindingSet removeConstants(BindingSet bs) {
QueryBindingSet bSet = new QueryBindingSet();
for (String s : bs.getBindingNames()) {
- if (!s.startsWith(ExternalTupleSet.CONST_PREFIX)) {
+ if (!VarNameUtils.isConstant(s)) {
bSet.addBinding(bs.getBinding(s));
}
}
@@ -291,10 +288,8 @@ public class BindingSetHashJoinIterator implements
}
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/IteratorCombiner.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/IteratorCombiner.java b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/IteratorCombiner.java
index 0de0d10..27735de 100644
--- a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/IteratorCombiner.java
+++ b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/IteratorCombiner.java
@@ -19,14 +19,13 @@ package org.apache.rya.accumulo.pcj.iterators;
* under the License.
*/
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.google.common.base.Preconditions;
@@ -69,10 +68,8 @@ public class IteratorCombiner implements
}
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToCrossProductBindingSetIterator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToCrossProductBindingSetIterator.java b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToCrossProductBindingSetIterator.java
index 5fe72cd..5889ca1 100644
--- a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToCrossProductBindingSetIterator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToCrossProductBindingSetIterator.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo.pcj.iterators;
* under the License.
*/
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@@ -29,17 +27,18 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
-import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import com.google.common.collect.HashBiMap;
@@ -128,10 +127,8 @@ public class PCJKeyToCrossProductBindingSetIterator implements
}
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -187,7 +184,7 @@ public class PCJKeyToCrossProductBindingSetIterator implements
throw new QueryEvaluationException("PCJ Variable has no mapping to query variable.");
}
if (constantConstraintsExist) {
- if (mappedVar.startsWith(ExternalTupleSet.CONST_PREFIX)
+ if (VarNameUtils.isConstant(mappedVar)
&& constantConstraints.containsKey(mappedVar)
&& !constantConstraints.get(mappedVar).equals(
bindingSet.getValue(var))) {
@@ -195,7 +192,7 @@ public class PCJKeyToCrossProductBindingSetIterator implements
}
}
- if (!mappedVar.startsWith(ExternalTupleSet.CONST_PREFIX)) {
+ if (!VarNameUtils.isConstant(mappedVar)) {
bs.addBinding(mappedVar, bindingSet.getValue(var));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToJoinBindingSetIterator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToJoinBindingSetIterator.java b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToJoinBindingSetIterator.java
index 0dcdfd5..bafdda4 100644
--- a/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToJoinBindingSetIterator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/accumulo/pcj/iterators/PCJKeyToJoinBindingSetIterator.java
@@ -19,27 +19,26 @@ package org.apache.rya.accumulo.pcj.iterators;
* under the License.
*/
-import info.aduna.iteration.CloseableIteration;
-
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
-import org.apache.rya.api.RdfCloudTripleStoreUtils;
-import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
+import org.apache.rya.api.RdfCloudTripleStoreUtils;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.HashBiMap;
@@ -121,10 +120,8 @@ public class PCJKeyToJoinBindingSetIterator
}
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -173,7 +170,7 @@ public class PCJKeyToJoinBindingSetIterator
QueryBindingSet bs = new QueryBindingSet();
for (String var : bindingSet.getBindingNames()) {
String mappedVar = pcjVarMap.get(var);
- if (mappedVar.startsWith(ExternalTupleSet.CONST_PREFIX)
+ if (VarNameUtils.isConstant(mappedVar)
&& constantConstraints.containsKey(mappedVar)
&& !constantConstraints.get(mappedVar).equals(
bindingSet.getValue(var))) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJ.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJ.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJ.java
index f6002b6..c78bbb2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJ.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJ.java
@@ -52,19 +52,18 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageExce
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Uses an in memory Rya Client to batch update a PCJ index.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJ.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJ.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJ.java
index 9ac7c2a..243aea6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJ.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJ.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -46,10 +46,10 @@ import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageException;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -160,7 +160,7 @@ public class AccumuloCreatePCJ extends AccumuloCommand implements CreatePCJ {
new String(cd.getUserPass()),
cd.getInstanceName(),
cd.getZookeepers(),
- fluoAppName);) {
+ fluoAppName)) {
// Initialize the PCJ within the Fluo application.
final CreateFluoPcj fluoCreatePcj = new CreateFluoPcj();
fluoCreatePcj.withRyaIntegration(pcjId, sparql, strategies, fluoClient, getConnector(), ryaInstance);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePeriodicPCJ.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePeriodicPCJ.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePeriodicPCJ.java
index 3ecb93e..a80bf2f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePeriodicPCJ.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloCreatePeriodicPCJ.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -45,10 +45,10 @@ import org.apache.rya.periodic.notification.api.PeriodicNotificationClient;
import org.apache.rya.periodic.notification.notification.CommandNotification;
import org.apache.rya.periodic.notification.registration.KafkaNotificationRegistrationClient;
import org.apache.rya.periodic.notification.serialization.CommandNotificationSerializer;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Optional;
@@ -125,7 +125,7 @@ public class AccumuloCreatePeriodicPCJ extends AccumuloCommand implements Create
new String(cd.getUserPass()),
cd.getInstanceName(),
cd.getZookeepers(),
- fluoAppName);) {
+ fluoAppName)) {
// Initialize the PCJ within the Fluo application.
final CreatePeriodicQuery periodicPcj = new CreatePeriodicQuery(fluoClient, periodicStorage);
PeriodicNotificationClient periodicClient = new KafkaNotificationRegistrationClient(periodicTopic, createProducer(bootStrapServers));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloDeletePeriodicPCJ.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloDeletePeriodicPCJ.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloDeletePeriodicPCJ.java
index d287af4..e8016cf 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloDeletePeriodicPCJ.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloDeletePeriodicPCJ.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -43,7 +43,7 @@ import org.apache.rya.periodic.notification.api.PeriodicNotificationClient;
import org.apache.rya.periodic.notification.notification.CommandNotification;
import org.apache.rya.periodic.notification.registration.KafkaNotificationRegistrationClient;
import org.apache.rya.periodic.notification.serialization.CommandNotificationSerializer;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloExecuteSparqlQuery.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloExecuteSparqlQuery.java b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloExecuteSparqlQuery.java
index e9e2cbe..b97ae8a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloExecuteSparqlQuery.java
+++ b/extras/indexing/src/main/java/org/apache/rya/api/client/accumulo/AccumuloExecuteSparqlQuery.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -34,16 +34,16 @@ import org.apache.rya.api.client.RyaClientException;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
[33/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaTypeResolverImpl.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaTypeResolverImpl.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaTypeResolverImpl.java
index 943a1d3..fba7a29 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaTypeResolverImpl.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaTypeResolverImpl.java
@@ -29,8 +29,8 @@ import org.apache.rya.api.resolver.RyaTypeResolver;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import com.google.common.primitives.Bytes;
@@ -44,14 +44,14 @@ public class RyaTypeResolverImpl implements RyaTypeResolver {
.stringEncoder();
protected byte markerByte;
- protected URI dataType;
+ protected IRI dataType;
protected byte[] markerBytes;
public RyaTypeResolverImpl() {
this((byte) PLAIN_LITERAL_MARKER, XMLSchema.STRING);
}
- public RyaTypeResolverImpl(final byte markerByte, final URI dataType) {
+ public RyaTypeResolverImpl(final byte markerByte, final IRI dataType) {
setMarkerByte(markerByte);
setRyaDataType(dataType);
}
@@ -84,11 +84,11 @@ public class RyaTypeResolverImpl implements RyaTypeResolver {
}
@Override
- public URI getRyaDataType() {
+ public IRI getRyaDataType() {
return dataType;
}
- public void setRyaDataType(final URI dataType) {
+ public void setRyaDataType(final IRI dataType) {
this.dataType = dataType;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
index 08eeb52..c7ac82c 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/RyaURIResolver.java
@@ -19,11 +19,9 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/16/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ShortRyaTypeResolver.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ShortRyaTypeResolver.java b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ShortRyaTypeResolver.java
index 023fb30..baefacc 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ShortRyaTypeResolver.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/resolver/impl/ShortRyaTypeResolver.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.calrissian.mango.types.LexiTypeEncoders;
import org.calrissian.mango.types.TypeEncoder;
import org.calrissian.mango.types.exception.TypeDecodingException;
import org.calrissian.mango.types.exception.TypeEncodingException;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterableIteration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterableIteration.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterableIteration.java
index 87c5ee2..f192d73 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterableIteration.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterableIteration.java
@@ -19,15 +19,12 @@ package org.apache.rya.api.utils;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.io.IOException;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.calrissian.mango.collect.CloseableIterable;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
/**
* Date: 1/30/13
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/EnumerationWrapper.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/EnumerationWrapper.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/EnumerationWrapper.java
index 250ff1f..73dac7b 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/EnumerationWrapper.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/EnumerationWrapper.java
@@ -19,12 +19,10 @@ package org.apache.rya.api.utils;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Enumeration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+
/**
* Date: 7/26/12
* Time: 9:12 AM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/IteratorWrapper.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/IteratorWrapper.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/IteratorWrapper.java
index 0a841f2..50f7e9c 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/IteratorWrapper.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/IteratorWrapper.java
@@ -19,12 +19,10 @@ package org.apache.rya.api.utils;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Iterator;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+
/**
* Date: 7/26/12
* Time: 9:12 AM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/NullableStatementImpl.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/NullableStatementImpl.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/NullableStatementImpl.java
index e5e75f2..9ac9705 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/NullableStatementImpl.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/NullableStatementImpl.java
@@ -19,12 +19,10 @@ package org.apache.rya.api.utils;
* under the License.
*/
-
-
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
/**
* Class NullableStatementImpl
@@ -34,11 +32,11 @@ import org.openrdf.model.Value;
public class NullableStatementImpl implements Statement {
private Resource subject;
- private URI predicate;
+ private IRI predicate;
private Value object;
private Resource[] contexts;
- public NullableStatementImpl(Resource subject, URI predicate, Value object, Resource... contexts) {
+ public NullableStatementImpl(Resource subject, IRI predicate, Value object, Resource... contexts) {
this.subject = subject;
this.predicate = predicate;
this.object = object;
@@ -81,7 +79,7 @@ public class NullableStatementImpl implements Statement {
return object;
}
- public URI getPredicate() {
+ public IRI getPredicate() {
return predicate;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/PeekingCloseableIteration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/PeekingCloseableIteration.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/PeekingCloseableIteration.java
index 18cef9b..8086277 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/PeekingCloseableIteration.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/PeekingCloseableIteration.java
@@ -19,10 +19,9 @@ package org.apache.rya.api.utils;
* under the License.
*/
-
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import com.google.common.base.Preconditions;
-import info.aduna.iteration.CloseableIteration;
/**
* Date: 7/24/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/QueryInvestigator.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/QueryInvestigator.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/QueryInvestigator.java
index 54f0010..deaa659 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/QueryInvestigator.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/QueryInvestigator.java
@@ -22,8 +22,8 @@ import static java.util.Objects.requireNonNull;
import java.util.regex.Pattern;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementAddBindingSetFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementAddBindingSetFunction.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementAddBindingSetFunction.java
index a2b97ff..01c6f7b 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementAddBindingSetFunction.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementAddBindingSetFunction.java
@@ -19,14 +19,13 @@ package org.apache.rya.api.utils;
* under the License.
*/
+import java.util.Map;
-
-import com.google.common.base.Function;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
-import java.util.Map;
+import com.google.common.base.Function;
/**
* Date: 1/18/13
@@ -35,6 +34,6 @@ import java.util.Map;
public class RyaStatementAddBindingSetFunction implements Function<RyaStatement, Map.Entry<RyaStatement, BindingSet>> {
@Override
public Map.Entry<RyaStatement, BindingSet> apply(RyaStatement ryaStatement) {
- return new RdfCloudTripleStoreUtils.CustomEntry<org.apache.rya.api.domain.RyaStatement, org.openrdf.query.BindingSet>(ryaStatement, null);
+ return new RdfCloudTripleStoreUtils.CustomEntry<RyaStatement, BindingSet>(ryaStatement, null);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementRemoveBindingSetCloseableIteration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementRemoveBindingSetCloseableIteration.java b/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementRemoveBindingSetCloseableIteration.java
index d803715..3ca210f 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementRemoveBindingSetCloseableIteration.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/utils/RyaStatementRemoveBindingSetCloseableIteration.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.utils;
* under the License.
*/
+import java.util.Map;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.persist.RyaDAOException;
-import org.openrdf.query.BindingSet;
-
-import java.util.Map;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Date: 1/18/13
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function b/common/rya.api/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
new file mode 100644
index 0000000..104a13c
--- /dev/null
+++ b/common/rya.api/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
@@ -0,0 +1,17 @@
+ # 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.
+org.apache.rya.api.functions.DateTimeWithinPeriod
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function b/common/rya.api/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
deleted file mode 100644
index 104a13c..0000000
--- a/common/rya.api/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
+++ /dev/null
@@ -1,17 +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.
-org.apache.rya.api.functions.DateTimeWithinPeriod
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
index bb349bb..fe1216a 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/domain/RyaTypeTest.java
@@ -19,9 +19,9 @@ package org.apache.rya.api.domain;
* under the License.
*/
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
public class RyaTypeTest {
static RyaType a = new RyaType(XMLSchema.STRING, "http://www.example.com/Alice");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java b/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
index d61a802..c316b50 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/domain/StatementMetadataTest.java
@@ -20,7 +20,6 @@ package org.apache.rya.api.domain;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
public class StatementMetadataTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/functions/DateTimeWithinPeriodTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/functions/DateTimeWithinPeriodTest.java b/common/rya.api/src/test/java/org/apache/rya/api/functions/DateTimeWithinPeriodTest.java
index ac27d1b..31afba0 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/functions/DateTimeWithinPeriodTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/functions/DateTimeWithinPeriodTest.java
@@ -27,17 +27,17 @@ import java.time.format.DateTimeFormatter;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
import org.junit.Test;
-import org.openrdf.model.Literal;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
public class DateTimeWithinPeriodTest {
- private static final ValueFactory vf = new ValueFactoryImpl();
- private static final Literal TRUE = vf.createLiteral(true);
- private static final Literal FALSE = vf.createLiteral(false);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final Literal TRUE = VF.createLiteral(true);
+ private static final Literal FALSE = VF.createLiteral(false);
private static final ZonedDateTime testThisTimeDate = ZonedDateTime.parse("2018-02-03T14:15:16+07:00");
@Test
@@ -50,14 +50,14 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime1 = zTime.minusSeconds(1);
String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);
- Literal now = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, now, now, vf.createLiteral(1), OWLTime.SECONDS_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(1), OWLTime.SECONDS_URI));
- assertEquals(TRUE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(2), OWLTime.SECONDS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, now, VF.createLiteral(1), OWLTime.SECONDS_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(1), OWLTime.SECONDS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(2), OWLTime.SECONDS_URI));
}
@Test
@@ -71,14 +71,14 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime1 = zTime.minusMinutes(1);
String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);
- Literal now = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, now, now,vf.createLiteral(1),OWLTime.MINUTES_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(1),OWLTime.MINUTES_URI));
- assertEquals(TRUE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(2),OWLTime.MINUTES_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, now,VF.createLiteral(1),OWLTime.MINUTES_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(1),OWLTime.MINUTES_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(2),OWLTime.MINUTES_URI));
}
@@ -92,14 +92,14 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime1 = zTime.minusHours(1);
String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);
- Literal now = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, now, now,vf.createLiteral(1),OWLTime.HOURS_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(1),OWLTime.HOURS_URI));
- assertEquals(TRUE, func.evaluate(vf, now, nowMinusOne,vf.createLiteral(2),OWLTime.HOURS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, now,VF.createLiteral(1),OWLTime.HOURS_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(1),OWLTime.HOURS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne,VF.createLiteral(2),OWLTime.HOURS_URI));
}
@@ -113,14 +113,14 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime1 = zTime.minusDays(1);
String time1 = zTime1.format(DateTimeFormatter.ISO_INSTANT);
- Literal now = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, now, now, vf.createLiteral(1), OWLTime.DAYS_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusOne, vf.createLiteral(1), OWLTime.DAYS_URI));
- assertEquals(TRUE, func.evaluate(vf, now, nowMinusOne, vf.createLiteral(2), OWLTime.DAYS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, now, VF.createLiteral(1), OWLTime.DAYS_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne, VF.createLiteral(1), OWLTime.DAYS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne, VF.createLiteral(2), OWLTime.DAYS_URI));
}
// Note that this test fails if the week under test spans a DST when the USA springs forward.
@@ -137,16 +137,16 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime2 = zTime.minusWeeks(7);
String time2 = zTime2.format(DateTimeFormatter.ISO_INSTANT);
- Literal now = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
- Literal nowMinusSeven = vf.createLiteral(dtf.newXMLGregorianCalendar(time2));
+ Literal now = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal nowMinusSeven = VF.createLiteral(dtf.newXMLGregorianCalendar(time2));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, now, now, vf.createLiteral(1), OWLTime.WEEKS_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusOne, vf.createLiteral(1), OWLTime.WEEKS_URI));
- assertEquals(TRUE, func.evaluate(vf, now, nowMinusOne, vf.createLiteral(2), OWLTime.WEEKS_URI));
- assertEquals(FALSE, func.evaluate(vf, now, nowMinusSeven, vf.createLiteral(7), OWLTime.WEEKS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, now, VF.createLiteral(1), OWLTime.WEEKS_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusOne, VF.createLiteral(1), OWLTime.WEEKS_URI));
+ assertEquals(TRUE, func.evaluate(VF, now, nowMinusOne, VF.createLiteral(2), OWLTime.WEEKS_URI));
+ assertEquals(FALSE, func.evaluate(VF, now, nowMinusSeven, VF.createLiteral(7), OWLTime.WEEKS_URI));
}
@Test
@@ -165,17 +165,17 @@ public class DateTimeWithinPeriodTest {
ZonedDateTime zTime3 = now.minusDays(1).withZoneSameInstant(ZoneId.of("Asia/Seoul"));
String time3 = zTime3.format(DateTimeFormatter.ISO_INSTANT);
- Literal nowLocal = vf.createLiteral(dtf.newXMLGregorianCalendar(time));
- Literal nowEuropeTZ = vf.createLiteral(dtf.newXMLGregorianCalendar(time1));
- Literal nowAustraliaTZ = vf.createLiteral(dtf.newXMLGregorianCalendar(time2));
- Literal nowAsiaTZMinusOne = vf.createLiteral(dtf.newXMLGregorianCalendar(time3));
+ Literal nowLocal = VF.createLiteral(dtf.newXMLGregorianCalendar(time));
+ Literal nowEuropeTZ = VF.createLiteral(dtf.newXMLGregorianCalendar(time1));
+ Literal nowAustraliaTZ = VF.createLiteral(dtf.newXMLGregorianCalendar(time2));
+ Literal nowAsiaTZMinusOne = VF.createLiteral(dtf.newXMLGregorianCalendar(time3));
DateTimeWithinPeriod func = new DateTimeWithinPeriod();
- assertEquals(TRUE, func.evaluate(vf, nowLocal, nowEuropeTZ, vf.createLiteral(1), OWLTime.SECONDS_URI));
- assertEquals(TRUE, func.evaluate(vf, nowLocal, nowAustraliaTZ, vf.createLiteral(1), OWLTime.SECONDS_URI));
- assertEquals(FALSE, func.evaluate(vf, nowLocal, nowAsiaTZMinusOne, vf.createLiteral(1), OWLTime.DAYS_URI));
- assertEquals(TRUE, func.evaluate(vf, nowLocal, nowAsiaTZMinusOne, vf.createLiteral(2), OWLTime.DAYS_URI));
+ assertEquals(TRUE, func.evaluate(VF, nowLocal, nowEuropeTZ, VF.createLiteral(1), OWLTime.SECONDS_URI));
+ assertEquals(TRUE, func.evaluate(VF, nowLocal, nowAustraliaTZ, VF.createLiteral(1), OWLTime.SECONDS_URI));
+ assertEquals(FALSE, func.evaluate(VF, nowLocal, nowAsiaTZMinusOne, VF.createLiteral(1), OWLTime.DAYS_URI));
+ assertEquals(TRUE, func.evaluate(VF, nowLocal, nowAsiaTZMinusOne, VF.createLiteral(2), OWLTime.DAYS_URI));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
index aac8297..bd96436 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/AbstractTriplePatternStrategyTest.java
@@ -19,8 +19,6 @@ package org.apache.rya.api.query.strategy;
* under the License.
*/
-
-
import static org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO;
@@ -29,7 +27,6 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import junit.framework.TestCase;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
@@ -43,8 +40,9 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowRegex;
import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
-import org.openrdf.model.vocabulary.XMLSchema;
+import junit.framework.TestCase;
/**
* Date: 7/25/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
index 76216b6..0775dfa 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategyTest.java
@@ -1,13 +1,3 @@
-package org.apache.rya.api.query.strategy.wholerow;
-
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.hadoop.io.Text;
-import org.junit.Before;
-import org.openrdf.model.impl.URIImpl;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -16,9 +6,9 @@ import org.openrdf.model.impl.URIImpl;
* 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
@@ -26,10 +16,13 @@ import org.openrdf.model.impl.URIImpl;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.api.query.strategy.wholerow;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
-
-import junit.framework.TestCase;
+import org.apache.hadoop.io.Text;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
@@ -43,12 +36,18 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowRegex;
import org.apache.rya.api.resolver.triple.impl.WholeRowHashedTripleResolver;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.junit.Before;
+
+import junit.framework.TestCase;
/**
* Date: 7/14/12
* Time: 11:46 AM
*/
public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
RyaURI uri = new RyaURI("urn:test#1234");
RyaURI uri2 = new RyaURI("urn:test#1235");
@@ -58,16 +57,16 @@ public class HashedPoWholeRowTriplePatternStrategyTest extends TestCase {
RyaContext ryaContext = RyaContext.getInstance();
RyaTripleContext ryaTripleContext;
- RyaType customType1 = new RyaType(new URIImpl("urn:custom#type"), "1234");
- RyaType customType2 = new RyaType(new URIImpl("urn:custom#type"), "1235");
- RyaType customType3 = new RyaType(new URIImpl("urn:custom#type"), "1236");
+ RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
+ RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
+ RyaType customType3 = new RyaType(VF.createIRI("urn:custom#type"), "1236");
RyaTypeRange customTypeRange1 = new RyaTypeRange(customType1, customType2);
RyaTypeRange customTypeRange2 = new RyaTypeRange(customType2, customType3);
@Before
public void setUp() {
- MockRdfCloudConfiguration config = new MockRdfCloudConfiguration();
- config.set(MockRdfCloudConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
+ MockRdfConfiguration config = new MockRdfConfiguration();
+ config.set(MockRdfConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
ryaTripleContext = RyaTripleContext.getInstance(config);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
index 88a1923..d71e4e8 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategyTest.java
@@ -19,11 +19,9 @@ package org.apache.rya.api.query.strategy.wholerow;
* under the License.
*/
-
-//
import java.util.Map;
-import junit.framework.TestCase;
+import org.apache.hadoop.io.Text;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
@@ -34,16 +32,18 @@ import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
-
-import org.apache.hadoop.io.Text;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Before;
-import org.openrdf.model.impl.URIImpl;
+
+import junit.framework.TestCase;
/**
* Date: 7/14/12
* Time: 7:47 AM
*/
public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
RyaURI uri = new RyaURI("urn:test#1234");
RyaURI uri2 = new RyaURI("urn:test#1235");
@@ -53,16 +53,16 @@ public class HashedSpoWholeRowTriplePatternStrategyTest extends TestCase {
RyaContext ryaContext = RyaContext.getInstance();
RyaTripleContext ryaTripleContext;
- RyaType customType1 = new RyaType(new URIImpl("urn:custom#type"), "1234");
- RyaType customType2 = new RyaType(new URIImpl("urn:custom#type"), "1235");
- RyaType customType3 = new RyaType(new URIImpl("urn:custom#type"), "1236");
+ RyaType customType1 = new RyaType(VF.createIRI("urn:custom#type"), "1234");
+ RyaType customType2 = new RyaType(VF.createIRI("urn:custom#type"), "1235");
+ RyaType customType3 = new RyaType(VF.createIRI("urn:custom#type"), "1236");
RyaTypeRange customTypeRange1 = new RyaTypeRange(customType1, customType2);
RyaTypeRange customTypeRange2 = new RyaTypeRange(customType2, customType3);
@Before
public void setUp() {
- MockRdfCloudConfiguration config = new MockRdfCloudConfiguration();
- config.set(MockRdfCloudConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
+ MockRdfConfiguration config = new MockRdfConfiguration();
+ config.set(MockRdfConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
ryaTripleContext = RyaTripleContext.getInstance(config);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfCloudConfiguration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfCloudConfiguration.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfCloudConfiguration.java
deleted file mode 100644
index dcc707b..0000000
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfCloudConfiguration.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.rya.api.query.strategy.wholerow;
-
-/*
- * 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.
- */
-
-
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-
-public class MockRdfCloudConfiguration extends RdfCloudTripleStoreConfiguration {
-
- @Override
- public RdfCloudTripleStoreConfiguration clone() {
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfConfiguration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfConfiguration.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfConfiguration.java
new file mode 100644
index 0000000..882c3df
--- /dev/null
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/MockRdfConfiguration.java
@@ -0,0 +1,32 @@
+package org.apache.rya.api.query.strategy.wholerow;
+
+/*
+ * 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.
+ */
+
+
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+
+public class MockRdfConfiguration extends RdfCloudTripleStoreConfiguration {
+
+ @Override
+ public RdfCloudTripleStoreConfiguration clone() {
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
index 5b54fee..9bac95a 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategyTest.java
@@ -18,18 +18,22 @@
*/
package org.apache.rya.api.query.strategy.wholerow;
+import static org.apache.rya.api.RdfCloudTripleStoreConstants.LAST_BYTES;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import java.util.Arrays;
import java.util.Map;
+
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.LAST_BYTES;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.query.strategy.ByteRange;
import org.junit.After;
import org.junit.AfterClass;
-import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
index 29125e8..b9ef519 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/OspWholeRowTriplePatternStrategyTest.java
@@ -28,7 +28,7 @@
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
//import org.apache.hadoop.io.Text;
-//import org.openrdf.model.impl.URIImpl;
+//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
index ea3b46a..12bfc1f 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/PoWholeRowTriplePatternStrategyTest.java
@@ -28,7 +28,7 @@
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
//import org.apache.hadoop.io.Text;
-//import org.openrdf.model.impl.URIImpl;
+//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
index 28759b5..5e2ca7e 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategyTest.java
@@ -28,7 +28,7 @@
//import org.apache.accumulo.core.data.Key;
//import org.apache.accumulo.core.data.Range;
//import org.apache.hadoop.io.Text;
-//import org.openrdf.model.impl.URIImpl;
+//import org.eclipse.rdf4j.model.impl.URIImpl;
//
//import java.util.Map;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
index a0d2ecc..ade343f 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/RyaContextTest.java
@@ -19,20 +19,17 @@ package org.apache.rya.api.resolver;
* under the License.
*/
-
-
import java.util.Map;
-import junit.framework.TestCase;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.query.strategy.AbstractTriplePatternStrategyTest.MockRdfConfiguration;
-import org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration;
+import org.apache.rya.api.query.strategy.wholerow.MockRdfConfiguration;
import org.apache.rya.api.resolver.triple.TripleRow;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
-import org.openrdf.model.impl.URIImpl;
+import junit.framework.TestCase;
/**
*/
@@ -52,7 +49,7 @@ public class RyaContextTest extends TestCase {
assertEquals(ryaURI, deserialize);
//custom type
- ryaType = new RyaType(new URIImpl("urn:test#customDataType"), "mydata");
+ ryaType = new RyaType(SimpleValueFactory.getInstance().createIRI("urn:test#customDataType"), "mydata");
serialize = instance.serialize(ryaType);
assertEquals(ryaType, instance.deserialize(serialize));
}
@@ -62,7 +59,7 @@ public class RyaContextTest extends TestCase {
RyaURI pred = new RyaURI("urn:test#pred");
RyaType obj = new RyaType("mydata");
RyaStatement statement = new RyaStatement(subj, pred, obj);
- RyaTripleContext instance = RyaTripleContext.getInstance(new MockRdfCloudConfiguration());
+ RyaTripleContext instance = RyaTripleContext.getInstance(new MockRdfConfiguration());
Map<TABLE_LAYOUT, TripleRow> map = instance.serializeTriple(statement);
TripleRow tripleRow = map.get(TABLE_LAYOUT.SPO);
@@ -74,8 +71,8 @@ public class RyaContextTest extends TestCase {
RyaURI pred = new RyaURI("urn:test#pred");
RyaType obj = new RyaType("mydata");
RyaStatement statement = new RyaStatement(subj, pred, obj);
- MockRdfCloudConfiguration config = new MockRdfCloudConfiguration();
- config.set(MockRdfCloudConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
+ MockRdfConfiguration config = new MockRdfConfiguration();
+ config.set(MockRdfConfiguration.CONF_PREFIX_ROW_WITH_HASH, Boolean.TRUE.toString());
RyaTripleContext instance = RyaTripleContext.getInstance(config);
Map<TABLE_LAYOUT, TripleRow> map = instance.serializeTriple(statement);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolverTest.java
index 9fd086b..80bfe84 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/CustomDatatypeResolverTest.java
@@ -19,11 +19,10 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
+import org.apache.rya.api.domain.RyaType;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import junit.framework.TestCase;
-import org.apache.rya.api.domain.RyaType;
-import org.openrdf.model.impl.URIImpl;
/**
* Date: 7/16/12
@@ -32,7 +31,7 @@ import org.openrdf.model.impl.URIImpl;
public class CustomDatatypeResolverTest extends TestCase {
public void testCustomDataTypeSerialization() throws Exception {
- RyaType ryaType = new RyaType(new URIImpl("urn:test#datatype"), "testdata");
+ RyaType ryaType = new RyaType(SimpleValueFactory.getInstance().createIRI("urn:test#datatype"), "testdata");
byte[] serialize = new CustomDatatypeResolver().serialize(ryaType);
RyaType deserialize = new CustomDatatypeResolver().deserialize(serialize);
assertEquals(ryaType, deserialize);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolverTest.java
index 5f60f5a..aae2da0 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DateTimeRyaTypeResolverTest.java
@@ -19,9 +19,9 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -32,11 +32,12 @@ import javax.xml.datatype.XMLGregorianCalendar;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaTypeResolverException;
-
-import org.junit.Ignore;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.impl.CalendarLiteralImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
/**
* Test serializing and deserializing.
@@ -54,14 +55,16 @@ import org.openrdf.model.vocabulary.XMLSchema;
* deserialized= 2000-02-02T05:00:00.000Z type = XMLSchema.DATETIME
*/
public class DateTimeRyaTypeResolverTest {
- @Test
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
+ @Test
public void testDateTime() throws Exception {
long currentTime = 1342182689285l;
Date date = new Date(currentTime);
GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(date.getTime());
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc);
- CalendarLiteralImpl literal = new CalendarLiteralImpl(xmlGregorianCalendar);
+ Literal literal = VF.createLiteral(xmlGregorianCalendar);
byte[] serialize = new DateTimeRyaTypeResolver().serialize(RdfToRyaConversions.convertLiteral(literal));
RyaType deserialize = new DateTimeRyaTypeResolver().deserialize(serialize);
assertEquals("2012-07-13T12:31:29.285Z", deserialize.getData());
@@ -167,7 +170,7 @@ public class DateTimeRyaTypeResolverTest {
* @return
* @throws RyaTypeResolverException
*/
- private RyaType serializeAndDeserialize(String dateTimeString, org.openrdf.model.URI type ) throws RyaTypeResolverException {
+ private RyaType serializeAndDeserialize(String dateTimeString, IRI type ) throws RyaTypeResolverException {
if (type == null)
type = XMLSchema.DATETIME;
RyaType ryaType = new RyaType(type, dateTimeString );
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolverTest.java
index 5e42369..f8a5a73 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/DoubleRyaTypeResolverTest.java
@@ -19,13 +19,11 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
-
+import java.util.Random;
import junit.framework.TestCase;
import org.apache.rya.api.domain.RyaType;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import java.util.Random;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Date: 7/20/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolverTest.java
index 199240d..5979d9d 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/IntegerRyaTypeResolverTest.java
@@ -19,13 +19,12 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
+import java.util.Random;
-
-import junit.framework.TestCase;
import org.apache.rya.api.domain.RyaType;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
-import java.util.Random;
+import junit.framework.TestCase;
/**
* Date: 7/20/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolverTest.java
index c971d39..1017ebe 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/impl/LongRyaTypeResolverTest.java
@@ -19,15 +19,13 @@ package org.apache.rya.api.resolver.impl;
* under the License.
*/
+import static org.junit.Assert.assertEquals;
+import java.util.Random;
import org.apache.rya.api.domain.RyaType;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import java.util.Random;
-
-import static junit.framework.Assert.assertEquals;
/**
* Date: 9/7/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/utils/QueryInvestigatorTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/utils/QueryInvestigatorTest.java b/common/rya.api/src/test/java/org/apache/rya/api/utils/QueryInvestigatorTest.java
index bedc59a..809bcdd 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/utils/QueryInvestigatorTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/utils/QueryInvestigatorTest.java
@@ -21,8 +21,8 @@ package org.apache.rya.api.utils;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
/**
* Unit tests the methods of {@link QueryInvestigator}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java b/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
index 92bcfff..1a07184 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/utils/RdfIOTest.java
@@ -22,8 +22,8 @@
//
//import junit.framework.TestCase;
//import org.apache.rya.api.RdfCloudTripleStoreUtils;
-//import org.openrdf.model.Statement;
-//import org.openrdf.model.impl.StatementImpl;
+//import org.eclipse.rdf4j.model.Statement;
+//import org.eclipse.rdf4j.model.impl.StatementImpl;
//
//import static org.apache.rya.api.RdfCloudTripleStoreConstants.*;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.provenance/pom.xml b/common/rya.provenance/pom.xml
index 509b302..d7dc6f5 100644
--- a/common/rya.provenance/pom.xml
+++ b/common/rya.provenance/pom.xml
@@ -31,8 +31,8 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/ProvenanceCollectionException.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/ProvenanceCollectionException.java b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/ProvenanceCollectionException.java
index c550ee4..acf7bd3 100644
--- a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/ProvenanceCollectionException.java
+++ b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/ProvenanceCollectionException.java
@@ -19,8 +19,7 @@ package org.apache.rya.rdftriplestore.provenance;
* under the License.
*/
-
-import org.openrdf.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.RepositoryException;
/**
* Exception for errors in collecting provenance data
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollector.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollector.java b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollector.java
index 73a2d70..8827717 100644
--- a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollector.java
+++ b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollector.java
@@ -19,15 +19,13 @@ package org.apache.rya.rdftriplestore.provenance;
* under the License.
*/
-
import java.util.List;
import org.apache.rya.rdftriplestore.provenance.rdf.BaseProvenanceModel;
import org.apache.rya.rdftriplestore.provenance.rdf.RDFProvenanceModel;
-
-import org.openrdf.model.Statement;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
/**
* Records provenance data to an external rdf triplestore
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModel.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModel.java b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModel.java
index 70e0f5a..17406a0 100644
--- a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModel.java
+++ b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModel.java
@@ -19,31 +19,30 @@ package org.apache.rya.rdftriplestore.provenance.rdf;
* under the License.
*/
-
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
/**
* Basic representation of Provenance data capture in RDF.
*/
public class BaseProvenanceModel implements RDFProvenanceModel {
- private static final ValueFactory vf = ValueFactoryImpl.getInstance();
- private static final Resource queryEventType = vf.createURI("http://rya.com/provenance#QueryEvent");
- private static final URI atTimeProperty = vf.createURI("http://www.w3.org/ns/prov#atTime");
- private static final URI associatedWithUser = vf.createURI("http://rya.com/provenance#associatedWithUser");
- private static final URI queryTypeProp = vf.createURI("http://rya.com/provenance#queryType");
- private static final URI executedQueryProperty = vf.createURI("http://rya.com/provenance#executedQuery");
- private static final String queryNameSpace = "http://rya.com/provenance#queryEvent";
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final Resource QUERY_EVENT_TYPE = VF.createIRI("http://rya.com/provenance#QueryEvent");
+ private static final IRI AT_TIME_PROPERTY = VF.createIRI("http://www.w3.org/ns/prov#atTime");
+ private static final IRI ASSOCIATED_WITH_USER = VF.createIRI("http://rya.com/provenance#associatedWithUser");
+ private static final IRI QUERY_TYPE_PROP = VF.createIRI("http://rya.com/provenance#queryType");
+ private static final IRI EXECUTED_QUERY_PROPERTY = VF.createIRI("http://rya.com/provenance#executedQuery");
+ private static final String QUERY_NAMESPACE = "http://rya.com/provenance#queryEvent";
/* (non-Javadoc)
* @see org.apache.rya.rdftriplestore.provenance.rdf.RDFProvenanceModel#getStatementsForQuery(java.lang.String, java.lang.String, java.lang.String)
@@ -51,16 +50,16 @@ public class BaseProvenanceModel implements RDFProvenanceModel {
public List<Statement> getStatementsForQuery(String query, String user, String queryType) {
List<Statement> statements = new ArrayList<Statement>();
// create some statements for the query
- Resource queryEventResource = vf.createURI(queryNameSpace + UUID.randomUUID().toString());
- Statement queryEventDecl = vf.createStatement(queryEventResource, RDF.TYPE, queryEventType);
+ Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString());
+ Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE);
statements.add(queryEventDecl);
- Statement queryEventTime = vf.createStatement(queryEventResource, atTimeProperty, vf.createLiteral(new Date()));
+ Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date()));
statements.add(queryEventTime);
- Statement queryUser = vf.createStatement(queryEventResource, associatedWithUser, vf.createLiteral(user));
+ Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user));
statements.add(queryUser);
- Statement executedQuery = vf.createStatement(queryEventResource, executedQueryProperty, vf.createLiteral(query));
+ Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query));
statements.add(executedQuery);
- Statement queryTypeStatement = vf.createStatement(queryEventResource, queryTypeProp, vf.createLiteral(queryType));
+ Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType));
statements.add(queryTypeStatement);
return statements;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/RDFProvenanceModel.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/RDFProvenanceModel.java b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/RDFProvenanceModel.java
index 619f80d..8a4d4cb 100644
--- a/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/RDFProvenanceModel.java
+++ b/common/rya.provenance/src/main/java/org/apache/rya/rdftriplestore/provenance/rdf/RDFProvenanceModel.java
@@ -19,15 +19,14 @@ package org.apache.rya.rdftriplestore.provenance.rdf;
* under the License.
*/
-
import java.util.List;
-import org.openrdf.model.Statement;
+import org.eclipse.rdf4j.model.Statement;
public interface RDFProvenanceModel {
- List<Statement> getStatementsForQuery(String query, String user, String queryType);
+ public List<Statement> getStatementsForQuery(String query, String user, String queryType);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollectorTest.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollectorTest.java b/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollectorTest.java
index be49c8e..a9d4298 100644
--- a/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollectorTest.java
+++ b/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/TriplestoreProvenanceCollectorTest.java
@@ -19,19 +19,18 @@ package org.apache.rya.rdftriplestore.provenance;
* under the License.
*/
-
import static org.junit.Assert.assertTrue;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.memory.MemoryStore;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.memory.MemoryStore;
public class TriplestoreProvenanceCollectorTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModelTest.java
----------------------------------------------------------------------
diff --git a/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModelTest.java b/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModelTest.java
index 0da5a4d..5532f12 100644
--- a/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModelTest.java
+++ b/common/rya.provenance/src/test/java/org/apache/rya/rdftriplestore/provenance/rdf/BaseProvenanceModelTest.java
@@ -19,13 +19,12 @@ package org.apache.rya.rdftriplestore.provenance.rdf;
* under the License.
*/
-
import static org.junit.Assert.assertTrue;
import java.util.List;
+import org.eclipse.rdf4j.model.Statement;
import org.junit.Test;
-import org.openrdf.model.Statement;
public class BaseProvenanceModelTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/pom.xml
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/pom.xml b/dao/accumulo.rya/pom.xml
index beed3a4..a90c30a 100644
--- a/dao/accumulo.rya/pom.xml
+++ b/dao/accumulo.rya/pom.xml
@@ -43,16 +43,21 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-nquads</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-nquads</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-evaluation</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-evaluation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-api</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -60,8 +65,8 @@ under the License.
</dependency>
<!-- testing dependencies -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloNamespaceTableIterator.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloNamespaceTableIterator.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloNamespaceTableIterator.java
index 9f6c1dd..2de5b1c 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloNamespaceTableIterator.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloNamespaceTableIterator.java
@@ -23,15 +23,13 @@ import java.nio.charset.StandardCharsets;
import java.util.Iterator;
import java.util.Map.Entry;
+import com.google.common.base.Preconditions;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.rya.api.persist.RdfDAOException;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.impl.NamespaceImpl;
-
-import com.google.common.base.Preconditions;
-
-import info.aduna.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.model.impl.NamespaceImpl;
public class AccumuloNamespaceTableIterator<T extends Namespace> implements
CloseableIteration<Namespace, RdfDAOException> {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfEvalStatsDAO.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfEvalStatsDAO.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfEvalStatsDAO.java
index a8ed76c..6675ae3 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfEvalStatsDAO.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfEvalStatsDAO.java
@@ -43,8 +43,8 @@ import org.apache.hadoop.io.Text;
import org.apache.rya.api.layout.TableLayoutStrategy;
import org.apache.rya.api.persist.RdfDAOException;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
/**
* Class AccumuloRdfEvalStatsDAO
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
index 29fe0f3..e99cfe1 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRdfQueryIterator.java
@@ -23,7 +23,7 @@
//import com.google.common.collect.Iterators;
//import com.google.common.io.ByteArrayDataInput;
//import com.google.common.io.ByteStreams;
-//import info.aduna.iteration.CloseableIteration;
+//import org.eclipse.rdf4j.common.iteration.CloseableIteration;
//import org.apache.rya.api.RdfCloudTripleStoreConstants;
//import org.apache.rya.api.RdfCloudTripleStoreUtils;
//import org.apache.rya.api.persist.RdfDAOException;
@@ -35,11 +35,11 @@
//import org.apache.accumulo.core.iterators.user.TimestampFilter;
//import org.apache.accumulo.core.security.Authorizations;
//import org.apache.hadoop.io.Text;
-//import org.openrdf.model.Resource;
-//import org.openrdf.model.Statement;
-//import org.openrdf.model.URI;
-//import org.openrdf.model.Value;
-//import org.openrdf.query.BindingSet;
+//import org.eclipse.rdf4j.model.Resource;
+//import org.eclipse.rdf4j.model.Statement;
+//import org.eclipse.rdf4j.model.IRI;
+//import org.eclipse.rdf4j.model.Value;
+//import org.eclipse.rdf4j.query.BindingSet;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
index 22d6dc9..f3e97a3 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
@@ -69,13 +69,12 @@ import org.apache.rya.api.persist.RyaDAO;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.RyaNamespaceManager;
import org.apache.rya.api.resolver.RyaTripleContext;
-import org.openrdf.model.Namespace;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Namespace;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-
public class AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> {
private static final Log logger = LogFactory.getLog(AccumuloRyaDAO.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
index a6104f4..1609f2f 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/DefineTripleQueryRangeFactory.java
@@ -26,9 +26,9 @@
//import org.apache.rya.api.domain.RangeValue;
//import org.apache.accumulo.core.data.Range;
//import org.apache.hadoop.io.Text;
-//import org.openrdf.model.Value;
-//import org.openrdf.model.ValueFactory;
-//import org.openrdf.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.model.Value;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
//
//import java.io.IOException;
//import java.util.Map;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableKeyValues.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableKeyValues.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableKeyValues.java
index 78e00f2..7361c69 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableKeyValues.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableKeyValues.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo;
* under the License.
*/
-
-
import static org.apache.rya.accumulo.AccumuloRdfConstants.EMPTY_VALUE;
import java.io.IOException;
@@ -29,6 +27,10 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.ColumnVisibility;
+import org.apache.hadoop.io.Text;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
@@ -36,11 +38,6 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.hadoop.io.Text;
-
public class RyaTableKeyValues {
public static final ColumnVisibility EMPTY_CV = new ColumnVisibility();
public static final Text EMPTY_CV_TEXT = new Text(EMPTY_CV.getExpression());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableMutationsFactory.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableMutationsFactory.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableMutationsFactory.java
index b06be7b..05c3c86 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableMutationsFactory.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/RyaTableMutationsFactory.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo;
* under the License.
*/
-
-
import static org.apache.rya.accumulo.AccumuloRdfConstants.EMPTY_CV;
import static org.apache.rya.accumulo.AccumuloRdfConstants.EMPTY_VALUE;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.EMPTY_TEXT;
@@ -31,7 +29,10 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.ColumnVisibility;
+import org.apache.hadoop.io.Text;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
@@ -39,11 +40,6 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.hadoop.io.Text;
-
public class RyaTableMutationsFactory {
RyaTripleContext ryaContext;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AccumuloIndexer.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AccumuloIndexer.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AccumuloIndexer.java
index 4a164a9..2646718 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AccumuloIndexer.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AccumuloIndexer.java
@@ -19,12 +19,10 @@ package org.apache.rya.accumulo.experimental;
* under the License.
*/
-
import java.io.IOException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
index d89928c..8887739 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
@@ -63,15 +63,14 @@ import org.apache.rya.api.utils.CloseableIterableIteration;
import org.calrissian.mango.collect.CloseableIterable;
import org.calrissian.mango.collect.CloseableIterables;
import org.calrissian.mango.collect.FluentCloseableIterable;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterators;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Date: 7/17/12 Time: 9:28 AM
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/KeyValueToRyaStatementFunction.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/KeyValueToRyaStatementFunction.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/KeyValueToRyaStatementFunction.java
index 9dd84c6..e1e74d5 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/KeyValueToRyaStatementFunction.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/KeyValueToRyaStatementFunction.java
@@ -19,22 +19,17 @@ package org.apache.rya.accumulo.query;
* under the License.
*/
-
-
import java.util.Map;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import com.google.common.base.Function;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Value;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.Value;
-
-import com.google.common.base.Function;
-
/**
* Date: 1/30/13
* Time: 2:09 PM
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RangeBindingSetEntries.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RangeBindingSetEntries.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RangeBindingSetEntries.java
index 4887ba0..7d15223 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RangeBindingSetEntries.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/RangeBindingSetEntries.java
@@ -1,9 +1,3 @@
-package org.apache.rya.accumulo.query;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -12,9 +6,9 @@ import java.util.Set;
* 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
@@ -22,12 +16,17 @@ import java.util.Set;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.accumulo.query;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparator;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
[21/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
index a2cc08d..a353de8 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
@@ -18,18 +18,14 @@ package org.apache.rya.indexing.statement.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
-import java.util.Map;
import org.apache.accumulo.core.client.Connector;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
@@ -37,25 +33,25 @@ import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-
-import info.aduna.iteration.CloseableIteration;
public class AccumuloStatementMetadataNodeTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private AccumuloRyaDAO dao;
private AccumuloRdfConfiguration conf;
@@ -99,8 +95,8 @@ public class AccumuloStatementMetadataNodeTest {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(new QueryBindingSet());
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", new LiteralImpl("CoffeeShop"));
- bs.addBinding("y", new LiteralImpl("Joe"));
+ bs.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bs.addBinding("y", VF.createLiteral("Joe"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -166,15 +162,15 @@ public class AccumuloStatementMetadataNodeTest {
StatementMetadataNode<AccumuloRdfConfiguration> node = new StatementMetadataNode<>(spList, conf);
QueryBindingSet bsConstraint = new QueryBindingSet();
- bsConstraint.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint.addBinding("z", VF.createLiteral("Virginia"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsConstraint);
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected.addBinding("y", new LiteralImpl("Joe"));
- expected.addBinding("z", new LiteralImpl("Virginia"));
+ expected.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected.addBinding("y", VF.createLiteral("Joe"));
+ expected.addBinding("z", VF.createLiteral("Virginia"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -223,21 +219,21 @@ public class AccumuloStatementMetadataNodeTest {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("y", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("y", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("y", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("y", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("y", new LiteralImpl("CoffeeShop"));
- expected.addBinding("x", new URIImpl("http://Joe"));
- expected.addBinding("z", new LiteralImpl("Virginia"));
+ expected.addBinding("y", VF.createLiteral("CoffeeShop"));
+ expected.addBinding("x", VF.createIRI("http://Joe"));
+ expected.addBinding("z", VF.createLiteral("Virginia"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -281,8 +277,8 @@ public class AccumuloStatementMetadataNodeTest {
StatementMetadataNode<AccumuloRdfConfiguration> node = new StatementMetadataNode<>(spList, conf);
QueryBindingSet bsConstraint = new QueryBindingSet();
- bsConstraint.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint.addBinding("y", new LiteralImpl("Doug"));
+ bsConstraint.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint.addBinding("y", VF.createLiteral("Doug"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsConstraint);
@@ -328,16 +324,16 @@ public class AccumuloStatementMetadataNodeTest {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("x", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("x", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
QueryBindingSet bsConstraint3 = new QueryBindingSet();
- bsConstraint3.addBinding("x", new LiteralImpl("BurgerShack"));
- bsConstraint3.addBinding("z", new LiteralImpl("Delaware"));
+ bsConstraint3.addBinding("x", VF.createLiteral("BurgerShack"));
+ bsConstraint3.addBinding("z", VF.createLiteral("Delaware"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
bsCollection.add(bsConstraint3);
@@ -345,14 +341,14 @@ public class AccumuloStatementMetadataNodeTest {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
- expected1.addBinding("z", new LiteralImpl("Virginia"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
+ expected1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
- expected2.addBinding("z", new LiteralImpl("Maryland"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
+ expected2.addBinding("z", VF.createLiteral("Maryland"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -406,16 +402,16 @@ public class AccumuloStatementMetadataNodeTest {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("x", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("x", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
QueryBindingSet bsConstraint3 = new QueryBindingSet();
- bsConstraint3.addBinding("x", new LiteralImpl("BurgerShack"));
- bsConstraint3.addBinding("z", new LiteralImpl("Delaware"));
+ bsConstraint3.addBinding("x", VF.createLiteral("BurgerShack"));
+ bsConstraint3.addBinding("z", VF.createLiteral("Delaware"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
bsCollection.add(bsConstraint3);
@@ -423,9 +419,9 @@ public class AccumuloStatementMetadataNodeTest {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
- expected1.addBinding("z", new LiteralImpl("Virginia"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
+ expected1.addBinding("z", VF.createLiteral("Virginia"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -478,16 +474,16 @@ public class AccumuloStatementMetadataNodeTest {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("x", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("x", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
QueryBindingSet bsConstraint3 = new QueryBindingSet();
- bsConstraint3.addBinding("x", new LiteralImpl("BurgerShack"));
- bsConstraint3.addBinding("z", new LiteralImpl("Delaware"));
+ bsConstraint3.addBinding("x", VF.createLiteral("BurgerShack"));
+ bsConstraint3.addBinding("z", VF.createLiteral("Delaware"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
bsCollection.add(bsConstraint3);
@@ -495,16 +491,16 @@ public class AccumuloStatementMetadataNodeTest {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
- expected1.addBinding("z", new LiteralImpl("Virginia"));
- expected1.addBinding("c", new URIImpl("http://context_1"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
+ expected1.addBinding("z", VF.createLiteral("Virginia"));
+ expected1.addBinding("c", VF.createIRI("http://context_1"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
- expected2.addBinding("z", new LiteralImpl("Maryland"));
- expected2.addBinding("c", new URIImpl("http://context_2"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
+ expected2.addBinding("z", VF.createLiteral("Maryland"));
+ expected2.addBinding("c", VF.createIRI("http://context_2"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -560,24 +556,24 @@ public class AccumuloStatementMetadataNodeTest {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
- bsConstraint1.addBinding("c", new URIImpl("http://context_1"));
+ bsConstraint1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
+ bsConstraint1.addBinding("c", VF.createIRI("http://context_1"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
- bsConstraint2.addBinding("c", new URIImpl("http://context_2"));
+ bsConstraint2.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
+ bsConstraint2.addBinding("c", VF.createIRI("http://context_2"));
QueryBindingSet bsConstraint4 = new QueryBindingSet();
- bsConstraint4.addBinding("x", new LiteralImpl("HardwareStore"));
- bsConstraint4.addBinding("z", new LiteralImpl("WestVirginia"));
- bsConstraint4.addBinding("c", new URIImpl("http://context_2"));
+ bsConstraint4.addBinding("x", VF.createLiteral("HardwareStore"));
+ bsConstraint4.addBinding("z", VF.createLiteral("WestVirginia"));
+ bsConstraint4.addBinding("c", VF.createIRI("http://context_2"));
QueryBindingSet bsConstraint3 = new QueryBindingSet();
- bsConstraint3.addBinding("x", new LiteralImpl("BurgerShack"));
- bsConstraint3.addBinding("z", new LiteralImpl("Delaware"));
- bsConstraint3.addBinding("c", new URIImpl("http://context_1"));
+ bsConstraint3.addBinding("x", VF.createLiteral("BurgerShack"));
+ bsConstraint3.addBinding("z", VF.createLiteral("Delaware"));
+ bsConstraint3.addBinding("c", VF.createIRI("http://context_1"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
bsCollection.add(bsConstraint3);
@@ -596,16 +592,16 @@ public class AccumuloStatementMetadataNodeTest {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
- expected1.addBinding("z", new LiteralImpl("Virginia"));
- expected1.addBinding("c", new URIImpl("http://context_1"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
+ expected1.addBinding("z", VF.createLiteral("Virginia"));
+ expected1.addBinding("c", VF.createIRI("http://context_1"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
- expected2.addBinding("z", new LiteralImpl("WestVirginia"));
- expected2.addBinding("c", new URIImpl("http://context_2"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
+ expected2.addBinding("z", VF.createLiteral("WestVirginia"));
+ expected2.addBinding("c", VF.createIRI("http://context_2"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
index 48a0f28..d887bc6 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -34,24 +35,25 @@ import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
public class AccumuloStatementMetadataOptimizerIT {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private RdfCloudTripleStoreConfiguration conf;
private Sail sail;
@@ -100,8 +102,8 @@ public class AccumuloStatementMetadataOptimizerIT {
TupleQueryResult result = conn.prepareTupleQuery(QueryLanguage.SPARQL, query1).evaluate();
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", new LiteralImpl("CoffeeShop"));
- bs.addBinding("y", new LiteralImpl("Joe"));
+ bs.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bs.addBinding("y", VF.createLiteral("Joe"));
List<BindingSet> bsList = new ArrayList<>();
while (result.hasNext()) {
@@ -162,11 +164,11 @@ public class AccumuloStatementMetadataOptimizerIT {
Set<BindingSet> expected = new HashSet<>();
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
expected.add(expected1);
expected.add(expected2);
@@ -221,9 +223,9 @@ public class AccumuloStatementMetadataOptimizerIT {
Set<BindingSet> expected = new HashSet<>();
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("b", new URIImpl("http://Betty"));
- expected1.addBinding("a", new URIImpl("http://Joe"));
- expected1.addBinding("c", new URIImpl("http://Doug"));
+ expected1.addBinding("b", VF.createIRI("http://Betty"));
+ expected1.addBinding("a", VF.createIRI("http://Joe"));
+ expected1.addBinding("c", VF.createIRI("http://Doug"));
expected.add(expected1);
Set<BindingSet> bsSet = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
index 647e3cc..0797033 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
@@ -35,21 +35,22 @@ import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoDBRyaDAO;
import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
public class MongoStatementMetadataIT extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final String query1 = "prefix owl: <http://www.w3.org/2002/07/owl#> prefix ano: <http://www.w3.org/2002/07/owl#annotated> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?x ?y where {_:blankNode rdf:type owl:Annotation; ano:Source <http://Joe>; "
+ "ano:Property <http://worksAt>; ano:Target ?x; <http://createdBy> ?y; <http://createdOn> \'2017-01-04\'^^xsd:date }";
@@ -86,8 +87,8 @@ public class MongoStatementMetadataIT extends MongoITBase {
final TupleQueryResult result = conn.prepareTupleQuery(QueryLanguage.SPARQL, query1).evaluate();
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", new LiteralImpl("CoffeeShop"));
- bs.addBinding("y", new LiteralImpl("Joe"));
+ bs.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bs.addBinding("y", VF.createLiteral("Joe"));
final List<BindingSet> bsList = new ArrayList<>();
while (result.hasNext()) {
@@ -165,11 +166,11 @@ public class MongoStatementMetadataIT extends MongoITBase {
final Set<BindingSet> expected = new HashSet<>();
final QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
final QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
expected.add(expected1);
expected.add(expected2);
@@ -233,9 +234,9 @@ public class MongoStatementMetadataIT extends MongoITBase {
final Set<BindingSet> expected = new HashSet<>();
final QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("b", new URIImpl("http://Betty"));
- expected1.addBinding("a", new URIImpl("http://Joe"));
- expected1.addBinding("c", new URIImpl("http://Doug"));
+ expected1.addBinding("b", VF.createIRI("http://Betty"));
+ expected1.addBinding("a", VF.createIRI("http://Joe"));
+ expected1.addBinding("c", VF.createIRI("http://Doug"));
expected.add(expected1);
final Set<BindingSet> bsSet = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
index cab6c35..20fa32d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
@@ -31,23 +31,24 @@ import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoDBRyaDAO;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-
-import info.aduna.iteration.CloseableIteration;
public class MongoStatementMetadataNodeIT extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private final String query = "prefix owl: <http://www.w3.org/2002/07/owl#> prefix ano: <http://www.w3.org/2002/07/owl#annotated> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?x ?y where {_:blankNode rdf:type owl:Annotation; ano:Source <http://Joe>; "
+ "ano:Property <http://worksAt>; ano:Target ?x; <http://createdBy> ?y; <http://createdOn> \'2017-01-04\'^^xsd:date }";
private final String query2 = "prefix owl: <http://www.w3.org/2002/07/owl#> prefix ano: <http://www.w3.org/2002/07/owl#annotated> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?x ?y where {_:blankNode rdf:type owl:Annotation; ano:Source ?x; "
@@ -82,8 +83,8 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(new QueryBindingSet());
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("x", new LiteralImpl("CoffeeShop"));
- bs.addBinding("y", new LiteralImpl("Joe"));
+ bs.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bs.addBinding("y", VF.createLiteral("Joe"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -158,15 +159,15 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
StatementMetadataNode<MongoDBRdfConfiguration> node = new StatementMetadataNode<>(spList, conf);
QueryBindingSet bsConstraint = new QueryBindingSet();
- bsConstraint.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint.addBinding("z", VF.createLiteral("Virginia"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsConstraint);
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected.addBinding("y", new LiteralImpl("Joe"));
- expected.addBinding("z", new LiteralImpl("Virginia"));
+ expected.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected.addBinding("y", VF.createLiteral("Joe"));
+ expected.addBinding("z", VF.createLiteral("Virginia"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -216,21 +217,21 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("y", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("y", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("y", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("y", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsCollection);
QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("y", new LiteralImpl("CoffeeShop"));
- expected.addBinding("x", new URIImpl("http://Joe"));
- expected.addBinding("z", new LiteralImpl("Virginia"));
+ expected.addBinding("y", VF.createLiteral("CoffeeShop"));
+ expected.addBinding("x", VF.createIRI("http://Joe"));
+ expected.addBinding("z", VF.createLiteral("Virginia"));
List<BindingSet> bsList = new ArrayList<>();
while (iteration.hasNext()) {
@@ -275,8 +276,8 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
StatementMetadataNode<MongoDBRdfConfiguration> node = new StatementMetadataNode<>(spList, conf);
QueryBindingSet bsConstraint = new QueryBindingSet();
- bsConstraint.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint.addBinding("y", new LiteralImpl("Doug"));
+ bsConstraint.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint.addBinding("y", VF.createLiteral("Doug"));
CloseableIteration<BindingSet, QueryEvaluationException> iteration = node.evaluate(bsConstraint);
@@ -323,16 +324,16 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
List<BindingSet> bsCollection = new ArrayList<>();
QueryBindingSet bsConstraint1 = new QueryBindingSet();
- bsConstraint1.addBinding("x", new LiteralImpl("CoffeeShop"));
- bsConstraint1.addBinding("z", new LiteralImpl("Virginia"));
+ bsConstraint1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ bsConstraint1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet bsConstraint2 = new QueryBindingSet();
- bsConstraint2.addBinding("x", new LiteralImpl("HardwareStore"));
- bsConstraint2.addBinding("z", new LiteralImpl("Maryland"));
+ bsConstraint2.addBinding("x", VF.createLiteral("HardwareStore"));
+ bsConstraint2.addBinding("z", VF.createLiteral("Maryland"));
QueryBindingSet bsConstraint3 = new QueryBindingSet();
- bsConstraint3.addBinding("x", new LiteralImpl("BurgerShack"));
- bsConstraint3.addBinding("z", new LiteralImpl("Delaware"));
+ bsConstraint3.addBinding("x", VF.createLiteral("BurgerShack"));
+ bsConstraint3.addBinding("z", VF.createLiteral("Delaware"));
bsCollection.add(bsConstraint1);
bsCollection.add(bsConstraint2);
bsCollection.add(bsConstraint3);
@@ -341,14 +342,14 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
Set<BindingSet> expected = new HashSet<>();
QueryBindingSet expected1 = new QueryBindingSet();
- expected1.addBinding("x", new LiteralImpl("CoffeeShop"));
- expected1.addBinding("y", new LiteralImpl("Joe"));
- expected1.addBinding("z", new LiteralImpl("Virginia"));
+ expected1.addBinding("x", VF.createLiteral("CoffeeShop"));
+ expected1.addBinding("y", VF.createLiteral("Joe"));
+ expected1.addBinding("z", VF.createLiteral("Virginia"));
QueryBindingSet expected2 = new QueryBindingSet();
- expected2.addBinding("x", new LiteralImpl("HardwareStore"));
- expected2.addBinding("y", new LiteralImpl("Joe"));
- expected2.addBinding("z", new LiteralImpl("Maryland"));
+ expected2.addBinding("x", VF.createLiteral("HardwareStore"));
+ expected2.addBinding("y", VF.createLiteral("Joe"));
+ expected2.addBinding("z", VF.createLiteral("Maryland"));
expected.add(expected1);
expected.add(expected2);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
index f3d0c1e..c4318fb 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -28,21 +29,22 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataExternalSetProvider;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class StatementMetadataExternalSetProviderTest {
@@ -129,7 +131,7 @@ public class StatementMetadataExternalSetProviderTest {
Set<StatementPattern> sp3 = StatementMetadataTestUtils.getMetadataStatementPatterns(pq3.getTupleExpr(), propertySet);
//added extra blankNode into query3 to make blankNode names line up with query2. Need to remove it now so that
//StatementMetadataNode doesn't blow up because all subjects aren't the same.
- removePatternWithGivenSubject("-anon-1", sp3);
+ removePatternWithGivenSubject(VarNameUtils.prependAnonymous("1"), sp3);
patterns.addAll(StatementPatternCollector.process(pq2.getTupleExpr()));
JoinSegment<StatementMetadataNode<?>> segment = new JoinSegment<>(
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
index 4a65d99..fba9652 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
@@ -36,20 +37,20 @@ import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataExte
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
@RunWith(value = Parameterized.class)
public class StatementMetadataOptimizerTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
index 35c5405..51ea682 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
@@ -17,6 +17,7 @@ package org.apache.rya.indexing.statement.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -24,15 +25,15 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.indexing.statement.metadata.matching.OWLReify;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
public class StatementMetadataTestUtils {
@@ -46,7 +47,7 @@ public class StatementMetadataTestUtils {
return collector.getNodes();
}
- public static class MetadataNodeCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class MetadataNodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
Set<QueryModelNode> qNodes = new HashSet<>();
@@ -70,7 +71,7 @@ public class StatementMetadataTestUtils {
}
- public static class MetadataStatementPatternCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class MetadataStatementPatternCollector extends AbstractQueryModelVisitor<RuntimeException> {
private Set<StatementPattern> nodes;
private Set<RyaURI> properties;
@@ -84,7 +85,7 @@ public class StatementMetadataTestUtils {
public void meet(StatementPattern node) {
Var predicate = node.getPredicateVar();
Value val = predicate.getValue();
- if (val != null && val instanceof URI) {
+ if (val != null && val instanceof IRI) {
RyaURI ryaVal = new RyaURI(val.stringValue());
if (uriList.contains(ryaVal) || properties.contains(ryaVal)) {
nodes.add(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaAccumuloSailFactoryTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaAccumuloSailFactoryTest.java b/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaAccumuloSailFactoryTest.java
index a22825b..050cfe0 100644
--- a/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaAccumuloSailFactoryTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaAccumuloSailFactoryTest.java
@@ -8,9 +8,9 @@ package org.apache.rya.sail.config;
* 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
@@ -24,40 +24,35 @@ import static org.junit.Assert.assertTrue;
import java.io.InputStream;
import java.io.StringReader;
-import java.util.HashMap;
import java.util.Map;
-import org.apache.rya.sail.config.RyaAccumuloSailConfig;
-import org.apache.rya.sail.config.RyaAccumuloSailFactory;
-
import org.apache.commons.io.IOUtils;
+import org.eclipse.rdf4j.model.Model;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.LinkedHashModel;
+import org.eclipse.rdf4j.model.util.Models;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.config.ConfigTemplate;
+import org.eclipse.rdf4j.repository.config.RepositoryConfig;
+import org.eclipse.rdf4j.repository.config.RepositoryConfigSchema;
+import org.eclipse.rdf4j.repository.config.RepositoryImplConfig;
+import org.eclipse.rdf4j.repository.config.RepositoryRegistry;
+import org.eclipse.rdf4j.repository.manager.LocalRepositoryManager;
+import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig;
+import org.eclipse.rdf4j.repository.sail.config.SailRepositoryFactory;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParser;
+import org.eclipse.rdf4j.rio.Rio;
+import org.eclipse.rdf4j.rio.helpers.StatementCollector;
+import org.eclipse.rdf4j.sail.config.SailFactory;
+import org.eclipse.rdf4j.sail.config.SailRegistry;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
-import org.openrdf.model.Graph;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.LinkedHashModel;
-import org.openrdf.model.util.GraphUtil;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.config.ConfigTemplate;
-import org.openrdf.repository.config.RepositoryConfig;
-import org.openrdf.repository.config.RepositoryConfigSchema;
-import org.openrdf.repository.config.RepositoryConfigUtil;
-import org.openrdf.repository.config.RepositoryImplConfig;
-import org.openrdf.repository.config.RepositoryRegistry;
-import org.openrdf.repository.manager.LocalRepositoryManager;
-import org.openrdf.repository.sail.config.SailRepositoryConfig;
-import org.openrdf.repository.sail.config.SailRepositoryFactory;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.Rio;
-import org.openrdf.rio.helpers.StatementCollector;
-import org.openrdf.sail.config.SailFactory;
-import org.openrdf.sail.config.SailRegistry;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Files;
@@ -92,7 +87,7 @@ public class RyaAccumuloSailFactoryTest {
RepositoryConnection rc = r.getConnection();
ValueFactory vf = rc.getValueFactory();
- Statement s = vf.createStatement(vf.createURI("u:a"), vf.createURI("u:b"), vf.createURI("u:c"));
+ Statement s = vf.createStatement(vf.createIRI("u:a"), vf.createIRI("u:b"), vf.createIRI("u:c"));
assertFalse(rc.hasStatement(s, false));
@@ -106,12 +101,10 @@ public class RyaAccumuloSailFactoryTest {
public void testCreateFromTemplateName() throws Exception {
LocalRepositoryManager repoman = new LocalRepositoryManager(Files.createTempDir());
repoman.initialize();
-
-
-
+
try(InputStream templateStream = RepositoryConfig.class.getResourceAsStream("RyaAccumuloSail.ttl")) {
String template = IOUtils.toString(templateStream);
-
+
final ConfigTemplate configTemplate = new ConfigTemplate(template);
final Map<String, String> valueMap = ImmutableMap.<String, String> builder()
.put("Repository ID", "RyaAccumuloSail")
@@ -122,49 +115,46 @@ public class RyaAccumuloSailFactoryTest {
.put("Rya Accumulo zookeepers", "zoo1,zoo2,zoo3")
.put("Rya Accumulo is mock", "true")
.build();
-
+
final String configString = configTemplate.render(valueMap);
-
+
// final Repository systemRepo = this.state.getManager().getSystemRepository();
- final Graph graph = new LinkedHashModel();
+ final Model model = new LinkedHashModel();
final RDFParser rdfParser = Rio.createParser(RDFFormat.TURTLE);
- rdfParser.setRDFHandler(new StatementCollector(graph));
+ rdfParser.setRDFHandler(new StatementCollector(model));
rdfParser.parse(new StringReader(configString), RepositoryConfigSchema.NAMESPACE);
- final Resource repositoryNode = GraphUtil.getUniqueSubject(graph, RDF.TYPE,
- RepositoryConfigSchema.REPOSITORY);
- final RepositoryConfig repConfig = RepositoryConfig.create(graph, repositoryNode);
+ final Resource repositoryNode = Models.subject(model.filter(null, RDF.TYPE, RepositoryConfigSchema.REPOSITORY)).get();
+ final RepositoryConfig repConfig = RepositoryConfig.create(model, repositoryNode);
repConfig.validate();
-
+
repoman.addRepositoryConfig(repConfig);
-
+
Repository r = repoman.getRepository("RyaAccumuloSail");
r.initialize();
-
+
}
}
-
+
@Test
public void testRyaAccumuloSailInManager() throws Exception {
// Class<SailFactory> clazz = SailFactory.class;
// ServiceLoader<SailFactory> loader = java.util.ServiceLoader.load(clazz, clazz.getClassLoader());
//
// Iterator<SailFactory> services = loader.iterator();
-//
+//
// while (services.hasNext())
// System.out.println(services.next());
-
-
String ryaSailKey = RyaAccumuloSailFactory.SAIL_TYPE;
- assertTrue("Connot find RyaAccumuloSailFactory in Registry", SailRegistry.getInstance().has(ryaSailKey));
+ assertTrue("Cannot find RyaAccumuloSailFactory in Registry", SailRegistry.getInstance().has(ryaSailKey));
- SailFactory factory = SailRegistry.getInstance().get(ryaSailKey);
+ SailFactory factory = SailRegistry.getInstance().get(ryaSailKey).get();
Assert.assertNotNull("Cannot create RyaAccumuloSailFactory", factory);
-
-
+
+
// for (String s : SailRegistry.getInstance().getKeys()) {
// System.out.println("SailRegistry :: " + s);
// }
@@ -186,10 +176,10 @@ public class RyaAccumuloSailFactoryTest {
// RepositoryConfigSchema
// RepositoryProvider.getRepository("RyaAccumuloSail");
}
-
+
@Test
public void testParseTemplate() throws Exception{
- String template = IOUtils.toString(ClassLoader.getSystemResourceAsStream("org/openrdf/repository/config/RyaAccumuloSail.ttl"));
+ String template = IOUtils.toString(ClassLoader.getSystemResourceAsStream("org/eclipse/rdf4j/repository/config/RyaAccumuloSail.ttl"));
ConfigTemplate ct = new ConfigTemplate(template);
System.out.println(ct.getVariableMap());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaMongoDbSailFactoryTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaMongoDbSailFactoryTest.java b/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaMongoDbSailFactoryTest.java
index 6cfd4ea..7e0ff34 100644
--- a/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaMongoDbSailFactoryTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/sail/config/RyaMongoDbSailFactoryTest.java
@@ -21,13 +21,13 @@ package org.apache.rya.sail.config;
import static org.junit.Assert.assertFalse;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
/**
* Tests {@link RyaSailFactory} with a MongoDB backend.
@@ -66,7 +66,7 @@ public class RyaMongoDbSailFactoryTest extends MongoITBase {
conn = repo.getConnection();
final ValueFactory vf = conn.getValueFactory();
- final Statement s = vf.createStatement(vf.createURI("u:a"), vf.createURI("u:b"), vf.createURI("u:c"));
+ final Statement s = vf.createStatement(vf.createIRI("u:a"), vf.createIRI("u:b"), vf.createIRI("u:c"));
assertFalse(conn.hasStatement(s, false));
@@ -97,7 +97,7 @@ public class RyaMongoDbSailFactoryTest extends MongoITBase {
conn = repo.getConnection();
final ValueFactory vf = conn.getValueFactory();
- final Statement s = vf.createStatement(vf.createURI("u:a"), vf.createURI("u:b"), vf.createURI("u:c"));
+ final Statement s = vf.createStatement(vf.createIRI("u:a"), vf.createIRI("u:b"), vf.createIRI("u:c"));
assertFalse(conn.hasStatement(s, false));
@@ -127,7 +127,7 @@ public class RyaMongoDbSailFactoryTest extends MongoITBase {
conn = repo.getConnection();
final ValueFactory vf = conn.getValueFactory();
- final Statement s = vf.createStatement(vf.createURI("u:a"), vf.createURI("u:b"), vf.createURI("u:c"));
+ final Statement s = vf.createStatement(vf.createIRI("u:a"), vf.createIRI("u:b"), vf.createIRI("u:c"));
assertFalse(conn.hasStatement(s, false));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/resources/log4j.properties b/extras/indexing/src/test/resources/log4j.properties
new file mode 100644
index 0000000..8d3f81d
--- /dev/null
+++ b/extras/indexing/src/test/resources/log4j.properties
@@ -0,0 +1,25 @@
+ # 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.
+
+# Root logger option
+log4j.rootLogger=INFO, stdout
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/pom.xml
----------------------------------------------------------------------
diff --git a/extras/indexingExample/pom.xml b/extras/indexingExample/pom.xml
index c339152..5740f08 100644
--- a/extras/indexingExample/pom.xml
+++ b/extras/indexingExample/pom.xml
@@ -74,9 +74,9 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/EntityDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/EntityDirectExample.java b/extras/indexingExample/src/main/java/EntityDirectExample.java
index 5599dcd..2dfae3f 100644
--- a/extras/indexingExample/src/main/java/EntityDirectExample.java
+++ b/extras/indexingExample/src/main/java/EntityDirectExample.java
@@ -17,8 +17,6 @@
* under the License.
*/
-
-
import java.util.List;
import org.apache.accumulo.core.client.AccumuloException;
@@ -27,25 +25,23 @@ import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.commons.lang.Validate;
import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.indexing.accumulo.AccumuloIndexingConfiguration;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
public class EntityDirectExample {
private static final Logger log = Logger.getLogger(EntityDirectExample.class);
@@ -165,6 +161,7 @@ public class EntityDirectExample {
final String sparqlInsert = "PREFIX pref: <http://www.model/pref#> \n"
+ "INSERT DATA {\n" //
+ + "GRAPH <http://updated/test> {\n"
+ "<urn:Bob> a pref:Person ;\n" //
+ " pref:hasProperty1 'property1' ;\n" // one second
+ " pref:hasProperty2 'property2' ;\n" // 2 seconds
@@ -172,7 +169,7 @@ public class EntityDirectExample {
+ "<urn:Fred> a pref:Person ; \n" //
+ " pref:hasProperty4 'property4' ; \n" //
+ " pref:hasProperty5 'property5' ; \n" //
- + "}";
+ + "}}";
final Update update = conn.prepareUpdate(QueryLanguage.SPARQL, sparqlInsert);
update.execute();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/InferenceExamples.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/InferenceExamples.java b/extras/indexingExample/src/main/java/InferenceExamples.java
index 83c3bc0..fa8fb21 100644
--- a/extras/indexingExample/src/main/java/InferenceExamples.java
+++ b/extras/indexingExample/src/main/java/InferenceExamples.java
@@ -35,22 +35,22 @@ import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
import org.apache.zookeeper.ClientCnxn;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/MongoRyaDirectExample.java b/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
index 1744606..cb38494 100644
--- a/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
+++ b/extras/indexingExample/src/main/java/MongoRyaDirectExample.java
@@ -39,33 +39,33 @@ import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
import org.apache.zookeeper.ClientCnxn;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.RepositoryResult;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.common.iteration.Iterations;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.RepositoryResult;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.sail.Sail;
import de.flapdoodle.embed.mongo.config.IMongoConfig;
import de.flapdoodle.embed.mongo.config.Net;
-import info.aduna.iteration.Iterations;
public class MongoRyaDirectExample {
@@ -225,23 +225,24 @@ public class MongoRyaDirectExample {
private static void testAddAndFreeTextSearchWithPCJ(final SailRepositoryConnection conn) throws Exception {
// add data to the repository using the SailRepository add methods
final ValueFactory f = conn.getValueFactory();
- final URI person = f.createURI("http://example.org/ontology/Person");
+ final IRI person = f.createIRI("http://example.org/ontology/Person");
String uuid;
uuid = "urn:people:alice";
- conn.add(f.createURI(uuid), RDF.TYPE, person);
- conn.add(f.createURI(uuid), RDFS.LABEL, f.createLiteral("Alice Palace Hose", f.createURI("xsd:string")));
+ conn.add(f.createIRI(uuid), RDF.TYPE, person);
+ conn.add(f.createIRI(uuid), RDFS.LABEL, f.createLiteral("Alice Palace Hose", f.createIRI("xsd:string")));
- uuid = "urn:people:bobss";
- conn.add(f.createURI(uuid), RDF.TYPE, person);
- conn.add(f.createURI(uuid), RDFS.LABEL, f.createLiteral("Bob Snob Hose", "en"));
+ uuid = "urn:people:bob";
+ conn.add(f.createIRI(uuid), RDF.TYPE, person);
+ conn.add(f.createIRI(uuid), RDFS.LABEL, f.createLiteral("Bob Snob Hose", f.createIRI("xsd:string")));
String queryString;
TupleQuery tupleQuery;
CountingResultHandler tupleHandler;
- // ///////////// search for alice
+
+ // ///////////// search for Palace
queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ "SELECT ?person ?match ?e ?c ?l ?o " //
+ "{" //
@@ -255,7 +256,35 @@ public class MongoRyaDirectExample {
Validate.isTrue(tupleHandler.getCount() == 1);
- // ///////////// search for alice and bob
+ // ///////////// search for Snob
+ queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ + "SELECT ?person ?match ?e ?c ?l ?o " //
+ + "{" //
+ + " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ + " FILTER(fts:text(?match, \"Snob\")) " //
+ + "}";//
+ tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ tupleHandler = new CountingResultHandler();
+ tupleQuery.evaluate(tupleHandler);
+ log.info("Result count : " + tupleHandler.getCount());
+ Validate.isTrue(tupleHandler.getCount() == 1);
+
+
+ // ///////////// search for Hose
+ queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ + "SELECT ?person ?match ?e ?c ?l ?o " //
+ + "{" //
+ + " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ + " FILTER(fts:text(?match, \"Hose\")) " //
+ + "}";//
+ tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ tupleHandler = new CountingResultHandler();
+ tupleQuery.evaluate(tupleHandler);
+ log.info("Result count : " + tupleHandler.getCount());
+ Validate.isTrue(tupleHandler.getCount() == 2);
+
+
+ // ///////////// search for alice
queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ "SELECT ?person ?match " //
+ "{" //
@@ -269,14 +298,15 @@ public class MongoRyaDirectExample {
log.info("Result count : " + tupleHandler.getCount());
Validate.isTrue(tupleHandler.getCount() == 1);
- // ///////////// search for alice and bob
+
+ // ///////////// search for alice and hose
queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ "SELECT ?person ?match " //
+ "{" //
+ " ?person a <http://example.org/ontology/Person> . "//
+ " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ " FILTER(fts:text(?match, \"alice\")) " //
- + " FILTER(fts:text(?match, \"palace\")) " //
+ + " FILTER(fts:text(?match, \"hose\")) " //
+ "}";//
tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
tupleHandler = new CountingResultHandler();
@@ -285,13 +315,13 @@ public class MongoRyaDirectExample {
Validate.isTrue(tupleHandler.getCount() == 1);
- // ///////////// search for bob
+ // ///////////// search for alice or hose
queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ "SELECT ?person ?match ?e ?c ?l ?o " //
+ "{" //
+ " ?person a <http://example.org/ontology/Person> . "//
+ " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
- // this is an or query in mongo, a and query in accumulo
+ // this is an or query in mongo, an and query in accumulo
+ " FILTER(fts:text(?match, \"alice hose\")) " //
+ "}";//
@@ -300,6 +330,56 @@ public class MongoRyaDirectExample {
tupleQuery.evaluate(tupleHandler);
log.info("Result count : " + tupleHandler.getCount());
Validate.isTrue(tupleHandler.getCount() == 2);
+
+
+ // ///////////// search for alice or bob
+ queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ + "SELECT ?person ?match ?e ?c ?l ?o " //
+ + "{" //
+ + " ?person a <http://example.org/ontology/Person> . "//
+ + " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ // this is an or query in mongo, an and query in accumulo
+ + " FILTER(fts:text(?match, \"alice bob\")) " //
+ + "}";//
+
+ tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ tupleHandler = new CountingResultHandler();
+ tupleQuery.evaluate(tupleHandler);
+ log.info("Result count : " + tupleHandler.getCount());
+ Validate.isTrue(tupleHandler.getCount() == 2);
+
+
+ // ///////////// search for alice and bob
+ queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ + "SELECT ?person ?match ?e ?c ?l ?o " //
+ + "{" //
+ + " ?person a <http://example.org/ontology/Person> . "//
+ + " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ + " FILTER(fts:text(?match, \"alice\")) " //
+ + " FILTER(fts:text(?match, \"bob\")) " //
+ + "}";//
+
+ tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ tupleHandler = new CountingResultHandler();
+ tupleQuery.evaluate(tupleHandler);
+ log.info("Result count : " + tupleHandler.getCount());
+ Validate.isTrue(tupleHandler.getCount() == 0);
+
+
+ // ///////////// search for bob
+ queryString = "PREFIX fts: <http://rdf.useekm.com/fts#> "//
+ + "SELECT ?person ?match ?e ?c ?l ?o " //
+ + "{" //
+ + " ?person a <http://example.org/ontology/Person> . "//
+ + " ?person <http://www.w3.org/2000/01/rdf-schema#label> ?match . "//
+ + " FILTER(fts:text(?match, \"bob\")) " //
+ + "}";//
+
+ tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);
+ tupleHandler = new CountingResultHandler();
+ tupleQuery.evaluate(tupleHandler);
+ log.info("Result count : " + tupleHandler.getCount());
+ Validate.isTrue(tupleHandler.getCount() == 1);
}
private static Configuration getConf() throws IOException {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/ProspectorExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/ProspectorExample.java b/extras/indexingExample/src/main/java/ProspectorExample.java
index 383d982..31b61b9 100644
--- a/extras/indexingExample/src/main/java/ProspectorExample.java
+++ b/extras/indexingExample/src/main/java/ProspectorExample.java
@@ -31,12 +31,12 @@ import org.apache.rya.api.persist.RdfEvalStatsDAO.CARDINALITY_OF;
import org.apache.rya.prospector.mr.Prospector;
import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
import org.apache.rya.sail.config.RyaSailFactory;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
import com.google.common.collect.Lists;
@@ -47,18 +47,18 @@ import com.google.common.collect.Lists;
public class ProspectorExample {
private static final Logger log = Logger.getLogger(RyaClientExample.class);
- private static final ValueFactory VALUE_FACTORY = new ValueFactoryImpl();
+ private static final ValueFactory VALUE_FACTORY = SimpleValueFactory.getInstance();
- private static final URI ALICE = VALUE_FACTORY.createURI("urn:alice");
- private static final URI BOB = VALUE_FACTORY.createURI("urn:bob");
- private static final URI CHARLIE = VALUE_FACTORY.createURI("urn:charlie");
+ private static final IRI ALICE = VALUE_FACTORY.createIRI("urn:alice");
+ private static final IRI BOB = VALUE_FACTORY.createIRI("urn:bob");
+ private static final IRI CHARLIE = VALUE_FACTORY.createIRI("urn:charlie");
- private static final URI WORKS_AT = VALUE_FACTORY.createURI("urn:worksAt");
- private static final URI ADMIRES = VALUE_FACTORY.createURI("urn:admires");
- private static final URI LIVES_WITH = VALUE_FACTORY.createURI("urn:livesWith");
+ private static final IRI WORKS_AT = VALUE_FACTORY.createIRI("urn:worksAt");
+ private static final IRI ADMIRES = VALUE_FACTORY.createIRI("urn:admires");
+ private static final IRI LIVES_WITH = VALUE_FACTORY.createIRI("urn:livesWith");
- private static final URI BURGER_JOINT = VALUE_FACTORY.createURI("urn:burgerJoint");
- private static final URI DONUT_SHOP= VALUE_FACTORY.createURI("urn:donutShop");
+ private static final IRI BURGER_JOINT = VALUE_FACTORY.createIRI("urn:burgerJoint");
+ private static final IRI DONUT_SHOP= VALUE_FACTORY.createIRI("urn:donutShop");
public static void main(final String[] args) throws Exception {
setupLogging();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexingExample/src/main/java/RyaClientExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/RyaClientExample.java b/extras/indexingExample/src/main/java/RyaClientExample.java
index 6b39774..1da9628 100644
--- a/extras/indexingExample/src/main/java/RyaClientExample.java
+++ b/extras/indexingExample/src/main/java/RyaClientExample.java
@@ -53,21 +53,20 @@ import org.apache.rya.indexing.pcj.fluo.app.observers.StatementPatternObserver;
import org.apache.rya.indexing.pcj.fluo.app.observers.TripleObserver;
import org.apache.rya.sail.config.RyaSailFactory;
import org.apache.zookeeper.ClientCnxn;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.queryrender.sparql.SPARQLQueryRenderer;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.queryrender.sparql.SPARQLQueryRenderer;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Demonstrates how a {@link RyaClient} may be used to interact with an instance
* of Accumulo to install and manage a Rya instance.
@@ -145,14 +144,14 @@ public class RyaClientExample {
final ValueFactory vf = ryaSail.getValueFactory();
final List<Statement> statements = Lists.newArrayList(
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://talksTo"), vf.createURI("http://Charlie")),
- vf.createStatement(vf.createURI("http://David"), vf.createURI("http://talksTo"), vf.createURI("http://Alice")),
- vf.createStatement(vf.createURI("http://Alice"), vf.createURI("http://worksAt"), vf.createURI("http://CoffeeShop")),
- vf.createStatement(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://CoffeeShop")),
- vf.createStatement(vf.createURI("http://George"), vf.createURI("http://talksTo"), vf.createURI("http://Frank")),
- vf.createStatement(vf.createURI("http://Frank"), vf.createURI("http://worksAt"), vf.createURI("http://CoffeeShop")),
- vf.createStatement(vf.createURI("http://Eve"), vf.createURI("http://talksTo"), vf.createURI("http://Bob")),
- vf.createStatement(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://CoffeeShop")));
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://talksTo"), vf.createIRI("http://Charlie")),
+ vf.createStatement(vf.createIRI("http://David"), vf.createIRI("http://talksTo"), vf.createIRI("http://Alice")),
+ vf.createStatement(vf.createIRI("http://Alice"), vf.createIRI("http://worksAt"), vf.createIRI("http://CoffeeShop")),
+ vf.createStatement(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://CoffeeShop")),
+ vf.createStatement(vf.createIRI("http://George"), vf.createIRI("http://talksTo"), vf.createIRI("http://Frank")),
+ vf.createStatement(vf.createIRI("http://Frank"), vf.createIRI("http://worksAt"), vf.createIRI("http://CoffeeShop")),
+ vf.createStatement(vf.createIRI("http://Eve"), vf.createIRI("http://talksTo"), vf.createIRI("http://Bob")),
+ vf.createStatement(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://CoffeeShop")));
SailConnection ryaConn = ryaSail.getConnection();
log.info("");
[11/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/FluoITBase.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/FluoITBase.java b/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/FluoITBase.java
index 48334d0..18fc1c6 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/FluoITBase.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/FluoITBase.java
@@ -7,26 +7,6 @@
* "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.rya.pcj.fluo.test.base;
-
-/**
- * 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,
@@ -36,6 +16,7 @@ package org.apache.rya.pcj.fluo.test.base;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.pcj.fluo.test.base;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -76,14 +57,14 @@ import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
import org.apache.zookeeper.ClientCnxn;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.junit.Rule;
/**
* Integration tests that ensure the Fluo application processes PCJs results
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/KafkaExportITBase.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/KafkaExportITBase.java b/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/KafkaExportITBase.java
index 465e089..b60b56f 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/KafkaExportITBase.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.test.base/src/main/java/org/apache/rya/pcj/fluo/test/base/KafkaExportITBase.java
@@ -70,12 +70,12 @@ import org.apache.rya.indexing.pcj.fluo.app.query.MetadataCacheSupplier;
import org.apache.rya.indexing.pcj.fluo.app.query.StatementPatternIdCacheSupplier;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/pom.xml b/extras/rya.pcj.fluo/rya.pcj.functions.geo/pom.xml
index dc80206..8b04c61 100644
--- a/extras/rya.pcj.fluo/rya.pcj.functions.geo/pom.xml
+++ b/extras/rya.pcj.fluo/rya.pcj.functions.geo/pom.xml
@@ -47,12 +47,11 @@ under the License.
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-queryalgebra-geosparql</artifactId>
- <version>2.2</version>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-queryalgebra-evaluation</artifactId>
- <version>2.1.6</version>
</dependency>
<!-- Testing dependencies. -->
<dependency>
@@ -91,7 +90,7 @@ under the License.
<configuration>
<excludes>
<!-- Trivial listing of classes to be loaded via SPI -->
- <exclude>src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function</exclude>
+ <exclude>src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function</exclude>
</excludes>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/java/org/apache/rya/indexing/pcj/functions/geo/FunctionAdapter.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/java/org/apache/rya/indexing/pcj/functions/geo/FunctionAdapter.java b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/java/org/apache/rya/indexing/pcj/functions/geo/FunctionAdapter.java
index 2fbe334..8c765e2 100644
--- a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/java/org/apache/rya/indexing/pcj/functions/geo/FunctionAdapter.java
+++ b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/java/org/apache/rya/indexing/pcj/functions/geo/FunctionAdapter.java
@@ -19,13 +19,13 @@
package org.apache.rya.indexing.pcj.functions.geo;
import org.eclipse.rdf4j.model.IRI;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.BooleanLiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.BooleanLiteralImpl;
+import org.eclipse.rdf4j.model.impl.URIImpl;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
/**
* Make a RDF4J Function look like an openRDF Function.
@@ -58,8 +58,8 @@ class FunctionAdapter implements Function {
return valueFactory.createLiteral(((org.eclipse.rdf4j.model.impl.BooleanLiteral) v).booleanValue());
else if (v instanceof org.eclipse.rdf4j.model.Literal) {
org.eclipse.rdf4j.model.Literal vLiteral = (org.eclipse.rdf4j.model.Literal) v;
- org.openrdf.model.URI vType = valueFactory.createURI(vLiteral.getDatatype().stringValue());
- org.openrdf.model.Literal theReturnValue = valueFactory.createLiteral(vLiteral.getLabel(), vType);
+ org.eclipse.rdf4j.model.URI vType = valueFactory.createIRI(vLiteral.getDatatype().stringValue());
+ org.eclipse.rdf4j.model.Literal theReturnValue = valueFactory.createLiteral(vLiteral.getLabel(), vType);
return theReturnValue;
}
//
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
new file mode 100644
index 0000000..ddfb09b
--- /dev/null
+++ b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
@@ -0,0 +1,30 @@
+org.apache.rya.indexing.pcj.functions.geo.DistanceRdf4J
+org.apache.rya.indexing.pcj.functions.geo.ConvexHullRdf4J
+org.apache.rya.indexing.pcj.functions.geo.BoundaryRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EnvelopeRdf4J
+org.apache.rya.indexing.pcj.functions.geo.UnionRdf4J
+org.apache.rya.indexing.pcj.functions.geo.IntersectionRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SymmetricDifferenceRdf4J
+org.apache.rya.indexing.pcj.functions.geo.DifferenceRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RelateRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfDisjointRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfIntersectsRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfTouchesRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfCrossesRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfWithinRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfContainsRdf4J
+org.apache.rya.indexing.pcj.functions.geo.SfOverlapsRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhDisjointRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhMeetRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhOverlapRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhCoversRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhCoveredByRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhInsideRdf4J
+org.apache.rya.indexing.pcj.functions.geo.EhContainsRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8DCRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8ECRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8PORdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8TPPIRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8TPPRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8NTPPRdf4J
+org.apache.rya.indexing.pcj.functions.geo.RCC8NTPPIRdf4J
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
deleted file mode 100644
index ddfb09b..0000000
--- a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
+++ /dev/null
@@ -1,30 +0,0 @@
-org.apache.rya.indexing.pcj.functions.geo.DistanceRdf4J
-org.apache.rya.indexing.pcj.functions.geo.ConvexHullRdf4J
-org.apache.rya.indexing.pcj.functions.geo.BoundaryRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EnvelopeRdf4J
-org.apache.rya.indexing.pcj.functions.geo.UnionRdf4J
-org.apache.rya.indexing.pcj.functions.geo.IntersectionRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SymmetricDifferenceRdf4J
-org.apache.rya.indexing.pcj.functions.geo.DifferenceRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RelateRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfDisjointRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfIntersectsRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfTouchesRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfCrossesRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfWithinRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfContainsRdf4J
-org.apache.rya.indexing.pcj.functions.geo.SfOverlapsRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhDisjointRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhMeetRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhOverlapRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhCoversRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhCoveredByRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhInsideRdf4J
-org.apache.rya.indexing.pcj.functions.geo.EhContainsRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8DCRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8ECRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8PORdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8TPPIRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8TPPRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8NTPPRdf4J
-org.apache.rya.indexing.pcj.functions.geo.RCC8NTPPIRdf4J
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsIT.java b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsIT.java
index f540a2e..2ac9f45 100644
--- a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsIT.java
+++ b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsIT.java
@@ -37,18 +37,18 @@ import org.apache.rya.api.client.accumulo.AccumuloRyaClientFactory;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.collect.Sets;
@@ -87,12 +87,12 @@ public class GeoFunctionsIT extends RyaExportITBase {
" FILTER(ryageo:ehContains(?wkt, \"POLYGON((-77 39, -76 39, -76 38, -77 38, -77 39))\"^^geo:wktLiteral)) " +
"}";
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#feature"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("http://www.opengis.net/ont/geosparql#Feature")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#feature"), vf.createURI("http://www.opengis.net/ont/geosparql#hasGeometry"), vf.createURI("tag:rya.apache.org,2017:ex#test_point")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#test_point"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("http://www.opengis.net/ont/geosparql#Point")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#test_point"), vf.createURI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-77.03524 38.889468)", vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral"))));
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#feature"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("http://www.opengis.net/ont/geosparql#Feature")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#feature"), vf.createIRI("http://www.opengis.net/ont/geosparql#hasGeometry"), vf.createIRI("tag:rya.apache.org,2017:ex#test_point")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#test_point"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("http://www.opengis.net/ont/geosparql#Point")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#test_point"), vf.createIRI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-77.03524 38.889468)", vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral"))));
// Create a Geo function.
final Function geoFunction = new Function() {
@@ -116,9 +116,9 @@ public class GeoFunctionsIT extends RyaExportITBase {
// The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("wkt", vf.createLiteral("Point(-77.03524 38.889468)", vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral")));
- bs.addBinding("feature", vf.createURI("tag:rya.apache.org,2017:ex#feature"));
- bs.addBinding("point", vf.createURI("tag:rya.apache.org,2017:ex#test_point"));
+ bs.addBinding("wkt", vf.createLiteral("Point(-77.03524 38.889468)", vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral")));
+ bs.addBinding("feature", vf.createIRI("tag:rya.apache.org,2017:ex#feature"));
+ bs.addBinding("point", vf.createIRI("tag:rya.apache.org,2017:ex#test_point"));
expectedResults.add(bs);
runTest(sparql, statements, expectedResults);
@@ -141,41 +141,41 @@ public class GeoFunctionsIT extends RyaExportITBase {
" FILTER ( !sameTerm (?cityA, ?cityB) ) " +
"}";
- final ValueFactory vf = new ValueFactoryImpl();
- final URI wktTypeUri = vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral");
- final URI asWKT = vf.createURI("http://www.opengis.net/ont/geosparql#asWKT");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI wktTypeUri = vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral");
+ final IRI asWKT = vf.createIRI("http://www.opengis.net/ont/geosparql#asWKT");
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#dakar"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#dakar2"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#canberra"), asWKT, vf.createLiteral("Point(149.12 -35.31)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#brussels"), asWKT, vf.createLiteral("Point(4.35 50.85)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"), vf.createURI("urn:containedIn"), vf.createLiteral("Europe")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#dakar"), vf.createURI("urn:containedIn"), vf.createLiteral("Africa")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#dakar2"), vf.createURI("urn:containedIn"), vf.createLiteral("Africa")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#brussels"), vf.createURI("urn:containedIn"), vf.createLiteral("Europe")));
-
- // The expected results of the SPARQL query once the PCJ has been computed.l
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#dakar"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#dakar2"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#canberra"), asWKT, vf.createLiteral("Point(149.12 -35.31)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#brussels"), asWKT, vf.createLiteral("Point(4.35 50.85)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"), vf.createIRI("urn:containedIn"), vf.createLiteral("Europe")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#dakar"), vf.createIRI("urn:containedIn"), vf.createLiteral("Africa")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#dakar2"), vf.createIRI("urn:containedIn"), vf.createLiteral("Africa")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#brussels"), vf.createIRI("urn:containedIn"), vf.createLiteral("Europe")));
+
+ // The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#dakar"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#dakar2"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#dakar"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#dakar2"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#dakar2"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#dakar"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#dakar2"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#dakar"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#brussels"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#brussels"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#brussels"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#brussels"));
expectedResults.add(bs);
runTest(sparql, statements, expectedResults);
@@ -209,22 +209,22 @@ public class GeoFunctionsIT extends RyaExportITBase {
"FILTER(geof:sfWithin(?wkt, \"POLYGON((-78 39, -76 39, -76 38, -78 38, -78 39))\"^^geo:wktLiteral)) " +
"}";
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#feature"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("http://www.opengis.net/ont/geosparql#Feature")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#feature"), vf.createURI("http://www.opengis.net/ont/geosparql#hasGeometry"), vf.createURI("tag:rya.apache.org,2017:ex#test_point")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#test_point"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("http://www.opengis.net/ont/geosparql#Point")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#test_point"), vf.createURI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-77.03524 38.889468)", vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral"))),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#skip_point"), vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("http://www.opengis.net/ont/geosparql#Point")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#skip_point"), vf.createURI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-10 10)", vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral"))));
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#feature"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("http://www.opengis.net/ont/geosparql#Feature")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#feature"), vf.createIRI("http://www.opengis.net/ont/geosparql#hasGeometry"), vf.createIRI("tag:rya.apache.org,2017:ex#test_point")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#test_point"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("http://www.opengis.net/ont/geosparql#Point")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#test_point"), vf.createIRI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-77.03524 38.889468)", vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral"))),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#skip_point"), vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("http://www.opengis.net/ont/geosparql#Point")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#skip_point"), vf.createIRI("http://www.opengis.net/ont/geosparql#asWKT"), vf.createLiteral("Point(-10 10)", vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral"))));
// Register geo functions from RDF4J is done automatically via SPI.
// The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("wkt", vf.createLiteral("Point(-77.03524 38.889468)", vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral")));
- bs.addBinding("feature", vf.createURI("tag:rya.apache.org,2017:ex#feature"));
- bs.addBinding("point", vf.createURI("tag:rya.apache.org,2017:ex#test_point"));
+ bs.addBinding("wkt", vf.createLiteral("Point(-77.03524 38.889468)", vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral")));
+ bs.addBinding("feature", vf.createIRI("tag:rya.apache.org,2017:ex#feature"));
+ bs.addBinding("point", vf.createIRI("tag:rya.apache.org,2017:ex#test_point"));
expectedResults.add(bs);
runTest(sparql, statements, expectedResults);
@@ -248,29 +248,29 @@ public class GeoFunctionsIT extends RyaExportITBase {
" FILTER ( !sameTerm (?cityA, ?cityB) ) " +
"}";
- final ValueFactory vf = new ValueFactoryImpl();
- final URI wktTypeUri = vf.createURI("http://www.opengis.net/ont/geosparql#wktLiteral");
- final URI asWKT = vf.createURI("http://www.opengis.net/ont/geosparql#asWKT");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI wktTypeUri = vf.createIRI("http://www.opengis.net/ont/geosparql#wktLiteral");
+ final IRI asWKT = vf.createIRI("http://www.opengis.net/ont/geosparql#asWKT");
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#dakar"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#canberra"), asWKT, vf.createLiteral("Point(149.12 -35.31)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#brussels"), asWKT, vf.createLiteral("Point(4.35 50.85)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"), vf.createURI("urn:containedIn"), vf.createLiteral("Europe")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam2"), vf.createURI("urn:containedIn"), vf.createLiteral("Europe")),
- vf.createStatement(vf.createURI("tag:rya.apache.org,2017:ex#amsterdam2"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)));
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#dakar"), asWKT, vf.createLiteral("Point(-17.45 14.69)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#canberra"), asWKT, vf.createLiteral("Point(149.12 -35.31)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#brussels"), asWKT, vf.createLiteral("Point(4.35 50.85)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"), vf.createIRI("urn:containedIn"), vf.createLiteral("Europe")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam2"), vf.createIRI("urn:containedIn"), vf.createLiteral("Europe")),
+ vf.createStatement(vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam2"), asWKT, vf.createLiteral("Point(4.9 52.37)", wktTypeUri)));
// The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam2"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam2"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("cityA", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam2"));
- bs.addBinding("cityB", vf.createURI("tag:rya.apache.org,2017:ex#amsterdam"));
+ bs.addBinding("cityA", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam2"));
+ bs.addBinding("cityB", vf.createIRI("tag:rya.apache.org,2017:ex#amsterdam"));
expectedResults.add(bs);
runTest(sparql, statements, expectedResults);
@@ -290,14 +290,14 @@ public class GeoFunctionsIT extends RyaExportITBase {
"}";
// create some resources and literals to make statements out of
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final DatatypeFactory dtf = DatatypeFactory.newInstance();
- final URI dtPredUri = vf.createURI("http://www.w3.org/2006/time#inXSDDateTime");
- final URI eventz = vf.createURI("<http://eventz>");
+ final IRI dtPredUri = vf.createIRI("http://www.w3.org/2006/time#inXSDDateTime");
+ final IRI eventz = vf.createIRI("<http://eventz>");
final Set<Statement> statements = Sets.newHashSet(
- vf.createStatement(eventz, vf.createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createURI("<http://www.w3.org/2006/time#Instant>")),
+ vf.createStatement(eventz, vf.createIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), vf.createIRI("<http://www.w3.org/2006/time#Instant>")),
vf.createStatement(eventz, dtPredUri, vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T01:01:01-08:00"))), // 1 second
vf.createStatement(eventz, dtPredUri, vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T04:01:02.000-05:00"))), // 2 seconds
vf.createStatement(eventz, dtPredUri, vf.createLiteral(dtf.newXMLGregorianCalendar("2001-01-01T01:01:03-08:00"))), // 3 seconds
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsTest.java b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsTest.java
index f73fa8f..7ed6246 100644
--- a/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsTest.java
+++ b/extras/rya.pcj.fluo/rya.pcj.functions.geo/src/test/java/org/apache/rya/indexing/pcj/functions/geo/GeoFunctionsTest.java
@@ -26,9 +26,9 @@ import java.util.HashSet;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.zookeeper.ClientCnxn;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
/**
* Verifies that the geoFunctions are registered via SPI.
@@ -45,7 +45,7 @@ public class GeoFunctionsTest {
/**
* Thirty-some functions are registered via SPI. Make sure they are registered.
* This file lists functions to load:
- * src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
+ * src/main/resources/META-INF/services/ org.eclipse.rdf4j.query.algebra.evaluation.function.Function
*/
@Test
public void verifySpiLoadedGeoFunctions() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAO.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAO.java b/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAO.java
index e9a2ccc..382266b 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAO.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAO.java
@@ -19,8 +19,6 @@ package org.apache.rya.joinselect;
* under the License.
*/
-
-
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
@@ -30,13 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.rya.accumulo.AccumuloRdfUtils;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.layout.TableLayoutStrategy;
-import org.apache.rya.api.persist.RdfDAOException;
-import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
@@ -50,22 +41,24 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.apache.rya.accumulo.AccumuloRdfUtils;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.layout.TableLayoutStrategy;
+import org.apache.rya.api.persist.RdfDAOException;
+import org.apache.rya.api.persist.RdfEvalStatsDAO;
+import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
-
-
-
-
public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTripleStoreConfiguration> {
private boolean initialized = false;
@@ -76,7 +69,7 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
private boolean denormalized = false;
private int FullTableCardinality = 0;
private static final String DELIM = "\u0000";
- private Map<String,Long> joinMap = new HashMap<String,Long>();;
+ private Map<String,Long> joinMap = new HashMap<String,Long>();
private RdfEvalStatsDAO<RdfCloudTripleStoreConfiguration> resd;
@Override
@@ -458,13 +451,6 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
-
-
-
-
-
-
-
// obtains cardinality for StatementPattern. Returns cardinality of 0
// if no instances of constants occur in table.
@@ -475,9 +461,9 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
Var subjectVar = sp.getSubjectVar();
Resource subj = (Resource) getConstantValue(subjectVar);
Var predicateVar = sp.getPredicateVar();
- URI pred = (URI) getConstantValue(predicateVar);
+ IRI pred = (IRI) getConstantValue(predicateVar);
Var objectVar = sp.getObjectVar();
- org.openrdf.model.Value obj = getConstantValue(objectVar);
+ org.eclipse.rdf4j.model.Value obj = getConstantValue(objectVar);
Resource context = (Resource) getConstantValue(sp.getContextVar());
/**
@@ -492,7 +478,7 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
}
try {
if (subj != null) {
- List<org.openrdf.model.Value> values = new ArrayList<org.openrdf.model.Value>();
+ List<org.eclipse.rdf4j.model.Value> values = new ArrayList<org.eclipse.rdf4j.model.Value>();
CARDINALITY_OF card = RdfEvalStatsDAO.CARDINALITY_OF.SUBJECT;
values.add(subj);
@@ -514,7 +500,7 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
cardinality = 0;
}
} else if (pred != null) {
- List<org.openrdf.model.Value> values = new ArrayList<org.openrdf.model.Value>();
+ List<org.eclipse.rdf4j.model.Value> values = new ArrayList<org.eclipse.rdf4j.model.Value>();
CARDINALITY_OF card = RdfEvalStatsDAO.CARDINALITY_OF.PREDICATE;
values.add(pred);
@@ -531,7 +517,7 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
cardinality = 0;
}
} else if (obj != null) {
- List<org.openrdf.model.Value> values = new ArrayList<org.openrdf.model.Value>();
+ List<org.eclipse.rdf4j.model.Value> values = new ArrayList<org.eclipse.rdf4j.model.Value>();
values.add(obj);
double evalCard = this.getCardinality(conf, RdfEvalStatsDAO.CARDINALITY_OF.OBJECT, values, context);
if (evalCard >= 0) {
@@ -550,18 +536,18 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
return (long) cardinality;
}
- private org.openrdf.model.Value getConstantValue(Var var) {
+ private org.eclipse.rdf4j.model.Value getConstantValue(Var var) {
if (var != null)
return var.getValue();
else
return null;
}
- public double getCardinality(RdfCloudTripleStoreConfiguration conf, CARDINALITY_OF card, List<org.openrdf.model.Value> val) throws RdfDAOException {
+ public double getCardinality(RdfCloudTripleStoreConfiguration conf, CARDINALITY_OF card, List<org.eclipse.rdf4j.model.Value> val) throws RdfDAOException {
return resd.getCardinality(conf, card, val);
}
- public double getCardinality(RdfCloudTripleStoreConfiguration conf, CARDINALITY_OF card, List<org.openrdf.model.Value> val, Resource context) throws RdfDAOException {
+ public double getCardinality(RdfCloudTripleStoreConfiguration conf, CARDINALITY_OF card, List<org.eclipse.rdf4j.model.Value> val, Resource context) throws RdfDAOException {
return resd.getCardinality(conf, card, val, context);
@@ -613,7 +599,7 @@ public class AccumuloSelectivityEvalDAO implements SelectivityEvalDAO<RdfCloudTr
- private static class SpExternalCollector extends QueryModelVisitorBase<RuntimeException> {
+ private static class SpExternalCollector extends AbstractQueryModelVisitor<RuntimeException> {
private List<QueryModelNode> eSet = Lists.newArrayList();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/CardinalityCalcUtil.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/CardinalityCalcUtil.java b/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/CardinalityCalcUtil.java
index c0453ba..c836ac9 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/CardinalityCalcUtil.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/joinselect/CardinalityCalcUtil.java
@@ -19,14 +19,12 @@ package org.apache.rya.joinselect;
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.List;
import org.apache.accumulo.core.data.Key;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
public class CardinalityCalcUtil {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/IndexWorkPlan.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/IndexWorkPlan.java b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/IndexWorkPlan.java
index 77955e4..db99523 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/IndexWorkPlan.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/IndexWorkPlan.java
@@ -33,7 +33,7 @@ import org.apache.rya.prospector.domain.IndexEntry;
import org.apache.rya.prospector.domain.IntermediateProspect;
import org.apache.rya.prospector.mr.ProspectorCombiner;
import org.apache.rya.prospector.mr.ProspectorMapper;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* Contains the methods that perform each of the Map Reduce functions that result
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
index f408b7d..251c784 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
@@ -53,8 +53,8 @@ import org.apache.rya.prospector.domain.TripleValueType;
import org.apache.rya.prospector.plans.IndexWorkPlan;
import org.apache.rya.prospector.utils.CustomEntry;
import org.apache.rya.prospector.utils.ProspectorUtils;
-import org.openrdf.model.util.URIUtil;
-import org.openrdf.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.model.util.URIUtil;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
/**
* An implementation of {@link IndexWorkPlan} that counts the number of times
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/main/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAO.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAO.java b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAO.java
index 3e45781..95e9f19 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAO.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAO.java
@@ -37,8 +37,8 @@ import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.prospector.domain.IndexEntry;
import org.apache.rya.prospector.domain.TripleValueType;
import org.apache.rya.prospector.utils.ProspectorConstants;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
/**
* An ${@link org.apache.rya.api.persist.RdfEvalStatsDAO} that uses the Prospector Service underneath return counts.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAOTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAOTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAOTest.java
index 25b0dc3..8e58894 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAOTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/AccumuloSelectivityEvalDAOTest.java
@@ -19,8 +19,6 @@ package org.apache.rya.joinselect;
* under the License.
*/
-
-
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayList;
@@ -29,13 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
-import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
-import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
@@ -54,15 +45,20 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
+import org.apache.rya.api.persist.RdfEvalStatsDAO;
+import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectProspectOutputTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectProspectOutputTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectProspectOutputTest.java
index a698676..25e3bce 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectProspectOutputTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectProspectOutputTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya.joinselect.mr;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,24 +16,17 @@ package org.apache.rya.joinselect.mr;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
+package org.apache.rya.joinselect.mr;
import java.io.IOException;
-import org.apache.rya.joinselect.mr.JoinSelectProspectOutput;
-import org.apache.rya.joinselect.mr.utils.CardinalityType;
-import org.apache.rya.joinselect.mr.utils.CompositeType;
-import org.apache.rya.joinselect.mr.utils.TripleCard;
-
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
-import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mrunit.mapreduce.MapDriver;
+import org.apache.rya.joinselect.mr.utils.CardinalityType;
+import org.apache.rya.joinselect.mr.utils.CompositeType;
+import org.apache.rya.joinselect.mr.utils.TripleCard;
import org.junit.Test;
public class JoinSelectProspectOutputTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
index eac7aab..96f2685 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/mr/ProspectorTest.java
@@ -45,8 +45,8 @@ import org.apache.rya.prospector.domain.IndexEntry;
import org.apache.rya.prospector.domain.TripleValueType;
import org.apache.rya.prospector.service.ProspectorService;
import org.apache.rya.prospector.utils.ProspectorConstants;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.collect.Lists;
@@ -239,7 +239,7 @@ public class ProspectorTest {
* debugging the test.
*/
private void debugTable(Connector connector, String table) throws TableNotFoundException {
- final Iterator<Entry<Key, Value>> it = connector.createScanner(table, new Authorizations(new String[]{"U", "FOUO"})).iterator();
+ final Iterator<Entry<Key, Value>> it = connector.createScanner(table, new Authorizations("U", "FOUO")).iterator();
while(it.hasNext()) {
final Entry<Key, Value> entry = it.next();
System.out.println( entry );
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
index f048742..b94ed8d 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/prospector/service/ProspectorServiceEvalStatsDAOTest.java
@@ -43,11 +43,11 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
import org.apache.rya.api.persist.RdfEvalStatsDAO.CARDINALITY_OF;
import org.apache.rya.prospector.mr.Prospector;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
/**
* Tests that show when the {@link Prospector} job is run, the
@@ -55,6 +55,7 @@ import org.openrdf.model.vocabulary.XMLSchema;
* information from the prospect table.
*/
public class ProspectorServiceEvalStatsDAOTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testCount() throws Exception {
@@ -95,19 +96,19 @@ public class ProspectorServiceEvalStatsDAOTest {
// Get the cardinality of the 'urn:gem#pred' predicate.
List<Value> values = new ArrayList<Value>();
- values.add( new URIImpl("urn:gem#pred") );
+ values.add( VF.createIRI("urn:gem#pred") );
double count = evalDao.getCardinality(rdfConf, CARDINALITY_OF.PREDICATE, values);
assertEquals(4.0, count, 0.001);
// Get the cardinality of the 'mydata1' object.
values = new ArrayList<Value>();
- values.add( new LiteralImpl("mydata1"));
+ values.add( VF.createLiteral("mydata1"));
count = evalDao.getCardinality(rdfConf, RdfEvalStatsDAO.CARDINALITY_OF.OBJECT, values);
assertEquals(1.0, count, 0.001);
// Get the cardinality of the 'mydata3' object.
values = new ArrayList<Value>();
- values.add( new LiteralImpl("mydata3"));
+ values.add( VF.createLiteral("mydata3"));
count = evalDao.getCardinality(rdfConf, RdfEvalStatsDAO.CARDINALITY_OF.OBJECT, values);
assertEquals(-1.0, count, 0.001);
}
@@ -151,19 +152,19 @@ public class ProspectorServiceEvalStatsDAOTest {
// Get the cardinality of the 'urn:gem#pred' predicate.
List<Value> values = new ArrayList<Value>();
- values.add( new URIImpl("urn:gem#pred"));
+ values.add( VF.createIRI("urn:gem#pred"));
double count = evalDao.getCardinality(rdfConf, RdfEvalStatsDAO.CARDINALITY_OF.PREDICATE, values);
assertEquals(4.0, count, 0.001);
// Get the cardinality of the 'mydata1' object.
values = new ArrayList<Value>();
- values.add( new LiteralImpl("mydata1"));
+ values.add( VF.createLiteral("mydata1"));
count = evalDao.getCardinality(rdfConf, RdfEvalStatsDAO.CARDINALITY_OF.OBJECT, values);
assertEquals(1.0, count, 0.001);
// Get the cardinality of the 'mydata3' object.
values = new ArrayList<Value>();
- values.add( new LiteralImpl("mydata3"));
+ values.add( VF.createLiteral("mydata3"));
count = evalDao.getCardinality(rdfConf, RdfEvalStatsDAO.CARDINALITY_OF.OBJECT, values);
assertEquals(-1.0, count, 0.001);
}
@@ -173,7 +174,7 @@ public class ProspectorServiceEvalStatsDAOTest {
* debugging the test.
*/
private void debugTable(Connector connector, String table) throws TableNotFoundException {
- final Iterator<Entry<Key, org.apache.accumulo.core.data.Value>> it = connector.createScanner(table, new Authorizations(new String[]{"U", "FOUO"})).iterator();
+ final Iterator<Entry<Key, org.apache.accumulo.core.data.Value>> it = connector.createScanner(table, new Authorizations("U", "FOUO")).iterator();
while(it.hasNext()) {
System.out.println( it.next() );
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/README.md
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/README.md b/extras/rya.reasoning/README.md
index 533c903..812542d 100644
--- a/extras/rya.reasoning/README.md
+++ b/extras/rya.reasoning/README.md
@@ -668,12 +668,12 @@ processType(fact):
The main reasoning logic is located in **org.apache.rya.reasoning**, while MapReduce
tools and utilities for interacting with Accumulo are located in
**org.apache.rya.reasoning.mr**. Reasoning logic makes use of RDF constructs in the
-**org.openrdf.model** API, in particular: Statement, URI, Resource, and Value.
+**org.eclipse.rdf4j.model** API, in particular: Statement, URI, Resource, and Value.
### org.apache.rya.reasoning
- **OWL2**:
- In general, the Sesame/openrdf API is used to represent RDF constructs and
+ In general, the RDF4J API is used to represent RDF constructs and
refer to the RDF, RDFS, and OWL vocabularies. However, the API only covers
OWL 1 constructs. The OWL2 class contains static URIs for new OWL 2
vocabulary resources: owl:IrreflexiveProperty, owl:propertyDisjointWith,
@@ -710,7 +710,7 @@ tools and utilities for interacting with Accumulo are located in
- An **OwlProperty** or **OwlClass** represents a property or a class, respectively.
Each object holds a reference to the RDF entity that identifies it (using to
- the openrdf api): a URI for each OwlProperty, and a Resource for each class
+ the RDF4J api): a URI for each OwlProperty, and a Resource for each class
(because a class is more general; it can be a URI or a bnode).
Both maintain connections to other schema constructs, according to the
@@ -850,7 +850,7 @@ output/input, takes in `<Fact, NullWritable>` or `<Derivation, NullWritable>`).
jobs (using those parameters).
- **ResourceWritable**:
- WritableComparable wrapper for org.openrdf.model.Resource, so it can be used as
+ WritableComparable wrapper for org.eclipse.rdf4j.model.Resource, so it can be used as
a key/value in MapReduce tasks. Also contains an integer field to enable
arbitrary secondary sort. Provides static classes **PrimaryComparator** to use
the Resource alone, and **SecondaryComparator** to use resource followed by key.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/pom.xml b/extras/rya.reasoning/pom.xml
index 864cac8..44042bc 100644
--- a/extras/rya.reasoning/pom.xml
+++ b/extras/rya.reasoning/pom.xml
@@ -62,22 +62,22 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-rdfxml</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-rdfxml</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
index 22a277e..75313a2 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/AbstractReasoner.java
@@ -22,9 +22,9 @@ package org.apache.rya.reasoning;
import java.util.HashSet;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
/**
* Abstract class for reasoning in the neighborhood of a particular resource.
@@ -162,7 +162,7 @@ public abstract class AbstractReasoner {
* @param rule The specific rule rule that yielded the inference
* @param source One (might be the only) fact used in the derivation
*/
- protected Fact triple(Resource s, URI p, Value o, OwlRule rule,
+ protected Fact triple(Resource s, IRI p, Value o, OwlRule rule,
Fact source) {
Fact fact = new Fact(s, p, o, this.currentIteration,
rule, this.node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Derivation.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Derivation.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Derivation.java
index d2eb547..ae8e6da 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Derivation.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Derivation.java
@@ -27,12 +27,11 @@ import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
-import org.apache.rya.reasoning.mr.ResourceWritable;
-
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableUtils;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Value;
+import org.apache.rya.reasoning.mr.ResourceWritable;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
/**
* Represents the derivation of a fact.
@@ -133,7 +132,7 @@ public class Derivation implements WritableComparable<Derivation>, Cloneable {
* in any step of the derivation.
*/
public boolean hasSourceNode(Value v) {
- return v instanceof Resource && sourceNodes.contains((Resource) v);
+ return v instanceof Resource && sourceNodes.contains(v);
}
/**
@@ -284,11 +283,8 @@ public class Derivation implements WritableComparable<Derivation>, Cloneable {
|| (rule != null && !rule.equals(other.rule))) {
return false;
}
- if ((sources == null && other.sources != null)
- || (sources != null && !sources.equals(other.sources))) {
- return false;
- }
- return true;
+ return (sources != null || other.sources == null)
+ && (sources == null || sources.equals(other.sources));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Fact.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Fact.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Fact.java
index e168f5a..ad0ba14 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Fact.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/Fact.java
@@ -24,25 +24,24 @@ import java.io.DataOutput;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import org.apache.hadoop.io.WritableComparable;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.resolver.RyaToRdfConversions;
-
-import org.apache.hadoop.io.WritableComparable;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
/**
* Represents a fact used and/or generated by the reasoner.
*/
public class Fact implements WritableComparable<Fact>, Cloneable {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
Statement triple;
// If this is a derived fact:
@@ -71,17 +70,17 @@ public class Fact implements WritableComparable<Fact>, Cloneable {
/**
* A fact containing a triple and no generating rule.
*/
- public Fact(Resource s, URI p, Value o) {
- this.triple = new StatementImpl(s, p, o);
+ public Fact(Resource s, IRI p, Value o) {
+ this.triple = VF.createStatement(s, p, o);
}
/**
* A fact which contains a triple and was generated using a
* particular rule by a reasoner for a particular node.
*/
- public Fact(Resource s, URI p, Value o, int iteration,
+ public Fact(Resource s, IRI p, Value o, int iteration,
OwlRule rule, Resource node) {
- this.triple = new StatementImpl(s, p, o);
+ this.triple = VF.createStatement(s, p, o);
this.derivation = new Derivation(iteration, rule, node);
}
@@ -98,7 +97,7 @@ public class Fact implements WritableComparable<Fact>, Cloneable {
}
}
- public URI getPredicate() {
+ public IRI getPredicate() {
if (triple == null) {
return null;
}
@@ -211,7 +210,7 @@ public class Fact implements WritableComparable<Fact>, Cloneable {
}
else {
Resource s = getSubject();
- URI p = getPredicate();
+ IRI p = getPredicate();
Value o = getObject();
sb.append("<").append(s.toString()).append(">").append(sep);
sb.append("<").append(p.toString()).append(">").append(sep);
@@ -293,17 +292,17 @@ public class Fact implements WritableComparable<Fact>, Cloneable {
in.readFully(tripleBytes);
String tripleString = new String(tripleBytes, StandardCharsets.UTF_8);
String[] parts = tripleString.split(SEP);
- ValueFactory factory = ValueFactoryImpl.getInstance();
+ ValueFactory factory = SimpleValueFactory.getInstance();
String context = parts[0];
Resource s = null;
- URI p = factory.createURI(parts[2]);
+ IRI p = factory.createIRI(parts[2]);
Value o = null;
// Subject: either bnode or URI
if (parts[1].startsWith("_")) {
s = factory.createBNode(parts[1].substring(2));
}
else {
- s = factory.createURI(parts[1]);
+ s = factory.createIRI(parts[1]);
}
// Object: literal, bnode, or URI
if (parts[3].startsWith("_")) {
@@ -325,20 +324,20 @@ public class Fact implements WritableComparable<Fact>, Cloneable {
o = factory.createLiteral(label, lang);
}
else if (data.startsWith("^^<")) {
- o = factory.createLiteral(label, factory.createURI(
+ o = factory.createLiteral(label, factory.createIRI(
data.substring(3, data.length() - 1)));
}
}
}
else {
- o = factory.createURI(parts[3]);
+ o = factory.createIRI(parts[3]);
}
// Create a statement with or without context
if (context.isEmpty()) {
- triple = new StatementImpl(s, p, o);
+ triple = VF.createStatement(s, p, o);
}
else {
- triple = new ContextStatementImpl(s, p, o, factory.createURI(context));
+ triple = VF.createStatement(s, p, o, factory.createIRI(context));
}
}
useful = in.readBoolean();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
index 13a21c4..921d0cf 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/LocalReasoner.java
@@ -25,12 +25,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
/**
* Perform reasoning with respect to a particular node, given a global schema.
@@ -112,7 +112,7 @@ public class LocalReasoner extends AbstractReasoner {
}
// Otherwise, consider the semantics of the statement:
Resource subject = fact.getSubject();
- URI predURI = fact.getPredicate();
+ IRI predURI = fact.getPredicate();
Value object = fact.getObject();
boolean relevantToSubject = false;
boolean relevantToObject = false;
@@ -185,7 +185,7 @@ public class LocalReasoner extends AbstractReasoner {
return Relevance.NONE;
}
// Otherwise, consider the semantics of the statement:
- URI predURI = fact.getPredicate();
+ IRI predURI = fact.getPredicate();
Value object = fact.getObject();
boolean relevantToSubject = false;
boolean relevantToObject = false;
@@ -289,9 +289,9 @@ public class LocalReasoner extends AbstractReasoner {
TypeReasoner types;
// Keep track of statements whose properties might make them relevant later
- Map<URI, List<Fact>> transitiveIncoming = new HashMap<>();
- Map<URI, List<Fact>> asymmetricIncoming = new HashMap<>();
- Map<URI, List<Fact>> disjointOutgoing = new HashMap<>();
+ Map<IRI, List<Fact>> transitiveIncoming = new HashMap<>();
+ Map<IRI, List<Fact>> asymmetricIncoming = new HashMap<>();
+ Map<IRI, List<Fact>> disjointOutgoing = new HashMap<>();
// Only combine transitive paths of a certain size, based on the current
// iteration, to avoid duplicate derivations and unnecessary memory use.
@@ -326,7 +326,7 @@ public class LocalReasoner extends AbstractReasoner {
*/
public void processFact(Fact fact) {
Resource subject = fact.getSubject();
- URI pred = fact.getPredicate();
+ IRI pred = fact.getPredicate();
Value object = fact.getObject();
// Whether this is a recursive call on a fact that's just been inferred
boolean recursive = fact.getIteration() == currentIteration;
@@ -360,11 +360,11 @@ public class LocalReasoner extends AbstractReasoner {
* Process a triple in which this node is the subject.
*/
private void processOutgoing(Fact fact) {
- URI predURI = fact.getPredicate();
+ IRI predURI = fact.getPredicate();
Value object = fact.getObject();
OwlProperty prop = schema.getProperty(predURI);
Set<Resource> restrictions = prop.getRestrictions();
- Set<URI> disjointProps = prop.getDisjointProperties();
+ Set<IRI> disjointProps = prop.getDisjointProperties();
// RL rule prp-dom: Apply domain(s), if appropriate
for (Resource type : prop.getDomain()) {
types.processType(type, OwlRule.PRP_DOM, fact);
@@ -374,7 +374,7 @@ public class LocalReasoner extends AbstractReasoner {
// if the input fact was derived using this rule, we must have gotten
// all the superproperties and don't need to apply them again.
if (!fact.hasRule(OwlRule.PRP_SPO1)) {
- for (URI superProp : prop.getSuperProperties()) {
+ for (IRI superProp : prop.getSuperProperties()) {
// (everything is its own superproperty)
if (superProp.equals(predURI)) {
continue;
@@ -384,7 +384,7 @@ public class LocalReasoner extends AbstractReasoner {
}
// RL rule prp-pdw: Check if this conflicts with any disjoint properties
if (!disjointProps.isEmpty()) {
- for (URI disjointProp : disjointProps) {
+ for (IRI disjointProp : disjointProps) {
if (disjointOutgoing.containsKey(disjointProp)) {
for (Fact other : disjointOutgoing.get(disjointProp)) {
if (object.equals(other.getObject())) {
@@ -474,14 +474,14 @@ public class LocalReasoner extends AbstractReasoner {
*/
private void processIncoming(Fact fact) {
Resource subject = fact.getSubject();
- URI predURI = fact.getPredicate();
+ IRI predURI = fact.getPredicate();
OwlProperty prop = schema.getProperty(predURI);
// RL rule prp-rng: Apply range(s), if appropriate
for (Resource type : prop.getRange()) {
types.processType(type, OwlRule.PRP_RNG, fact);
}
// RL rules prp-inv1, prp-inv2: assert any inverse properties
- for (URI inverseProp : prop.getInverseProperties()) {
+ for (IRI inverseProp : prop.getInverseProperties()) {
collect(triple(node, inverseProp, subject, OwlRule.PRP_INV, fact));
}
// RL rule prp-symp: Assert the symmetric statement if appropriate
@@ -583,10 +583,10 @@ public class LocalReasoner extends AbstractReasoner {
int sumOutgoingDisjoint = 0;
int sumIncomingTransitive = 0;
for (List<Fact> l : asymmetricIncoming.values()) {
- sumIncomingAsymmetric += l.size();;
+ sumIncomingAsymmetric += l.size();
}
for (List<Fact> l : disjointOutgoing.values()) {
- sumOutgoingDisjoint += l.size();;
+ sumOutgoingDisjoint += l.size();
}
int maxTransitiveSpan = (int) Math.pow(2, currentIteration);
int[] distribution = new int[maxTransitiveSpan+1];
@@ -632,10 +632,10 @@ public class LocalReasoner extends AbstractReasoner {
public int getNumStored() {
int total = 0;
for (List<Fact> l : asymmetricIncoming.values()) {
- total += l.size();;
+ total += l.size();
}
for (List<Fact> l : disjointOutgoing.values()) {
- total += l.size();;
+ total += l.size();
}
for (List<Fact> l : transitiveIncoming.values()) {
total += l.size();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OWL2.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OWL2.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OWL2.java
index a24e8e8..eeab8b0 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OWL2.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OWL2.java
@@ -19,20 +19,20 @@ package org.apache.rya.reasoning;
* under the License.
*/
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
/**
- * Some useful OWL 2 URIs not in Sesame API.
+ * Some useful OWL 2 URIs not in RDF4J API.
*/
public class OWL2 {
- private static URI uri(String local) {
- return ValueFactoryImpl.getInstance().createURI(OWL.NAMESPACE, local);
+ private static IRI uri(String local) {
+ return SimpleValueFactory.getInstance().createIRI(OWL.NAMESPACE, local);
}
- public static final URI ASYMMETRICPROPERTY = uri("AsymmetricProperty");
- public static final URI IRREFLEXIVEPROPERTY = uri("IrreflexiveProperty");
- public static final URI PROPERTYDISJOINTWITH = uri("propertyDisjointWith");
- public static final URI ONCLASS = uri("onClass");
- public static final URI MAXQUALIFIEDCARDINALITY = uri("maxQualifiedCardinality");
+ public static final IRI ASYMMETRICPROPERTY = uri("AsymmetricProperty");
+ public static final IRI IRREFLEXIVEPROPERTY = uri("IrreflexiveProperty");
+ public static final IRI PROPERTYDISJOINTWITH = uri("propertyDisjointWith");
+ public static final IRI ONCLASS = uri("onClass");
+ public static final IRI MAXQUALIFIEDCARDINALITY = uri("maxQualifiedCardinality");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
index 6da82ac..c3c60a8 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlClass.java
@@ -23,10 +23,10 @@ import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
/**
* Contains all the schema information we might need about a class.
@@ -318,8 +318,8 @@ public class OwlClass implements Serializable {
/**
* Get the onProperty relation(s) for this property restriction.
*/
- public Set<URI> getOnProperty() {
- Set<URI> onp = new HashSet<>();
+ public Set<IRI> getOnProperty() {
+ Set<IRI> onp = new HashSet<>();
for (OwlProperty prop : properties) {
onp.add(prop.getURI());
}
@@ -411,9 +411,9 @@ public class OwlClass implements Serializable {
* is a subproperty of the other's.
*/
boolean onSubProperty(OwlClass other) {
- Set<URI> otherProp = other.getOnProperty();
+ Set<IRI> otherProp = other.getOnProperty();
for (OwlProperty prop : this.properties) {
- Set<URI> intersection = prop.getSuperProperties();
+ Set<IRI> intersection = prop.getSuperProperties();
intersection.retainAll(otherProp);
if (!intersection.isEmpty()) {
return true;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
----------------------------------------------------------------------
diff --git a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
index 5443d7d..e745532 100644
--- a/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
+++ b/extras/rya.reasoning/src/main/java/org/apache/rya/reasoning/OwlProperty.java
@@ -23,8 +23,8 @@ import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
/**
* Contains all the schema information we might need about a property.
@@ -65,7 +65,7 @@ import org.openrdf.model.URI;
public class OwlProperty implements Serializable {
private static final long serialVersionUID = 1L;
- private URI uri;
+ private IRI uri;
// Boolean qualities the property might have
private boolean transitive = false;
@@ -87,7 +87,7 @@ public class OwlProperty implements Serializable {
// Restrictions on this property
private Set<OwlClass> restrictions = new HashSet<OwlClass>();
- OwlProperty(URI uri) {
+ OwlProperty(IRI uri) {
this.uri = uri;
}
@@ -115,7 +115,7 @@ public class OwlProperty implements Serializable {
}
boolean addRestriction(OwlClass r) { return restrictions.add(r); }
- public void setURI(URI uri) { this.uri = uri; }
+ public void setURI(IRI uri) { this.uri = uri; }
void setTransitive() { transitive = true; }
void setSymmetric() { symmetric = true; }
void setAsymmetric() { asymmetric = true; }
@@ -123,7 +123,7 @@ public class OwlProperty implements Serializable {
void setInverseFunctional() { inverseFunctional = true; }
void setIrreflexive() { irreflexive = true; }
- public URI getURI() { return uri; }
+ public IRI getURI() { return uri; }
public boolean isTransitive() { return transitive; }
public boolean isSymmetric() { return symmetric; }
public boolean isAsymmetric() { return asymmetric; }
@@ -185,8 +185,8 @@ public class OwlProperty implements Serializable {
/**
* Get all the superproperties of this subproperty.
*/
- public Set<URI> getSuperProperties() {
- Set<URI> ancestors = new HashSet<>();
+ public Set<IRI> getSuperProperties() {
+ Set<IRI> ancestors = new HashSet<>();
for (OwlProperty ancestor : superProperties) {
ancestors.add(ancestor.uri);
}
@@ -199,8 +199,8 @@ public class OwlProperty implements Serializable {
* Get all the equivalent properties for this property.
* Apply RL rules scm-op and scm-dp: Every property is its own equivalent.
*/
- public Set<URI> getEquivalentProperties() {
- Set<URI> equivalents = new HashSet<>();
+ public Set<IRI> getEquivalentProperties() {
+ Set<IRI> equivalents = new HashSet<>();
for (OwlProperty other : superProperties) {
if (other.superProperties.contains(this)) {
equivalents.add(other.uri);
@@ -214,8 +214,8 @@ public class OwlProperty implements Serializable {
/**
* Get all properties declared disjoint with this one.
*/
- public Set<URI> getDisjointProperties() {
- Set<URI> disjoint = new HashSet<>();
+ public Set<IRI> getDisjointProperties() {
+ Set<IRI> disjoint = new HashSet<>();
for (OwlProperty other : disjointProperties) {
disjoint.add(other.uri);
}
@@ -225,8 +225,8 @@ public class OwlProperty implements Serializable {
/**
* Get all properties declared inverse of this one.
*/
- public Set<URI> getInverseProperties() {
- Set<URI> inverse = new HashSet<>();
+ public Set<IRI> getInverseProperties() {
+ Set<IRI> inverse = new HashSet<>();
for (OwlProperty other : inverseProperties) {
inverse.add(other.uri);
}
[29/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegmentMatcher.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegmentMatcher.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegmentMatcher.java
index 8f4e43a..6c5167b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegmentMatcher.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegmentMatcher.java
@@ -24,8 +24,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -38,7 +38,6 @@ import com.google.common.base.Preconditions;
* the QueryModelNodes in the JoinSegment.
*
*/
-
public class JoinSegmentMatcher<T extends ExternalSet> extends AbstractExternalSetMatcher<T> {
private ExternalSetConverter<T> converter;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/MatcherUtilities.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/MatcherUtilities.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/MatcherUtilities.java
index 1f8e287..7c6a20a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/MatcherUtilities.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/MatcherUtilities.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,30 +17,12 @@
* under the License.
*/
package org.apache.rya.indexing.external.matching;
-/*
- * 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.
- */
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
public class MatcherUtilities {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegment.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegment.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegment.java
index 6f3d409..9d79708 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegment.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegment.java
@@ -27,13 +27,13 @@ import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegmentMatcher.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegmentMatcher.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegmentMatcher.java
index a359d02..cc1b9d9 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegmentMatcher.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/OptionalJoinSegmentMatcher.java
@@ -24,8 +24,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
@@ -37,7 +37,6 @@ import com.google.common.base.Preconditions;
* OptionalJoinSegment and ordered to match the ExternalSet query.
*
*/
-
public class OptionalJoinSegmentMatcher<T extends ExternalSet> extends AbstractExternalSetMatcher<T> {
private ExternalSetConverter<T> converter;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeConsolidator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeConsolidator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeConsolidator.java
index 9a2d3be..faf5c27 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeConsolidator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeConsolidator.java
@@ -27,9 +27,9 @@ import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeListRater.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeListRater.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeListRater.java
index e8b1553..7953661 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeListRater.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodeListRater.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,28 +17,10 @@
* under the License.
*/
package org.apache.rya.indexing.external.matching;
-/*
- * 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.
- */
import java.util.List;
-import org.openrdf.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
/**
* Class used for determining an optimal query plan. It assigns a score
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodesToTupleExpr.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodesToTupleExpr.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodesToTupleExpr.java
index 5bffb63..93dc80d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodesToTupleExpr.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QueryNodesToTupleExpr.java
@@ -24,11 +24,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegment.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegment.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegment.java
index a8f687e..ca492d7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegment.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegment.java
@@ -23,9 +23,9 @@ import java.util.List;
import java.util.Set;
import org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
/**
* A QuerySegment represents a subset of a query to be compared to ExternalSets for
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegmentFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegmentFactory.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegmentFactory.java
index 0c1eb7e..9d1d3fe 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegmentFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/QuerySegmentFactory.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,30 +17,12 @@
* under the License.
*/
package org.apache.rya.indexing.external.matching;
-/*
- * 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.
- */
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/TopOfQueryFilterRelocator.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/TopOfQueryFilterRelocator.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/TopOfQueryFilterRelocator.java
index 6ebbe39..ada8329 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/TopOfQueryFilterRelocator.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/TopOfQueryFilterRelocator.java
@@ -24,11 +24,11 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Class consisting of a single utility method for relocating filters.
@@ -73,7 +73,7 @@ public class TopOfQueryFilterRelocator {
}
- static class ProjectionAndFilterGatherer extends QueryModelVisitorBase<RuntimeException> {
+ static class ProjectionAndFilterGatherer extends AbstractQueryModelVisitor<RuntimeException> {
Set<ValueExpr> filterCond = new HashSet<>();
Projection projection;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSet.java
index f1d56b8..20f5768 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/AccumuloIndexSet.java
@@ -44,6 +44,7 @@ import org.apache.rya.accumulo.pcj.iterators.IteratorCombiner;
import org.apache.rya.accumulo.pcj.iterators.PCJKeyToCrossProductBindingSetIterator;
import org.apache.rya.accumulo.pcj.iterators.PCJKeyToJoinBindingSetIterator;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.utils.IteratorWrapper;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.pcj.matching.PCJOptimizerUtilities;
@@ -55,18 +56,19 @@ import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingS
import org.apache.rya.indexing.pcj.storage.accumulo.PcjTables;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
-import org.openrdf.model.Value;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.BindingImpl;
-import org.openrdf.query.parser.ParsedTupleQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.SimpleBinding;
+import org.eclipse.rdf4j.query.parser.ParsedTupleQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
@@ -77,8 +79,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
-import info.aduna.iteration.CloseableIteration;
-
/**
* During query planning, this node is inserted into the parsed query to
* represent part of the original query (a sub-query). This sub-query is the
@@ -290,7 +290,7 @@ public class AccumuloIndexSet extends ExternalTupleSet implements
}
final List<BindingSet> crossProductBs = new ArrayList<>();
- final Map<String, org.openrdf.model.Value> constantConstraints = new HashMap<>();
+ final Map<String, Value> constantConstraints = new HashMap<>();
final Set<Range> hashJoinRanges = new HashSet<>();
final Range EMPTY_RANGE = new Range("", true, "~", false);
Range crossProductRange = EMPTY_RANGE;
@@ -546,8 +546,8 @@ public class AccumuloIndexSet extends ExternalTupleSet implements
final QueryBindingSet constants = new QueryBindingSet();
for (final String s : keys) {
- if (s.startsWith("-const-")) {
- constants.addBinding(new BindingImpl(s, getConstantValueMap()
+ if (VarNameUtils.isConstant(s)) {
+ constants.addBinding(new SimpleBinding(s, getConstantValueMap()
.get(s)));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ExternalTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ExternalTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ExternalTupleSet.java
index 48dc17e..e029114 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ExternalTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ExternalTupleSet.java
@@ -18,24 +18,22 @@ package org.apache.rya.indexing.external.tupleSet;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
@@ -58,12 +56,16 @@ import com.google.common.collect.Sets;
public abstract class ExternalTupleSet extends ExternalSet {
public static final String VAR_ORDER_DELIM = ";";
- public static final String CONST_PREFIX = "-const-";
+ /**
+ * @deprecated use {@link VarNameUtils#CONSTANT_PREFIX}.
+ */
+ @Deprecated
+ public static final String CONST_PREFIX = VarNameUtils.CONSTANT_PREFIX;
public static final String VALUE_DELIM = "\u0000";
private Projection tupleExpr;
private Map<String, String> tableVarMap = Maps.newHashMap(); //maps vars in tupleExpr to var in stored binding sets
private Map<String, Set<String>> supportedVarOrders = Maps.newHashMap(); //indicates supported var orders
- private Map<String, org.openrdf.model.Value> valMap;
+ private Map<String, Value> valMap;
public ExternalTupleSet() {
}
@@ -134,7 +136,7 @@ public abstract class ExternalTupleSet extends ExternalSet {
return supportedVarOrders;
}
- public Map<String, org.openrdf.model.Value> getConstantValueMap() {
+ public Map<String, Value> getConstantValueMap() {
return valMap;
}
@@ -166,7 +168,7 @@ public abstract class ExternalTupleSet extends ExternalSet {
if (bindingNames.contains(s)) {
bNames.add(s);
bNamesWithConstants.add(s);
- } else if(s.startsWith(CONST_PREFIX)) {
+ } else if(VarNameUtils.isConstant(s)) {
bNamesWithConstants.add(s);
}
}
@@ -202,7 +204,7 @@ public abstract class ExternalTupleSet extends ExternalSet {
*/
private void updateSupportedVarOrderMap() {
- Preconditions.checkArgument(supportedVarOrders.size() != 0);;
+ Preconditions.checkArgument(supportedVarOrders.size() != 0);
final Map<String, Set<String>> newSupportedOrders = Maps.newHashMap();
final BiMap<String, String> biMap = HashBiMap.create(tableVarMap)
.inverse();
@@ -262,11 +264,7 @@ public abstract class ExternalTupleSet extends ExternalSet {
return false;
} else {
final ExternalTupleSet arg = (ExternalTupleSet) other;
- if (this.getTupleExpr().equals(arg.getTupleExpr())) {
- return true;
- } else {
- return false;
- }
+ return this.getTupleExpr().equals(arg.getTupleExpr());
}
}
@@ -277,7 +275,7 @@ public abstract class ExternalTupleSet extends ExternalSet {
return result;
}
- private Map<String, org.openrdf.model.Value> getValMap() {
+ private Map<String, Value> getValMap() {
ValueMapVisitor valMapVis = new ValueMapVisitor();
tupleExpr.visit(valMapVis);
return valMapVis.getValMap();
@@ -290,16 +288,16 @@ public abstract class ExternalTupleSet extends ExternalSet {
* create binding sets from range scan
*/
private class ValueMapVisitor extends
- QueryModelVisitorBase<RuntimeException> {
- Map<String, org.openrdf.model.Value> valMap = Maps.newHashMap();
+ AbstractQueryModelVisitor<RuntimeException> {
+ Map<String, Value> valMap = Maps.newHashMap();
- public Map<String, org.openrdf.model.Value> getValMap() {
+ public Map<String, Value> getValMap() {
return valMap;
}
@Override
public void meet(Var node) {
- if (node.getName().startsWith("-const-")) {
+ if (VarNameUtils.isConstant(node.getName())) {
valMap.put(node.getName(), node.getValue());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtil.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtil.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtil.java
index 98d61e7..3c43808 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtil.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/ParsedQueryUtil.java
@@ -22,15 +22,15 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.concurrent.atomic.AtomicReference;
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
import com.google.common.base.Optional;
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
+
/**
* Utilities that help applications inspect {@link ParsedQuery} objects.
*/
@@ -49,7 +49,7 @@ public class ParsedQueryUtil {
// When a projection is encountered for the requested index, store it in atomic reference and quit searching.
final AtomicReference<Projection> projectionRef = new AtomicReference<>();
- query.getTupleExpr().visit(new QueryModelVisitorBase<RuntimeException>() {
+ query.getTupleExpr().visit(new AbstractQueryModelVisitor<RuntimeException>() {
@Override
public void meet(Projection projection) {
projectionRef.set(projection);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSet.java
index 02d0a58..cef49db 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/tupleSet/SimpleExternalTupleSet.java
@@ -21,14 +21,12 @@ package org.apache.rya.indexing.external.tupleSet;
import java.util.ArrayList;
import java.util.List;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelVisitor;
-
import com.google.common.base.Joiner;
-
-import info.aduna.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
/**
* This a testing class to create mock pre-computed join nodes in order to
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
index 1c4c2fa..36839b3 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
@@ -39,10 +39,11 @@ import org.apache.rya.mongodb.batch.MongoDbBatchWriterConfig;
import org.apache.rya.mongodb.batch.MongoDbBatchWriterException;
import org.apache.rya.mongodb.batch.MongoDbBatchWriterUtils;
import org.apache.rya.mongodb.batch.collection.DbCollectionType;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.mongodb.DB;
import com.mongodb.DBCollection;
@@ -51,8 +52,6 @@ import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.QueryBuilder;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Secondary Indexer using MondoDB
* @param <T> - The {@link AbstractMongoIndexingStorageStrategy} this indexer uses.
@@ -68,7 +67,7 @@ public abstract class AbstractMongoIndexer<T extends IndexingMongoDBStorageStrat
protected String dbName;
protected DB db;
protected DBCollection collection;
- protected Set<URI> predicates;
+ protected Set<IRI> predicates;
protected T storageStrategy;
@@ -129,7 +128,7 @@ public abstract class AbstractMongoIndexer<T extends IndexingMongoDBStorageStrat
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return predicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/IndexingMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/IndexingMongoDBStorageStrategy.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/IndexingMongoDBStorageStrategy.java
index eebc7b7..dd7d47d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/IndexingMongoDBStorageStrategy.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/IndexingMongoDBStorageStrategy.java
@@ -21,14 +21,12 @@ package org.apache.rya.indexing.mongodb;
import java.util.Set;
-import org.openrdf.model.URI;
-
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
import com.mongodb.QueryBuilder;
-
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.mongodb.dao.SimpleMongoDBStorageStrategy;
+import org.eclipse.rdf4j.model.IRI;
public class IndexingMongoDBStorageStrategy extends SimpleMongoDBStorageStrategy {
public DBObject getQuery(final StatementConstraints contraints) {
@@ -38,9 +36,9 @@ public class IndexingMongoDBStorageStrategy extends SimpleMongoDBStorageStrategy
}
if (contraints.hasPredicates()){
- final Set<URI> predicates = contraints.getPredicates();
+ final Set<IRI> predicates = contraints.getPredicates();
if (predicates.size() > 1){
- for (final URI pred : predicates){
+ for (final IRI pred : predicates){
final DBObject currentPred = new BasicDBObject(PREDICATE, pred.toString());
queryBuilder.or(currentPred);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
index a50d293..f392b5e 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
@@ -40,8 +40,8 @@ import org.apache.rya.indexing.smarturi.SmartUriAdapter;
import org.apache.rya.indexing.smarturi.SmartUriException;
import org.apache.rya.indexing.smarturi.SmartUriStorage;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
import com.mongodb.MongoClient;
import com.mongodb.MongoException;
@@ -64,10 +64,10 @@ public class MongoDbSmartUri implements SmartUriStorage {
}
@Override
- public void storeEntity(final RyaURI subject, final Map<URI, Value> map) throws SmartUriException {
+ public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException {
checkInit();
- final URI uri = SmartUriAdapter.serializeUri(subject, map);
+ final IRI uri = SmartUriAdapter.serializeUri(subject, map);
final Entity entity = SmartUriAdapter.deserializeUriEntity(uri);
// Create it.
@@ -116,7 +116,7 @@ public class MongoDbSmartUri implements SmartUriStorage {
}
@Override
- public ConvertingCursor<TypedEntity> queryEntity(final Type type, final Map<URI, Value> map) throws SmartUriException {
+ public ConvertingCursor<TypedEntity> queryEntity(final Type type, final Map<IRI, Value> map) throws SmartUriException {
checkInit();
// Query it.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
index ebdb914..3ccdc9a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoIndexingConfiguration.java
@@ -29,7 +29,7 @@ import org.apache.rya.indexing.mongodb.temporal.MongoTemporalIndexer;
import org.apache.rya.mongodb.AbstractMongoDBRdfConfigurationBuilder;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoDBRdfConfigurationBuilder;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.sail.Sail;
import com.google.common.base.Preconditions;
@@ -44,7 +44,7 @@ import com.google.common.base.Preconditions;
public class MongoIndexingConfiguration extends MongoDBRdfConfiguration {
private MongoIndexingConfiguration() {
- };
+ }
private MongoIndexingConfiguration(final Configuration conf) {
super(conf);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/freetext/MongoFreeTextIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/freetext/MongoFreeTextIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/freetext/MongoFreeTextIndexer.java
index 913a4fd..f13e4c1 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/freetext/MongoFreeTextIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/freetext/MongoFreeTextIndexer.java
@@ -25,13 +25,12 @@ import org.apache.rya.indexing.FreeTextIndexer;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.mongodb.AbstractMongoIndexer;
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.mongodb.QueryBuilder;
-import info.aduna.iteration.CloseableIteration;
-
public class MongoFreeTextIndexer extends AbstractMongoIndexer<TextMongoDBStorageStrategy> implements FreeTextIndexer {
private static final String COLLECTION_SUFFIX = "freetext";
private static final Logger logger = Logger.getLogger(MongoFreeTextIndexer.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjIndexSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjIndexSetProvider.java
index d3fa07e..274651f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjIndexSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjIndexSetProvider.java
@@ -31,7 +31,7 @@ import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjDocuments;
import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjStorage;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjQueryNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjQueryNode.java
index c03ee99..265158a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjQueryNode.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/pcj/MongoPcjQueryNode.java
@@ -36,13 +36,14 @@ import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjDocuments;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedTupleQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedTupleQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
@@ -51,7 +52,6 @@ import com.google.common.base.Strings;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* Indexing Node for PCJs expressions to be inserted into execution plans.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/temporal/MongoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/temporal/MongoTemporalIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/temporal/MongoTemporalIndexer.java
index fe8a7fa..653844f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/temporal/MongoTemporalIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/temporal/MongoTemporalIndexer.java
@@ -29,15 +29,14 @@ import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInterval;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.mongodb.AbstractMongoIndexer;
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.google.common.annotations.VisibleForTesting;
import com.mongodb.DBCollection;
import com.mongodb.QueryBuilder;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Indexes MongoDB based on time instants or intervals.
*/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizer.java
index 8067a85..adc8a52 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizer.java
@@ -37,14 +37,13 @@ import org.apache.rya.indexing.mongodb.pcj.MongoPcjIndexSetProvider;
import org.apache.rya.indexing.pcj.matching.provider.AbstractPcjIndexSetProvider;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-
-import com.google.common.base.Optional;;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import com.google.common.base.Optional;
/**
* {@link QueryOptimizer} which matches {@link TupleExpr}s associated with
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilities.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilities.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilities.java
index 09a2706..274a053 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilities.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilities.java
@@ -27,21 +27,21 @@ import java.util.Set;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.QueryVariableNormalizer.VarCollector;
-import org.openrdf.query.algebra.Difference;
-import org.openrdf.query.algebra.EmptySet;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Intersection;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.VarNameCollector;
+import org.eclipse.rdf4j.query.algebra.Difference;
+import org.eclipse.rdf4j.query.algebra.EmptySet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Intersection;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.VarNameCollector;
import com.google.common.collect.Sets;
@@ -114,7 +114,7 @@ public class PCJOptimizerUtilities {
return visitor.node;
}
- static class ProjectionVisitor extends QueryModelVisitorBase<RuntimeException> {
+ static class ProjectionVisitor extends AbstractQueryModelVisitor<RuntimeException> {
Projection node = null;
@@ -155,7 +155,7 @@ public class PCJOptimizerUtilities {
*
*/
private static class ValidQueryVisitor extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
private boolean isValid = true;
private final Set<QueryModelNode> filterSet = Sets.newHashSet();
@@ -232,7 +232,7 @@ public class PCJOptimizerUtilities {
*/
protected static class FilterRelocator extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
protected Filter filter;
protected Set<String> filterVars;
@@ -356,7 +356,7 @@ public class PCJOptimizerUtilities {
return lj.containsLeftJoin;
}
- protected static class LeftJoinVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected static class LeftJoinVisitor extends AbstractQueryModelVisitor<RuntimeException> {
boolean containsLeftJoin = false;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJToSegmentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJToSegmentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJToSegmentConverter.java
index 5744f41..4495bed 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJToSegmentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/PCJToSegmentConverter.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,35 +17,17 @@
* under the License.
*/
package org.apache.rya.indexing.pcj.matching;
-/*
- * 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.
- */
import org.apache.rya.indexing.external.matching.ExternalSetConverter;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.external.matching.OptionalJoinSegment;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.base.Preconditions;
@@ -75,11 +57,11 @@ public class PCJToSegmentConverter implements ExternalSetConverter<ExternalTuple
* specified PCJ.
*
*/
- static class PCJToJoinSegment extends QueryModelVisitorBase<RuntimeException> {
+ static class PCJToJoinSegment extends AbstractQueryModelVisitor<RuntimeException> {
private JoinSegment<ExternalTupleSet> segment;
- private PCJToJoinSegment(){};
+ private PCJToJoinSegment(){}
public QuerySegment<ExternalTupleSet> getSegment(final ExternalTupleSet pcj) {
segment = null;
@@ -103,11 +85,11 @@ public class PCJToSegmentConverter implements ExternalSetConverter<ExternalTuple
* This class extracts the {@link OptionalJoinSegment} of PCJ query.
*
*/
- static class PCJToOptionalJoinSegment extends QueryModelVisitorBase<RuntimeException> {
+ static class PCJToOptionalJoinSegment extends AbstractQueryModelVisitor<RuntimeException> {
private OptionalJoinSegment<ExternalTupleSet> segment;
- private PCJToOptionalJoinSegment(){};
+ private PCJToOptionalJoinSegment(){}
public QuerySegment<ExternalTupleSet> getSegment(final ExternalTupleSet pcj) {
segment = null;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/QueryVariableNormalizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/QueryVariableNormalizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/QueryVariableNormalizer.java
index 2ed66c4..b2ed8d7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/QueryVariableNormalizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/QueryVariableNormalizer.java
@@ -18,8 +18,6 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -29,20 +27,19 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.NAryValueOperator;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.NAryValueOperator;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -72,7 +69,7 @@ public class QueryVariableNormalizer {
// if tuples are equal, no need to do anything
if (tuple1.equals(tuple2)) {
- tupleList.add((TupleExpr) tuple1.clone());
+ tupleList.add(tuple1.clone());
return tupleList;
}
@@ -399,11 +396,7 @@ public class QueryVariableNormalizer {
if ((vars1.get(i) instanceof ValueConstant) && (vars2.get(i) instanceof Var)) {
ValueConstant vc = (ValueConstant) vars1.get(i);
- String s = vc.getValue().toString();
- if(vc.getValue() instanceof Literal) {
- s = s.substring(1, s.length() - 1);
- }
- s = "-const-" + s;
+ final String s = VarNameUtils.createUniqueConstVarName(vc.getValue());
varList1.add(s);
varList2.add(((Var)vars2.get(i)).getName());
} else if(!(vars1.get(i) instanceof ValueConstant)){
@@ -482,10 +475,7 @@ public class QueryVariableNormalizer {
return false;
} else {
- if (hMap.get(key).equals(val)) {
- return true;
- } else
- return false;
+ return hMap.get(key).equals(val);
}
@@ -728,7 +718,7 @@ public class QueryVariableNormalizer {
- public static class ValueMapVisitor extends QueryModelVisitorBase<Exception> {
+ public static class ValueMapVisitor extends AbstractQueryModelVisitor<Exception> {
private Map<String, Value> valMap = Maps.newHashMap();
@@ -749,13 +739,7 @@ public class QueryVariableNormalizer {
public void meet(ValueConstant val) {
- String s = val.getValue().toString();
-
- if (val.getValue() instanceof Literal) {
- s = s.substring(1, s.length() - 1);
- }
-
- s = "-const-" + s;
+ final String s = VarNameUtils.createUniqueConstVarName(val.getValue());
valMap.put(s, val.getValue());
}
@@ -767,7 +751,7 @@ public class QueryVariableNormalizer {
- public static class NodeCollector extends QueryModelVisitorBase<Exception> {
+ public static class NodeCollector extends AbstractQueryModelVisitor<Exception> {
private List<QueryModelNode> nodes = Lists.newArrayList();
@@ -784,11 +768,10 @@ public class QueryVariableNormalizer {
}
- public static class SpVarReNamer extends QueryModelVisitorBase<RuntimeException> {
+ public static class SpVarReNamer extends AbstractQueryModelVisitor<RuntimeException> {
private final HashMap<String, String> hMap;
private Map<String, Value> valMap;
- private final ValueFactoryImpl vf = new ValueFactoryImpl();
public SpVarReNamer(HashMap<String, String> hMap, Map<String, Value> valMap) {
this.valMap = valMap;
@@ -798,7 +781,7 @@ public class QueryVariableNormalizer {
public void meet(Var var) {
if (!var.isConstant() && hMap.containsKey(var.getName())) {
String val = hMap.get(var.getName());
- if (val.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(val)) {
var.setName(val);
var.setValue(valMap.get(val));
var.setAnonymous(true); //TODO this might be a hack -- when are Vars not anonymous?
@@ -813,11 +796,10 @@ public class QueryVariableNormalizer {
- public static class FilterVarReNamer extends QueryModelVisitorBase<RuntimeException> {
+ public static class FilterVarReNamer extends AbstractQueryModelVisitor<RuntimeException> {
private final HashMap<String, String> hMap;
private Map<String, Value> valMap;
- private final ValueFactoryImpl vf = new ValueFactoryImpl();
public FilterVarReNamer(HashMap<String, String> hMap, Map<String, Value> valMap) {
this.valMap = valMap;
@@ -830,7 +812,7 @@ public class QueryVariableNormalizer {
if (!(var.getParentNode() instanceof NAryValueOperator)) {
if (!var.isConstant() && hMap.containsKey(var.getName())) {
String val = hMap.get(var.getName());
- if (val.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(val)) {
var.replaceWith(new ValueConstant(valMap.get(val)));
} else {
var.setName(val);
@@ -852,7 +834,7 @@ public class QueryVariableNormalizer {
Var var = (Var) v;
if (!(var.isConstant() && hMap.containsKey(var.getName()))) {
String val = hMap.get(var.getName());
- if (val.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(val)) {
newValues.add(new ValueConstant(valMap.get(val)));
} else {
var.setName(val);
@@ -874,7 +856,7 @@ public class QueryVariableNormalizer {
- public static class TupleVarRenamer extends QueryModelVisitorBase<RuntimeException> {
+ public static class TupleVarRenamer extends AbstractQueryModelVisitor<RuntimeException> {
private final HashMap<String, String> varChanges;
private Map<String, Value> valMap;
@@ -918,7 +900,7 @@ public class QueryVariableNormalizer {
}
- public static class VarCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class VarCollector extends AbstractQueryModelVisitor<RuntimeException> {
public static List<String> process(QueryModelNode node) {
VarCollector collector = new VarCollector();
@@ -952,7 +934,7 @@ public class QueryVariableNormalizer {
}
}
- public static class FilterVarValueCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class FilterVarValueCollector extends AbstractQueryModelVisitor<RuntimeException> {
public static List<QueryModelNode> process(QueryModelNode node) {
FilterVarValueCollector collector = new FilterVarValueCollector();
@@ -986,7 +968,7 @@ public class QueryVariableNormalizer {
- public static class NormalizeQueryVisitor extends QueryModelVisitorBase<Exception> {
+ public static class NormalizeQueryVisitor extends AbstractQueryModelVisitor<Exception> {
private TreeMap<String, List<QueryModelNode>> map = new TreeMap<String, List<QueryModelNode>>();
private TreeMap<String, Integer> varMap = new TreeMap<String, Integer>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AbstractPcjIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AbstractPcjIndexSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AbstractPcjIndexSetProvider.java
index 984153a..b5dddbd 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AbstractPcjIndexSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AbstractPcjIndexSetProvider.java
@@ -34,7 +34,7 @@ import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizerUtilities;
import org.apache.rya.indexing.pcj.matching.PCJToSegmentConverter;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.annotations.VisibleForTesting;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AccumuloIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AccumuloIndexSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AccumuloIndexSetProvider.java
index 1fa3677..96ee75c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AccumuloIndexSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/pcj/matching/provider/AccumuloIndexSetProvider.java
@@ -41,9 +41,9 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageExce
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.PcjTableNameFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.PcjTables;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.sail.SailException;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
index f637d0d..b6fe556 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
@@ -41,12 +41,13 @@ import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.joda.time.DateTime;
import org.joda.time.format.ISODateTimeFormat;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
import com.google.common.base.Charsets;
import com.google.common.collect.HashBiMap;
@@ -60,8 +61,9 @@ import com.google.common.primitives.Longs;
* Interface for serializing and deserializing Smart URIs.
*/
public class SmartUriAdapter {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String ENTITY_TYPE_MAP_URN = "urn://entityTypeMap";
- private static final URI RYA_TYPES_URI = new URIImpl("urn://ryaTypes");
+ private static final IRI RYA_TYPES_URI = VF.createIRI("urn://ryaTypes");
/**
* Private constructor to prevent instantiation.
@@ -69,12 +71,12 @@ public class SmartUriAdapter {
private SmartUriAdapter() {
}
- private static URI createTypePropertiesUri(final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties) throws SmartUriException {
+ private static IRI createTypePropertiesUri(final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> typeProperty : typeProperties.entrySet()) {
final RyaURI type = typeProperty.getKey();
final Map<RyaURI, Property> propertyMap = typeProperty.getValue();
- final URI typeUri = createIndividualTypeWithPropertiesUri(type, propertyMap);
+ final IRI typeUri = createIndividualTypeWithPropertiesUri(type, propertyMap);
final String keyString = type.getDataType().getLocalName();
final String valueString = typeUri.getLocalName();
nameValuePairs.add(new BasicNameValuePair(keyString, valueString));
@@ -92,24 +94,24 @@ public class SmartUriAdapter {
throw new SmartUriException("Unable to create type properties for the Smart URI", e);
}
- return new URIImpl(uriString);
+ return VF.createIRI(uriString);
}
private static String getShortNameForType(final RyaURI type) throws SmartUriException {
- final String shortName = new URIImpl(type.getData()).getLocalName();
+ final String shortName = VF.createIRI(type.getData()).getLocalName();
return shortName;
}
private static String addTypePrefixToUri(final String uriString, final String typePrefix) {
- final String localName = new URIImpl(uriString).getLocalName();
+ final String localName = VF.createIRI(uriString).getLocalName();
final String beginning = StringUtils.removeEnd(uriString, localName);
final String formattedUriString = beginning + typePrefix + localName;
return formattedUriString;
}
private static String removeTypePrefixFromUri(final String uriString, final String typePrefix) {
- final String localName = new URIImpl(uriString).getLocalName();
+ final String localName = VF.createIRI(uriString).getLocalName();
final String beginning = StringUtils.removeEnd(uriString, localName);
final String replacement = localName.replaceFirst(typePrefix + ".", "");
final String formattedUriString = beginning + replacement;
@@ -125,7 +127,7 @@ public class SmartUriAdapter {
return map;
}
- private static URI createTypeMapUri(final List<RyaURI> types) throws SmartUriException {
+ private static IRI createTypeMapUri(final List<RyaURI> types) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
for (final RyaURI type : types) {
final String shortName = getShortNameForType(type);
@@ -144,10 +146,10 @@ public class SmartUriAdapter {
throw new SmartUriException("Unable to create type properties for the Smart URI", e);
}
- return new URIImpl(uriString);
+ return VF.createIRI(uriString);
}
- private static Map<RyaURI, String> convertUriToTypeMap(final URI typeMapUri) throws SmartUriException {
+ private static Map<RyaURI, String> convertUriToTypeMap(final IRI typeMapUri) throws SmartUriException {
final Map<RyaURI, String> map = new HashMap<>();
java.net.URI uri;
try {
@@ -168,14 +170,14 @@ public class SmartUriAdapter {
return map;
}
- private static URI createIndividualTypeWithPropertiesUri(final RyaURI type, final Map<RyaURI, Property> map) throws SmartUriException {
+ private static IRI createIndividualTypeWithPropertiesUri(final RyaURI type, final Map<RyaURI, Property> map) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
for (final Entry<RyaURI, Property> entry : map.entrySet()) {
final RyaURI key = entry.getKey();
final Property property = entry.getValue();
final RyaType ryaType = property.getValue();
- final String keyString = (new URIImpl(key.getData())).getLocalName();
+ final String keyString = (VF.createIRI(key.getData())).getLocalName();
final Value value = RyaToRdfConversions.convertValue(ryaType);
final String valueString = value.stringValue();
nameValuePairs.add(new BasicNameValuePair(keyString, valueString));
@@ -188,24 +190,24 @@ public class SmartUriAdapter {
try {
final java.net.URI uri = uriBuilder.build();
final String queryString = uri.getRawSchemeSpecificPart();
- uriString = type.getData()/*new URIImpl(type.getData()).getLocalName()*/ + queryString;
+ uriString = type.getData()/*VF.createIRI(type.getData()).getLocalName()*/ + queryString;
} catch (final URISyntaxException e) {
throw new SmartUriException("Unable to create type URI with all its properties for the Smart URI", e);
}
- return new URIImpl(uriString);
+ return VF.createIRI(uriString);
}
- private static Entity convertMapToEntity(final RyaURI subject, final Map<RyaURI, Map<URI, Value>> map) {
+ private static Entity convertMapToEntity(final RyaURI subject, final Map<RyaURI, Map<IRI, Value>> map) {
final Entity.Builder entityBuilder = Entity.builder();
entityBuilder.setSubject(subject);
- for (final Entry<RyaURI, Map<URI, Value>> typeEntry : map.entrySet()) {
+ for (final Entry<RyaURI, Map<IRI, Value>> typeEntry : map.entrySet()) {
final RyaURI type = typeEntry.getKey();
- final Map<URI, Value> subMap = typeEntry.getValue();
+ final Map<IRI, Value> subMap = typeEntry.getValue();
entityBuilder.setExplicitType(type);
- for (final Entry<URI, Value> entry : subMap.entrySet()) {
- final URI uri = entry.getKey();
+ for (final Entry<IRI, Value> entry : subMap.entrySet()) {
+ final IRI uri = entry.getKey();
final Value value = entry.getValue();
final RyaURI ryaUri = new RyaURI(uri.stringValue());
final RyaURI ryaName = new RyaURI(uri.stringValue());
@@ -218,7 +220,7 @@ public class SmartUriAdapter {
return entity;
}
- public static RyaURI findSubject(final URI uri) throws SmartUriException {
+ public static RyaURI findSubject(final IRI uri) throws SmartUriException {
final String uriString = uri.stringValue();
return findSubject(uriString);
}
@@ -256,18 +258,18 @@ public class SmartUriAdapter {
/**
- * Serializes an {@link Entity} into a Smart {@link URI}.
+ * Serializes an {@link Entity} into a Smart {@link IRI}.
* @param entity the {@link Entity} to serialize into a Smart URI.
- * @return the Smart {@link URI}.
+ * @return the Smart {@link IRI}.
* @throws SmartUriException
*/
- public static URI serializeUriEntity(final Entity entity) throws SmartUriException {
- final Map<URI, Value> objectMap = new LinkedHashMap<>();
+ public static IRI serializeUriEntity(final Entity entity) throws SmartUriException {
+ final Map<IRI, Value> objectMap = new LinkedHashMap<>();
// Adds the entity's types to the Smart URI
final List<RyaURI> typeIds = entity.getExplicitTypeIds();
final Map<RyaURI, String> ryaTypeMap = createTypeMap(typeIds);
- final URI ryaTypeMapUri = createTypeMapUri(typeIds);
+ final IRI ryaTypeMapUri = createTypeMapUri(typeIds);
final RyaType valueRyaType = new RyaType(XMLSchema.ANYURI, ryaTypeMapUri.stringValue());
final Value typeValue = RyaToRdfConversions.convertValue(valueRyaType);
objectMap.put(RYA_TYPES_URI, typeValue);
@@ -285,7 +287,7 @@ public class SmartUriAdapter {
final String valueString = property.getValue().getData();
final RyaType ryaType = property.getValue();
- //final RyaType ryaType = new RyaType(new URIImpl(key.getData()), valueString);
+ //final RyaType ryaType = new RyaType(VF.createIRI(key.getData()), valueString);
final Value value = RyaToRdfConversions.convertValue(ryaType);
@@ -293,7 +295,7 @@ public class SmartUriAdapter {
if (StringUtils.isNotBlank(typeShortName)) {
formattedKey = addTypePrefixToUri(formattedKey, typeShortName);
}
- final URI uri = new URIImpl(formattedKey);
+ final IRI uri = VF.createIRI(formattedKey);
objectMap.put(uri, value);
}
}
@@ -305,11 +307,11 @@ public class SmartUriAdapter {
* Serializes a map into a URI.
* @param subject the {@link RyaURI} subject of the Entity. Identifies the
* thing that is being represented as an Entity.
- * @param map the {@link Map} of {@link URI}s to {@link Value}s.
- * @return the Smart {@link URI}.
+ * @param map the {@link Map} of {@link IRI}s to {@link Value}s.
+ * @return the Smart {@link IRI}.
* @throws SmartUriException
*/
- public static URI serializeUri(final RyaURI subject, final Map<URI, Value> map) throws SmartUriException {
+ public static IRI serializeUri(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException {
final String subjectData = subject.getData();
final int fragmentPosition = subjectData.indexOf("#");
String prefix = subjectData;
@@ -331,15 +333,15 @@ public class SmartUriAdapter {
}
final List<NameValuePair> nameValuePairs = new ArrayList<>();
- for (final Entry<URI, Value> entry : map.entrySet()) {
- final URI key = entry.getKey();
+ for (final Entry<IRI, Value> entry : map.entrySet()) {
+ final IRI key = entry.getKey();
final Value value = entry.getValue();
nameValuePairs.add(new BasicNameValuePair(key.getLocalName(), value.stringValue()));
}
uriBuilder.setParameters(nameValuePairs);
- URI uri = null;
+ IRI uri = null;
try {
if (fragmentPosition > -1) {
final java.net.URI partialUri = uriBuilder.build();
@@ -347,10 +349,10 @@ public class SmartUriAdapter {
final URIBuilder fragmentUriBuilder = new URIBuilder(new java.net.URI(prefix));
fragmentUriBuilder.setFragment(uriString);
final String fragmentUriString = fragmentUriBuilder.build().toString();
- uri = new URIImpl(fragmentUriString);
+ uri = VF.createIRI(fragmentUriString);
} else {
final String uriString = uriBuilder.build().toString();
- uri = new URIImpl(uriString);
+ uri = VF.createIRI(uriString);
}
} catch (final URISyntaxException e) {
throw new SmartUriException("Smart URI could not serialize the property map.", e);
@@ -361,11 +363,11 @@ public class SmartUriAdapter {
/**
* Deserializes a URI into a map of URI's to values.
- * @param uri the {@link URI}.
- * @return the {@link Map} of {@link URI}s to {@link Value}s.
+ * @param uri the {@link IRI}.
+ * @return the {@link Map} of {@link IRI}s to {@link Value}s.
* @throws SmartUriException
*/
- public static Map<URI, Value> deserializeUri(final URI uri) throws SmartUriException {
+ public static Map<IRI, Value> deserializeUri(final IRI uri) throws SmartUriException {
final String uriString = uri.stringValue();
final int fragmentPosition = uriString.indexOf("#");
String prefix = uriString.substring(0, fragmentPosition + 1);
@@ -386,28 +388,28 @@ public class SmartUriAdapter {
} catch (final URISyntaxException e) {
throw new SmartUriException("Unable to deserialize Smart URI", e);
}
- final Map<URI, Value> map = new HashMap<>();
+ final Map<IRI, Value> map = new HashMap<>();
final RyaURI subject = findSubject(uri.stringValue());
final List<NameValuePair> parameters = uriBuilder.getQueryParams();
Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>();
Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>();
- final Map<RyaURI, Map<URI, Value>> fullMap = new LinkedHashMap<>();
+ final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
for (final NameValuePair pair : parameters) {
final String keyString = pair.getName();
final String valueString = pair.getValue();
- final URI keyUri = new URIImpl(prefix + keyString);
+ final IRI keyUri = VF.createIRI(prefix + keyString);
final String decoded;
try {
decoded = URLDecoder.decode(valueString, Charsets.UTF_8.name());
} catch (final UnsupportedEncodingException e) {
throw new SmartUriException("", e);
}
- final URI type = TypeDeterminer.determineType(decoded);
+ final IRI type = TypeDeterminer.determineType(decoded);
if (type == XMLSchema.ANYURI) {
if (keyString.equals(RYA_TYPES_URI.getLocalName())) {
- entityTypeMap = convertUriToTypeMap(new URIImpl(decoded));
+ entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded));
invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse();
}
} else {
@@ -420,7 +422,7 @@ public class SmartUriAdapter {
final Value value = RyaToRdfConversions.convertValue(ryaType);
final String formattedKeyUriString = removeTypePrefixFromUri(keyUri.stringValue(), keyPrefix);
- final URI formattedKeyUri = new URIImpl(formattedKeyUriString);
+ final IRI formattedKeyUri = VF.createIRI(formattedKeyUriString);
map.put(formattedKeyUri, value);
}
@@ -428,7 +430,7 @@ public class SmartUriAdapter {
return map;
}
- public static Entity deserializeUriEntity(final URI uri) throws SmartUriException {
+ public static Entity deserializeUriEntity(final IRI uri) throws SmartUriException {
final String uriString = uri.stringValue();
final int fragmentPosition = uriString.indexOf("#");
String prefix = uriString.substring(0, fragmentPosition + 1);
@@ -455,22 +457,22 @@ public class SmartUriAdapter {
final List<NameValuePair> parameters = uriBuilder.getQueryParams();
Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>();
Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>();
- final Map<RyaURI, Map<URI, Value>> fullMap = new LinkedHashMap<>();
+ final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
for (final NameValuePair pair : parameters) {
final String keyString = pair.getName();
final String valueString = pair.getValue();
- final URI keyUri = new URIImpl(prefix + keyString);
+ final IRI keyUri = VF.createIRI(prefix + keyString);
final String decoded;
try {
decoded = URLDecoder.decode(valueString, Charsets.UTF_8.name());
} catch (final UnsupportedEncodingException e) {
throw new SmartUriException("", e);
}
- final URI type = TypeDeterminer.determineType(decoded);
+ final IRI type = TypeDeterminer.determineType(decoded);
if (type == XMLSchema.ANYURI) {
if (keyString.equals(RYA_TYPES_URI.getLocalName())) {
- entityTypeMap = convertUriToTypeMap(new URIImpl(decoded));
+ entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded));
invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse();
}
} else {
@@ -483,11 +485,11 @@ public class SmartUriAdapter {
final Value value = RyaToRdfConversions.convertValue(ryaType);
final String formattedKeyUriString = removeTypePrefixFromUri(keyUri.stringValue(), keyPrefix);
- final URI formattedKeyUri = new URIImpl(formattedKeyUriString);
- final Map<URI, Value> map = fullMap.get(keyCorrespondingType);
+ final IRI formattedKeyUri = VF.createIRI(formattedKeyUriString);
+ final Map<IRI, Value> map = fullMap.get(keyCorrespondingType);
if (map == null) {
- final Map<URI, Value> subMap = new HashMap<>();
+ final Map<IRI, Value> subMap = new HashMap<>();
subMap.put(formattedKeyUri, value);
fullMap.put(keyCorrespondingType, subMap);
} else {
@@ -507,7 +509,7 @@ public class SmartUriAdapter {
private TypeDeterminer() {
}
- private static URI determineType(final String data) {
+ private static IRI determineType(final String data) {
if (Ints.tryParse(data) != null) {
return XMLSchema.INTEGER;
} else if (Doubles.tryParse(data) != null) {
@@ -564,7 +566,7 @@ public class SmartUriAdapter {
private static boolean isUri(final String data) {
try {
final String decoded = URLDecoder.decode(data, Charsets.UTF_8.name());
- new URIImpl(decoded);
+ VF.createIRI(decoded);
return true;
} catch (final IllegalArgumentException | UnsupportedEncodingException e) {
// not a URI
@@ -573,12 +575,12 @@ public class SmartUriAdapter {
}
}
- public static Map<URI, Value> entityToValueMap(final Entity entity) {
- final Map<URI, Value> map = new LinkedHashMap<>();
+ public static Map<IRI, Value> entityToValueMap(final Entity entity) {
+ final Map<IRI, Value> map = new LinkedHashMap<>();
for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity.getProperties().entrySet()) {
for (final Entry<RyaURI, Property> property : entry.getValue().entrySet()) {
final RyaURI propertyKey = property.getKey();
- final URI uri = new URIImpl(propertyKey.getData());
+ final IRI uri = VF.createIRI(propertyKey.getData());
final Property propertyValue = property.getValue();
final Value value = RyaToRdfConversions.convertValue(propertyValue.getValue());
map.put(uri, value);
@@ -588,15 +590,15 @@ public class SmartUriAdapter {
}
/**
- * Converts a {@link Map} of {@link URI}/{@link Value}s to a {@link Set} of
+ * Converts a {@link Map} of {@link IRI}/{@link Value}s to a {@link Set} of
* {@link Property}s.
- * @param map the {@link Map} of {@link URI}/{@link Value}.
+ * @param map the {@link Map} of {@link IRI}/{@link Value}.
* @return the {@link Set} of {@link Property}s.
*/
- public static Set<Property> mapToProperties(final Map<URI, Value> map) {
+ public static Set<Property> mapToProperties(final Map<IRI, Value> map) {
final Set<Property> properties = new LinkedHashSet<>();
- for (final Entry<URI, Value> entry : map.entrySet()) {
- final URI uri = entry.getKey();
+ for (final Entry<IRI, Value> entry : map.entrySet()) {
+ final IRI uri = entry.getKey();
final Value value = entry.getValue();
final RyaURI ryaUri = new RyaURI(uri.stringValue());
@@ -608,10 +610,10 @@ public class SmartUriAdapter {
return properties;
}
- public static Map<URI, Value> propertiesToMap(final Set<Property> properties) {
- final Map<URI, Value> map = new LinkedHashMap<>();
+ public static Map<IRI, Value> propertiesToMap(final Set<Property> properties) {
+ final Map<IRI, Value> map = new LinkedHashMap<>();
for (final Property property : properties) {
- final URI uri = new URIImpl(property.getName().getData());
+ final IRI uri = VF.createIRI(property.getName().getData());
final Value value = RyaToRdfConversions.convertValue(property.getValue());
map.put(uri, value);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
index 1043d42..03c2dbb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
@@ -26,8 +26,8 @@ import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.model.TypedEntity;
import org.apache.rya.indexing.entity.storage.mongo.ConvertingCursor;
import org.calrissian.mango.collect.CloseableIterator;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
/**
* Interface for interacting with a Smart URI's datastore.
@@ -37,10 +37,10 @@ public interface SmartUriStorage {
* Stores the map into the datastore.
* @param subject the {@link RyaURI} subject of the Entity. Identifies the
* thing that is being represented as an Entity.
- * @param map the {@link Map} of {@link URI}s to {@link Value}s.
+ * @param map the {@link Map} of {@link IRI}s to {@link Value}s.
* @throws SmartUriException
*/
- public void storeEntity(final RyaURI subject, final Map<URI, Value> map) throws SmartUriException;
+ public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException;
/**
* Stores the entity into the datastore.
@@ -69,10 +69,10 @@ public interface SmartUriStorage {
/**
* Queries the datastore for the map.
* @param type the type associated with the entity values.
- * @param map the {@link Map} of {@link URI}s to {@link Value}s.
+ * @param map the {@link Map} of {@link IRI}s to {@link Value}s.
* @return a {@link CloseableIterator} over the {@link TypedEntity}s that
* match the search parameters.
* @throws SmartUriException
*/
- public ConvertingCursor<TypedEntity> queryEntity(final Type type, final Map<URI, Value> map) throws SmartUriException;
+ public ConvertingCursor<TypedEntity> queryEntity(final Type type, final Map<IRI, Value> map) throws SmartUriException;
}
\ No newline at end of file
[07/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/GetStatementsRyaCommand.java
----------------------------------------------------------------------
diff --git a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/GetStatementsRyaCommand.java b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/GetStatementsRyaCommand.java
index 408f700..96017c7 100644
--- a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/GetStatementsRyaCommand.java
+++ b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/GetStatementsRyaCommand.java
@@ -19,17 +19,15 @@ package org.apache.rya.alx.command;
* under the License.
*/
-
-
import org.apache.felix.gogo.commands.Command;
import org.apache.felix.gogo.commands.Option;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryResult;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryResult;
-import static org.apache.rya.api.RdfCloudTripleStoreUtils.*;
+import static org.apache.rya.api.RdfCloudTripleStoreUtils.createValue;
/**
* Date: 5/16/12
@@ -62,7 +60,7 @@ public class GetStatementsRyaCommand extends AbstractRyaCommand {
connection = repository.getConnection();
RepositoryResult<Statement> statements = connection.getStatements(
(subject != null) ? (Resource) createValue(subject) : null,
- (predicate != null) ? (URI) createValue(predicate) : null,
+ (predicate != null) ? (IRI) createValue(predicate) : null,
(object != null) ? createValue(object) : null,
false,
(context != null) ? new Resource[]{(Resource) createValue(context)} : new Resource[0]);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/InfoRyaCommand.java
----------------------------------------------------------------------
diff --git a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/InfoRyaCommand.java b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/InfoRyaCommand.java
index 37be971..1712050 100644
--- a/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/InfoRyaCommand.java
+++ b/osgi/alx.rya.console/src/main/java/org/apache/rya/alx/command/InfoRyaCommand.java
@@ -19,12 +19,10 @@ package org.apache.rya.alx.command;
* under the License.
*/
+import java.util.Map;
-
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.felix.gogo.commands.Command;
-
-import java.util.Map;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
/**
* Date: 5/16/12
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/alx.rya/src/main/features/alx.rya-features.xml
----------------------------------------------------------------------
diff --git a/osgi/alx.rya/src/main/features/alx.rya-features.xml b/osgi/alx.rya/src/main/features/alx.rya-features.xml
index 87794b9..1d892a6 100644
--- a/osgi/alx.rya/src/main/features/alx.rya-features.xml
+++ b/osgi/alx.rya/src/main/features/alx.rya-features.xml
@@ -20,47 +20,47 @@ under the License.
-->
<features name="alx.rya">
- <feature name='org.openrdf.sesame.runtime' version="2.6.4">
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-model/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-runtime/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-query/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryalgebra-model/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryparser-api/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryparser-serql/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryparser-sparql/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryresultio-api/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryresultio-binary/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryresultio-sparqljson/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryresultio-text/2.6.4</bundle>
+ <feature name='org.eclipse.rdf4j.runtime' version="2.3.1">
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-model/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-runtime/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-query/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryalgebra-model/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryparser-api/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryparser-serql/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryparser-sparql/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryresultio-api/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryresultio-binary/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryresultio-sparqljson/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryresultio-text/2.3.1</bundle>
<bundle>wrap:mvn:net.sf.opencsv/opencsv/2.0</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-api/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-manager/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-event/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-sail/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-sail-memory/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-sail-inferencer/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryalgebra-evaluation/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-sparql/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-http/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-http-client/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-dataset/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-repository-contextaware/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-http-protocol/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-ntriples/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-api/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-binary/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-n3/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-trix/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-turtle/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-trig/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-sail-api/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-sail-nativerdf/2.6.4</bundle>
- <!--bundle>wrap:mvn:org.openrdf.sesame/sesame-sail-rdbms/2.6.4</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-api/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-manager/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-event/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-sail/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-sail-memory/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-sail-inferencer/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryalgebra-evaluation/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-sparql/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-http/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-http-client/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-dataset/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-repository-contextaware/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-http-protocol/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-ntriples/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-api/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-binary/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-n3/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-trix/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-turtle/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-trig/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-sail-api/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-sail-nativerdf/2.3.1</bundle>
+ <!--bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-sail-rdbms/2.3.1</bundle>
<bundle>wrap:mvn:commons-dbcp/commons-dbcp/1.3</bundle>
<bundle>wrap:mvn:commons-pool/commons-pool/1.3</bundle-->
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-queryresultio-sparqlxml/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-util/2.6.4</bundle>
- <bundle>wrap:mvn:org.openrdf.sesame/sesame-rio-rdfxml/2.6.4</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-queryresultio-sparqlxml/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-util/2.3.1</bundle>
+ <bundle>wrap:mvn:org.eclipse.rdf4j/rdf4j-rio-rdfxml/2.3.1</bundle>
</feature>
<feature name='tinkerpop.blueprints' version='1.2'>
<bundle>wrap:mvn:com.tinkerpop.blueprints/blueprints-core/1.2</bundle>
@@ -71,10 +71,10 @@ under the License.
<bundle>mvn:org.codehaus.jackson/jackson-mapper-asl/1.8.5</bundle>
</feature>
<feature name='rya.sail' version='3.0.4'>
- <!--<feature version="[2.6,3.0)">org.openrdf.sesame.runtime</feature>-->
+ <!--<feature version="[2.3,3.0)">org.eclipse.rdf4j.runtime</feature>-->
<feature version="1.2">tinkerpop.blueprints</feature>
<feature version="[10,12)">google.guava</feature>
- <bundle>mvn:org.apache.rya/sesame-runtime-osgi/2.6.4</bundle>
+ <bundle>mvn:org.apache.rya/rdf4j-runtime-osgi/2.3.1s</bundle>
<bundle>wrap:mvn:org.apache.rya/rya.api/3.0.4-SNAPSHOT</bundle>
<bundle>wrap:mvn:org.apache.rya/rya.sail.impl/3.0.4-SNAPSHOT</bundle>
</feature>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailComponent.java
----------------------------------------------------------------------
diff --git a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailComponent.java b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailComponent.java
index e5d73d2..940bce5 100644
--- a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailComponent.java
+++ b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailComponent.java
@@ -19,18 +19,16 @@ package org.apache.rya.camel.cbsail;
* under the License.
*/
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.Map;
import org.apache.camel.Endpoint;
import org.apache.camel.impl.DefaultComponent;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.sail.SailRepository;
-
-import java.util.Map;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.repository.Repository;
-import static com.google.common.base.Preconditions.*;
/**
* Save and retrieve triples
*/
@@ -41,7 +39,7 @@ public class CbSailComponent extends DefaultComponent {
public static final String SPARQL_QUERY_PROP = "cbsail.sparql";
public static final String START_TIME_QUERY_PROP = "cbsail.startTime";
public static final String TTL_QUERY_PROP = "cbsail.ttl";
- public static final ValueFactory valueFactory = new ValueFactoryImpl();
+ public static final ValueFactory VALUE_FACTORY = SimpleValueFactory.getInstance();
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailEndpoint.java
----------------------------------------------------------------------
diff --git a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailEndpoint.java b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailEndpoint.java
index a8909cb..6d09c52 100644
--- a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailEndpoint.java
+++ b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailEndpoint.java
@@ -19,13 +19,15 @@ package org.apache.rya.camel.cbsail;
* under the License.
*/
+import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.apache.camel.*;
+import org.apache.camel.Component;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.RuntimeCamelException;
import org.apache.camel.impl.DefaultEndpoint;
-import org.openrdf.repository.Repository;
-
-import static com.google.common.base.Preconditions.*;
+import org.eclipse.rdf4j.repository.Repository;
/**
* setHeader(SPARQL, sqarlQuery).setHeader(TTL, ttl).to("cbsail:server?port=2181&user=user&pwd=pwd&instanceName=name").getBody(<Triple Map>)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailProducer.java
----------------------------------------------------------------------
diff --git a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailProducer.java b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailProducer.java
index eba4b3d..0b8738c 100644
--- a/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailProducer.java
+++ b/osgi/camel.rya/src/main/java/org/apache/rya/camel/cbsail/CbSailProducer.java
@@ -1,18 +1,3 @@
-package org.apache.rya.camel.cbsail;
-
-import static org.apache.rya.api.RdfCloudTripleStoreConfiguration.CONF_INFER;
-import static org.apache.rya.api.RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH;
-import static org.apache.rya.camel.cbsail.CbSailComponent.SPARQL_QUERY_PROP;
-import static org.apache.rya.camel.cbsail.CbSailComponent.valueFactory;
-
-import java.io.ByteArrayOutputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -31,23 +16,35 @@ import java.util.Map;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.camel.cbsail;
+import static org.apache.rya.api.RdfCloudTripleStoreConfiguration.CONF_INFER;
+import static org.apache.rya.api.RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH;
+import static org.apache.rya.camel.cbsail.CbSailComponent.SPARQL_QUERY_PROP;
+import static org.apache.rya.camel.cbsail.CbSailComponent.VALUE_FACTORY;
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultProducer;
-import org.openrdf.model.Statement;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandlerBase;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.rio.RDFHandlerException;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
/**
*/
@@ -130,14 +127,14 @@ public class CbSailProducer extends DefaultProducer {
final TupleQuery tupleQuery = connection.prepareTupleQuery(
QueryLanguage.SPARQL, query);
if (auth != null && auth.length() > 0) {
- tupleQuery.setBinding(CONF_QUERY_AUTH, valueFactory.createLiteral(auth));
+ tupleQuery.setBinding(CONF_QUERY_AUTH, VALUE_FACTORY.createLiteral(auth));
}
if (infer != null) {
- tupleQuery.setBinding(CONF_INFER, valueFactory.createLiteral(infer));
+ tupleQuery.setBinding(CONF_INFER, VALUE_FACTORY.createLiteral(infer));
}
if (CbSailEndpoint.CbSailOutput.BINARY.equals(queryOutput)) {
final List listOutput = new ArrayList();
- final TupleQueryResultHandlerBase handler = new TupleQueryResultHandlerBase() {
+ final AbstractTupleQueryResultHandler handler = new AbstractTupleQueryResultHandler() {
@Override
public void handleSolution(final BindingSet bindingSet) throws TupleQueryResultHandlerException {
final Map<String, String> map = new HashMap<String, String>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/camel.rya/src/test/java/org/apache/rya/camel/cbsail/CbSailTest.java
----------------------------------------------------------------------
diff --git a/osgi/camel.rya/src/test/java/org/apache/rya/camel/cbsail/CbSailTest.java b/osgi/camel.rya/src/test/java/org/apache/rya/camel/cbsail/CbSailTest.java
index 4803bd4..f9e8855 100644
--- a/osgi/camel.rya/src/test/java/org/apache/rya/camel/cbsail/CbSailTest.java
+++ b/osgi/camel.rya/src/test/java/org/apache/rya/camel/cbsail/CbSailTest.java
@@ -19,16 +19,11 @@ package org.apache.rya.camel.cbsail;
* under the License.
*/
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
-
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.rya.rdftriplestore.RyaSailRepository;
-import org.apache.rya.rdftriplestore.inference.InferenceEngine;
-import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.mock.MockInstance;
@@ -39,17 +34,20 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.CamelTestSupport;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.apache.rya.rdftriplestore.inference.InferenceEngine;
+import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
/**
*/
@@ -59,7 +57,7 @@ public class CbSailTest extends CamelTestSupport {
private RdfCloudTripleStore store;
private Repository repository;
- private ValueFactory vf = RdfCloudTripleStoreConstants.VALUE_FACTORY;
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@EndpointInject(uri = "mock:results")
protected MockEndpoint resultEndpoint;
@@ -108,9 +106,9 @@ public class CbSailTest extends CamelTestSupport {
public void testSimpleQuery() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI cpu = vf.createURI(litdupsNS, "cpu");
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
+ IRI cpu = VF.createIRI(litdupsNS, "cpu");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
conn.close();
@@ -128,11 +126,11 @@ public class CbSailTest extends CamelTestSupport {
public void testSimpleQueryAuth() throws Exception {
RepositoryConnection conn = repository.getConnection();
- URI cpu = vf.createURI(litdupsNS, "cpu");
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
- URI uri2 = vf.createURI(litdupsNS, "uri2");
- URI auth1 = vf.createURI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "auth1");
+ IRI cpu = VF.createIRI(litdupsNS, "cpu");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
+ IRI uri2 = VF.createIRI(litdupsNS, "uri2");
+ IRI auth1 = VF.createIRI(RdfCloudTripleStoreConstants.AUTH_NAMESPACE, "auth1");
conn.add(cpu, loadPerc, uri1, auth1);
conn.add(cpu, loadPerc, uri2);
conn.commit();
@@ -162,13 +160,13 @@ public class CbSailTest extends CamelTestSupport {
}
public void testInsertData() throws Exception {
- URI cpu = vf.createURI(litdupsNS, "cpu");
- URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
- URI uri1 = vf.createURI(litdupsNS, "uri1");
- URI uri2 = vf.createURI(litdupsNS, "uri2");
+ IRI cpu = VF.createIRI(litdupsNS, "cpu");
+ IRI loadPerc = VF.createIRI(litdupsNS, "loadPerc");
+ IRI uri1 = VF.createIRI(litdupsNS, "uri1");
+ IRI uri2 = VF.createIRI(litdupsNS, "uri2");
List<Statement> insert = new ArrayList<Statement>();
- insert.add(new StatementImpl(cpu, loadPerc, uri1));
- insert.add(new StatementImpl(cpu, loadPerc, uri2));
+ insert.add(VF.createStatement(cpu, loadPerc, uri1));
+ insert.add(VF.createStatement(cpu, loadPerc, uri2));
resultEndpoint.expectedBodiesReceived(true);
template.sendBody(insert);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/pom.xml b/osgi/pom.xml
index 4ca9dd2..3371951 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -41,7 +41,7 @@ under the License.
<module>alx.rya.console</module>
<module>camel.rya</module>
<!-- Disabling and documented in RYA-8 -->
- <!-- <module>sesame-runtime-osgi</module> -->
+ <!-- <module>rdf4j-runtime-osgi</module> -->
</modules>
<build>
<pluginManagement>
@@ -53,7 +53,7 @@ under the License.
<excludes>
<!-- Services Files -->
<exclude>**/resources/META-INF/services/**</exclude>
- <exclude>sesame-runtime-osgi/openrdf-sesame-osgi.bnd</exclude>
+ <exclude>rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd</exclude>
</excludes>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd
----------------------------------------------------------------------
diff --git a/osgi/rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd b/osgi/rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd
new file mode 100644
index 0000000..a838bfc
--- /dev/null
+++ b/osgi/rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd
@@ -0,0 +1,7 @@
+-classpath= target/rdf4j-runtime-osgi.jar
+-output= target/rdf4j-runtime-osgi-2.3.1.jar
+Import-Package= *;resolution:=optional
+Export-Package= *
+Bundle-Version= 2.3.1
+Bundle-SymbolicName= rdf4j-runtime-osgi
+DynamicImport-Package= *
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/rdf4j-runtime-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/rdf4j-runtime-osgi/pom.xml b/osgi/rdf4j-runtime-osgi/pom.xml
new file mode 100644
index 0000000..df2a35d
--- /dev/null
+++ b/osgi/rdf4j-runtime-osgi/pom.xml
@@ -0,0 +1,139 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.rya</groupId>
+ <artifactId>rya.osgi</artifactId>
+ <version>3.2.13-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>rdf4j-runtime-osgi</artifactId>
+ <name>RDF4J Runtime for OSGI</name>
+
+ <packaging>pom</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime-osgi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
+ <version>0.0.397</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime-osgi</artifactId>
+ <version>${project.version}</version>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <destFileName>rdf4j-runtime-osgi.jar</destFileName>
+ </artifactItem>
+ <artifactItem>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
+ <version>0.0.397</version>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <destFileName>bnd.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
+ <!-- other configurations here -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>java</executable>
+ <arguments>
+ <argument>-jar</argument>
+ <argument>target/bnd.jar</argument>
+ <argument>build</argument>
+ <argument>eclipse-rdf4j-osgi.bnd</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin
+ </artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/rdf4j-runtime-osgi-${project.version}.jar</file>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>bndrepo</id>
+ <name>aQute BND Repo</name>
+ <url>http://www.aqute.biz/repo</url>
+ </repository>
+ </repositories>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/sesame-runtime-osgi/openrdf-sesame-osgi.bnd
----------------------------------------------------------------------
diff --git a/osgi/sesame-runtime-osgi/openrdf-sesame-osgi.bnd b/osgi/sesame-runtime-osgi/openrdf-sesame-osgi.bnd
deleted file mode 100644
index c0aea07..0000000
--- a/osgi/sesame-runtime-osgi/openrdf-sesame-osgi.bnd
+++ /dev/null
@@ -1,7 +0,0 @@
--classpath= target/sesame-runtime-osgi.jar
--output= target/sesame-runtime-osgi-2.6.4.jar
-Import-Package= *;resolution:=optional
-Export-Package= *
-Bundle-Version= 2.6.4
-Bundle-SymbolicName= sesame-runtime-osgi
-DynamicImport-Package= *
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/osgi/sesame-runtime-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/sesame-runtime-osgi/pom.xml b/osgi/sesame-runtime-osgi/pom.xml
deleted file mode 100644
index ce55927..0000000
--- a/osgi/sesame-runtime-osgi/pom.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.rya</groupId>
- <artifactId>rya.osgi</artifactId>
- <version>3.2.10-incubating-SNAPSHOT</version>
- </parent>
-
- <artifactId>sesame-runtime-osgi</artifactId>
- <name>Sesame Runtime for OSGI</name>
-
- <packaging>pom</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime-osgi</artifactId>
- </dependency>
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- <version>0.0.397</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime-osgi</artifactId>
- <version>${project.version}</version>
- <outputDirectory>${project.build.directory}</outputDirectory>
- <destFileName>sesame-runtime-osgi.jar</destFileName>
- </artifactItem>
- <artifactItem>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- <version>0.0.397</version>
- <outputDirectory>${project.build.directory}</outputDirectory>
- <destFileName>bnd.jar</destFileName>
- </artifactItem>
- </artifactItems>
- <!-- other configurations here -->
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <phase>process-resources</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <executable>java</executable>
- <arguments>
- <argument>-jar</argument>
- <argument>target/bnd.jar</argument>
- <argument>build</argument>
- <argument>openrdf-sesame-osgi.bnd</argument>
- </arguments>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin
- </artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/sesame-runtime-osgi-${project.version}.jar</file>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <repositories>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>bndrepo</id>
- <name>aQute BND Repo</name>
- <url>http://www.aqute.biz/repo</url>
- </repository>
- </repositories>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/pom.xml
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/pom.xml b/pig/accumulo.pig/pom.xml
index e9b14d0..de1b3d0 100644
--- a/pig/accumulo.pig/pom.xml
+++ b/pig/accumulo.pig/pom.xml
@@ -41,8 +41,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryparser-sparql</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryparser-sparql</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/IndexWritingTool.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/IndexWritingTool.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/IndexWritingTool.java
index 3d5de56..c6ce45a 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/IndexWritingTool.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/IndexWritingTool.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo.pig;
* under the License.
*/
-
-
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -53,10 +51,10 @@ import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Logger;
import org.apache.rya.api.path.PathUtils;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlQueryPigEngine.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlQueryPigEngine.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlQueryPigEngine.java
index d0641e6..7302559 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlQueryPigEngine.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlQueryPigEngine.java
@@ -1,3 +1,21 @@
+/*
+ * 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.rya.accumulo.pig;
import java.io.ByteArrayInputStream;
@@ -24,31 +42,10 @@ import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.inference.InverseOfVisitor;
import org.apache.rya.rdftriplestore.inference.SymmetricPropertyVisitor;
import org.apache.rya.rdftriplestore.inference.TransitivePropertyVisitor;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.QueryParser;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-
-/*
- * 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.
- */
-
-
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.QueryParser;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitor.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitor.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitor.java
index c57aab8..673750d 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitor.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitor.java
@@ -18,16 +18,25 @@ package org.apache.rya.accumulo.pig;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.*;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.Slice;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
/**
* Created by IntelliJ IDEA.
@@ -35,7 +44,7 @@ import java.util.*;
* Time: 10:17 AM
* To change this template use File | Settings | File Templates.
*/
-public class SparqlToPigTransformVisitor extends QueryModelVisitorBase<RuntimeException> {
+public class SparqlToPigTransformVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private StringBuilder pigScriptBuilder = new StringBuilder();
private String tablePrefix;
private String instance, zk, user, password; //TODO: use a Configuration object to get these
@@ -328,7 +337,7 @@ public class SparqlToPigTransformVisitor extends QueryModelVisitorBase<RuntimeEx
if (value == null) {
return "";
}
- if (value instanceof URI) {
+ if (value instanceof IRI) {
return "<" + value.stringValue() + ">";
}
if (value instanceof Literal) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
index bc3914c..0837e5c 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/StatementPatternStorage.java
@@ -19,8 +19,6 @@ package org.apache.rya.accumulo.pig;
* under the License.
*/
-
-
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
@@ -52,17 +50,17 @@ import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.QueryParser;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.QueryParser;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
@@ -169,7 +167,7 @@ public class StatementPatternStorage extends AccumuloStorage {
} catch (MalformedQueryException e) {
throw new IOException(e);
}
- parsedQuery.getTupleExpr().visitChildren(new QueryModelVisitorBase<IOException>() {
+ parsedQuery.getTupleExpr().visitChildren(new AbstractQueryModelVisitor<IOException>() {
@Override
public void meet(StatementPattern node) throws IOException {
Var subjectVar = node.getSubjectVar();
@@ -193,7 +191,7 @@ public class StatementPatternStorage extends AccumuloStorage {
protected Map.Entry<TABLE_LAYOUT, Range> createRange(Value s_v, Value p_v, Value o_v) throws IOException {
RyaURI subject_rya = RdfToRyaConversions.convertResource((Resource) s_v);
- RyaURI predicate_rya = RdfToRyaConversions.convertURI((URI) p_v);
+ RyaURI predicate_rya = RdfToRyaConversions.convertURI((IRI) p_v);
RyaType object_rya = RdfToRyaConversions.convertValue(o_v);
TriplePatternStrategy strategy = ryaContext.retrieveStrategy(subject_rya, predicate_rya, object_rya, null);
if (strategy == null) {
@@ -232,12 +230,12 @@ public class StatementPatternStorage extends AccumuloStorage {
//is it subclassof or subpropertyof
if (RDF.TYPE.equals(predicate_value)) {
//try subclassof
- Collection<URI> parents = inferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), (URI) object_value);
+ Collection<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), (IRI) object_value);
if (parents != null && parents.size() > 0) {
//subclassof relationships found
//don't add self, that will happen anyway later
//add all relationships
- for (URI parent : parents) {
+ for (IRI parent : parents) {
Map.Entry<TABLE_LAYOUT, Range> temp =
createRange(subject_value, predicate_value, parent);
Range range = temp.getValue();
@@ -249,8 +247,8 @@ public class StatementPatternStorage extends AccumuloStorage {
}
} else if (predicate_value != null) {
//subpropertyof check
- Set<URI> parents = inferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), (URI) predicate_value);
- for (URI parent : parents) {
+ Set<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), (IRI) predicate_value);
+ for (IRI parent : parents) {
Map.Entry<TABLE_LAYOUT, Range> temp =
createRange(subject_value, parent, object_value);
Range range = temp.getValue();
@@ -285,8 +283,8 @@ public class StatementPatternStorage extends AccumuloStorage {
public Tuple getNext() throws IOException {
try {
if (reader.nextKeyValue()) {
- Key key = (Key) reader.getCurrentKey();
- org.apache.accumulo.core.data.Value value = (org.apache.accumulo.core.data.Value) reader.getCurrentValue();
+ Key key = reader.getCurrentKey();
+ org.apache.accumulo.core.data.Value value = reader.getCurrentValue();
ByteArrayDataInput input = ByteStreams.newDataInput(key.getRow().getBytes());
RyaStatement ryaStatement = ryaContext.deserializeTriple(layout, new TripleRow(key.getRow().getBytes(),
key.getColumnFamily().getBytes(), key.getColumnQualifier().getBytes()));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/optimizer/SimilarVarJoinOptimizer.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/optimizer/SimilarVarJoinOptimizer.java b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/optimizer/SimilarVarJoinOptimizer.java
index c046a3d..36739c5 100644
--- a/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/optimizer/SimilarVarJoinOptimizer.java
+++ b/pig/accumulo.pig/src/main/java/org/apache/rya/accumulo/pig/optimizer/SimilarVarJoinOptimizer.java
@@ -18,18 +18,24 @@ package org.apache.rya.accumulo.pig.optimizer;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.*;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
/**
* A query optimizer that re-orders nested Joins according to cardinality, preferring joins that have similar variables.
@@ -57,7 +63,7 @@ public class SimilarVarJoinOptimizer implements QueryOptimizer {
tupleExpr.visit(new JoinVisitor());
}
- protected class JoinVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected class JoinVisitor extends AbstractQueryModelVisitor<RuntimeException> {
Set<String> boundVars = new HashSet<String>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitorTest.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitorTest.java b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitorTest.java
index 5bd5b35..baf4c55 100644
--- a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitorTest.java
+++ b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/SparqlToPigTransformVisitorTest.java
@@ -19,15 +19,13 @@ package org.apache.rya.accumulo.pig;
* under the License.
*/
-
-
import junit.framework.TestCase;
import org.apache.rya.accumulo.pig.optimizer.SimilarVarJoinOptimizer;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.QueryParser;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.QueryParser;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
/**
* Created by IntelliJ IDEA.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
----------------------------------------------------------------------
diff --git a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
index 1446d20..eb40df9 100644
--- a/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
+++ b/pig/accumulo.pig/src/test/java/org/apache/rya/accumulo/pig/StatementPatternStorageTest.java
@@ -19,20 +19,10 @@ package org.apache.rya.accumulo.pig;
* under the License.
*/
-
-
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
-import junit.framework.TestCase;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.admin.SecurityOperations;
@@ -48,8 +38,14 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl;
import org.apache.pig.data.Tuple;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaURI;
+
+import junit.framework.TestCase;
/**
* Created by IntelliJ IDEA.
@@ -66,7 +62,6 @@ public class StatementPatternStorageTest extends TestCase {
private Authorizations auths = Constants.NO_AUTHS;
private Connector connector;
private AccumuloRyaDAO ryaDAO;
- private ValueFactory vf = new ValueFactoryImpl();
private String namespace = "urn:test#";
private AccumuloRdfConfiguration conf;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b3b9dbb..f31873a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,8 +69,7 @@ under the License.
<module>web</module>
</modules>
<properties>
- <openrdf.sesame.version>2.7.6</openrdf.sesame.version> <!-- Newest: 4.0.0 -->
- <!--Cannot upgrade to openrdf.sesame 2.7.6 until RYA-9 is resolved -->
+ <org.eclipse.rdf4j.version>2.3.1</org.eclipse.rdf4j.version> <!-- Newest: 2.3.1 -->
<accumulo.version>1.6.4</accumulo.version> <!-- Newest: 1.7.0 -->
<hadoop.version>2.5.0</hadoop.version> <!-- Newest: 2.7.1 -->
@@ -79,7 +78,7 @@ under the License.
<pig.version>0.9.2</pig.version> <!-- Newest: 0.15.0 -->
- <lucene.version>3.6.2</lucene.version> <!-- Newest: 5.3.1 -->
+ <lucene.version>5.2.1</lucene.version> <!-- Newest: 5.3.1 -->
<joda-time.version>2.1</joda-time.version> <!-- Newest: 2.9.1 -->
<mongodb.version>3.3.0</mongodb.version>
@@ -479,104 +478,104 @@ under the License.
<version>${accumulo.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.rya</groupId>
- <artifactId>sesame-runtime-osgi</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime-osgi</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-model</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-model</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-query</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-query</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-model</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-model</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryparser-sparql</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryparser-sparql</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-sparqlxml</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-sparqlxml</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-text</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-text</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-nquads</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-nquads</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-rdfxml</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-rdfxml</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryrender</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryrender</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime-osgi</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime-osgi</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
<exclusions>
<exclusion>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-http-client</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-http-client</artifactId>
</exclusion>
<exclusion>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-http-server-spring</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-http-server-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-evaluation</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-evaluation</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-sparqljson</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-sparqljson</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-repository-api</artifactId>
- <version>${openrdf.sesame.version}</version>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-repository-api</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
</dependency>
<dependency>
@@ -790,7 +789,7 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
- <artifactId>lucene-analyzers</artifactId>
+ <artifactId>lucene-analyzers-common</artifactId>
<version>${lucene.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/pom.xml
----------------------------------------------------------------------
diff --git a/sail/pom.xml b/sail/pom.xml
index aedca13..5fc159c 100644
--- a/sail/pom.xml
+++ b/sail/pom.xml
@@ -34,6 +34,13 @@ under the License.
<groupId>org.apache.rya</groupId>
<artifactId>rya.api</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-api</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.rya</groupId>
<artifactId>rya.provenance</artifactId>
@@ -59,8 +66,8 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-runtime</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-runtime</artifactId>
</dependency>
<!-- Test -->
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStore.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStore.java b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStore.java
index a99fe66..e475fec 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStore.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStore.java
@@ -28,13 +28,13 @@ import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
import org.apache.rya.rdftriplestore.inference.InferenceEngine;
import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
import org.apache.rya.rdftriplestore.provenance.ProvenanceCollector;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.sail.SailConnection;
-import org.openrdf.sail.SailException;
-import org.openrdf.sail.helpers.SailBase;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.sail.SailConnection;
+import org.eclipse.rdf4j.sail.SailException;
+import org.eclipse.rdf4j.sail.helpers.AbstractSail;
-public class RdfCloudTripleStore<C extends RdfCloudTripleStoreConfiguration> extends SailBase {
+public class RdfCloudTripleStore<C extends RdfCloudTripleStoreConfiguration> extends AbstractSail {
private C conf;
@@ -45,7 +45,7 @@ public class RdfCloudTripleStore<C extends RdfCloudTripleStoreConfiguration> ext
private NamespaceManager namespaceManager;
protected ProvenanceCollector provenanceCollector;
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
protected SailConnection getConnectionInternal() throws SailException {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
index ed9ad0b..e582321 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/RdfCloudTripleStoreConnection.java
@@ -69,44 +69,42 @@ import org.apache.rya.rdftriplestore.namespace.NamespaceManager;
import org.apache.rya.rdftriplestore.provenance.ProvenanceCollectionException;
import org.apache.rya.rdftriplestore.provenance.ProvenanceCollector;
import org.apache.rya.rdftriplestore.utils.DefaultStatistics;
-import org.openrdf.model.Namespace;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.QueryRoot;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.EvaluationStrategy;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.evaluation.TripleSource;
-import org.openrdf.query.algebra.evaluation.impl.BindingAssigner;
-import org.openrdf.query.algebra.evaluation.impl.CompareOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.ConjunctiveConstraintSplitter;
-import org.openrdf.query.algebra.evaluation.impl.ConstantOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.DisjunctiveConstraintOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStatistics;
-import org.openrdf.query.algebra.evaluation.impl.FilterOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.IterativeEvaluationOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.OrderLimitOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.QueryModelNormalizer;
-import org.openrdf.query.algebra.evaluation.impl.SameTermFilterOptimizer;
-import org.openrdf.query.impl.EmptyBindingSet;
-import org.openrdf.sail.SailException;
-import org.openrdf.sail.helpers.SailConnectionBase;
-
-import info.aduna.iteration.CloseableIteration;
-
-public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfiguration> extends SailConnectionBase {
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Namespace;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.QueryRoot;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.BindingAssigner;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.CompareOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ConjunctiveConstraintSplitter;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ConstantOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.DisjunctiveConstraintOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.FilterOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.IterativeEvaluationOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.OrderLimitOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryModelNormalizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.SameTermFilterOptimizer;
+import org.eclipse.rdf4j.query.impl.EmptyBindingSet;
+import org.eclipse.rdf4j.sail.SailException;
+import org.eclipse.rdf4j.sail.helpers.AbstractSailConnection;
+
+public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfiguration> extends AbstractSailConnection {
private final RdfCloudTripleStore<C> store;
private RdfEvalStatsDAO<C> rdfEvalStatsDAO;
@@ -150,7 +148,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
}
@Override
- protected void addStatementInternal(final Resource subject, final URI predicate,
+ protected void addStatementInternal(final Resource subject, final IRI predicate,
final Value object, final Resource... contexts) throws SailException {
try {
final String cv_s = conf.getCv();
@@ -294,7 +292,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
if(pcjOptimizer != null) {
QueryOptimizer opt = null;
try {
- final Constructor<QueryOptimizer> construct = pcjOptimizer.getDeclaredConstructor(new Class[] {});
+ final Constructor<QueryOptimizer> construct = pcjOptimizer.getDeclaredConstructor();
opt = construct.newInstance();
} catch (final Exception e) {
}
@@ -329,7 +327,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
for (final Class<QueryOptimizer> optclz : optimizers) {
QueryOptimizer result = null;
try {
- final Constructor<QueryOptimizer> meth = optclz.getDeclaredConstructor(new Class[] {});
+ final Constructor<QueryOptimizer> meth = optclz.getDeclaredConstructor();
result = meth.newInstance();
} catch (final Exception e) {
}
@@ -462,7 +460,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
@Override
protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(
- final Resource subject, final URI predicate, final Value object, final boolean flag,
+ final Resource subject, final IRI predicate, final Value object, final boolean flag,
final Resource... contexts) throws SailException {
// try {
//have to do this to get the inferred values
@@ -509,15 +507,16 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
try {
final BindingSet next = evaluate.next();
final Resource bs_subj = (Resource) ((subjVar.hasValue()) ? subjVar.getValue() : next.getBinding(subjVar.getName()).getValue());
- final URI bs_pred = (URI) ((predVar.hasValue()) ? predVar.getValue() : next.getBinding(predVar.getName()).getValue());
- final Value bs_obj = (objVar.hasValue()) ? objVar.getValue() : (Value) next.getBinding(objVar.getName()).getValue();
+ final IRI bs_pred = (IRI) ((predVar.hasValue()) ? predVar.getValue() : next.getBinding(predVar.getName()).getValue());
+ final Value bs_obj = (objVar.hasValue()) ? objVar.getValue() :
+ next.getBinding(objVar.getName()).getValue();
final Binding b_cntxt = next.getBinding(cntxtVar.getName());
//convert BindingSet to Statement
if (b_cntxt != null) {
- return new ContextStatementImpl(bs_subj, bs_pred, bs_obj, (Resource) b_cntxt.getValue());
+ return SimpleValueFactory.getInstance().createStatement(bs_subj, bs_pred, bs_obj, (Resource) b_cntxt.getValue());
} else {
- return new StatementImpl(bs_subj, bs_pred, bs_obj);
+ return SimpleValueFactory.getInstance().createStatement(bs_subj, bs_pred, bs_obj);
}
} catch (final QueryEvaluationException e) {
throw new SailException(e);
@@ -552,16 +551,16 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
}
@Override
- protected void removeStatementsInternal(final Resource subject, final URI predicate,
+ protected void removeStatementsInternal(final Resource subject, final IRI predicate,
final Value object, final Resource... contexts) throws SailException {
- if (!(subject instanceof URI)) {
+ if (!(subject instanceof IRI)) {
throw new SailException("Subject[" + subject + "] must be URI");
}
try {
if (contexts != null && contexts.length > 0) {
for (final Resource context : contexts) {
- if (!(context instanceof URI)) {
+ if (!(context instanceof IRI)) {
throw new SailException("Context[" + context + "] must be URI");
}
final RyaStatement statement = new RyaStatement(
@@ -609,6 +608,11 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
//TODO: ?
}
+ @Override
+ public boolean pendingRemovals() {
+ return false;
+ }
+
public static class StoreTripleSource<C extends RdfCloudTripleStoreConfiguration> implements TripleSource {
private final C conf;
@@ -621,7 +625,7 @@ public class RdfCloudTripleStoreConnection<C extends RdfCloudTripleStoreConfigur
@Override
public CloseableIteration<Statement, QueryEvaluationException> getStatements(
- final Resource subject, final URI predicate, final Value object,
+ final Resource subject, final IRI predicate, final Value object,
final Resource... contexts) throws QueryEvaluationException {
return RyaDAOHelper.query(ryaDAO, subject, predicate, object, conf, contexts);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepository.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepository.java b/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepository.java
index 402e5bb..ac45baa 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepository.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepository.java
@@ -19,13 +19,11 @@ package org.apache.rya.rdftriplestore;
* under the License.
*/
-
-
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
/**
* Created by IntelliJ IDEA.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepositoryConnection.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepositoryConnection.java b/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepositoryConnection.java
index 5dfe5f3..145d2d0 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepositoryConnection.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/RyaSailRepositoryConnection.java
@@ -19,24 +19,21 @@ package org.apache.rya.rdftriplestore;
* under the License.
*/
-
-
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import org.apache.rya.rdftriplestore.utils.CombineContextsRdfInserter;
-
-import org.openrdf.OpenRDFUtil;
-import org.openrdf.model.Resource;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.repository.util.RDFLoader;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.sail.SailConnection;
+import org.eclipse.rdf4j.OpenRDFUtil;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.repository.util.RDFLoader;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.sail.SailConnection;
/**
* The real reason for this is so that we can combine contexts from an input stream/reader and the given contexts in the add function
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalBatchingIterator.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalBatchingIterator.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalBatchingIterator.java
index 606c1fb..93f847d 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalBatchingIterator.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalBatchingIterator.java
@@ -19,14 +19,11 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
public interface ExternalBatchingIterator {
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(Collection<BindingSet> bindingset) throws QueryEvaluationException;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalMultipleBindingSetsIterator.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalMultipleBindingSetsIterator.java b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalMultipleBindingSetsIterator.java
index c36ef68..812d2af 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalMultipleBindingSetsIterator.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/evaluation/ExternalMultipleBindingSetsIterator.java
@@ -19,18 +19,14 @@ package org.apache.rya.rdftriplestore.evaluation;
* under the License.
*/
-
-
-import info.aduna.iteration.CloseableIteration;
-import info.aduna.iteration.LookAheadIteration;
-
import java.util.ArrayList;
import java.util.Collection;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.common.iteration.LookAheadIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
/**
*/
[44/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
index b25864e..a9f86b1 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
@@ -34,7 +34,7 @@ import org.apache.rya.accumulo.RyaTableMutationsFactory;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -111,14 +111,14 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 20; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
RyaStatement rs4 = null;
if(i == 5 || i == 15) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
- rs4 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs4 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -246,13 +246,13 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -370,13 +370,13 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -484,13 +484,13 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -596,13 +596,13 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -710,13 +710,13 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -825,18 +825,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1002,18 +1002,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:cq1"), new RyaURI("uri:cf1"), new RyaURI("uri:" + i ), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:cq1"), new RyaIRI("uri:cf1"), new RyaIRI("uri:" + i ), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1176,18 +1176,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1356,18 +1356,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1538,18 +1538,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1717,12 +1717,12 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
RyaStatement rs7 = null;
@@ -1730,10 +1730,10 @@ public class AccumuloDocIndexerTest {
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
- rs7 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(100+i)), new RyaURI("uri:joe"));
- rs8 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(100+i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
+ rs7 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(100+i)), new RyaIRI("uri:joe"));
+ rs8 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(100+i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
@@ -1923,18 +1923,18 @@ public class AccumuloDocIndexerTest {
for (int i = 0; i < 30; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:joe"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:joe"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:joe"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:joe"));
RyaStatement rs3 = null;
- RyaStatement rs4 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaURI("uri:cq1"), new RyaURI("uri:hank"));
- RyaStatement rs5 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaURI("uri:hank"));
+ RyaStatement rs4 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaIRI("uri:cq1"), new RyaIRI("uri:hank"));
+ RyaStatement rs5 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"), new RyaIRI("uri:hank"));
RyaStatement rs6 = null;
if(i == 5 || i == 10 || i == 15 || i == 20 || i == 25) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:joe"));
- rs6 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaURI("uri:hank"));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:joe"));
+ rs6 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)), new RyaIRI("uri:hank"));
}
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, Collection<Mutation>> serialize1 = rtm.serialize(rs1);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
index 79fd2c2..3111510 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
@@ -30,7 +30,7 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
@@ -72,10 +72,10 @@ public class EntityCentricIndexTest {
DELIM_BYTES, subjectStr.getBytes(), objectBytes[1]),
visibilityBytes, timestamp);
ryaStatement = new RyaStatement(
- new RyaURI(subjectStr),
- new RyaURI(predicateStr),
+ new RyaIRI(subjectStr),
+ new RyaIRI(predicateStr),
new RyaType(XMLSchema.INTEGER, "3"),
- new RyaURI(contextStr),
+ new RyaIRI(contextStr),
null, visibilityBytes, valueBytes, timestamp);
value = new Value(valueBytes);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
index 62396e4..f6c29a4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexerTest.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.StatementConstraints;
@@ -191,20 +191,20 @@ public class AccumuloFreeTextIndexerTest {
f.init();
// These should not be stored because they are not in the predicate list
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj1"), new RyaURI(RDFS.LABEL.toString()), new RyaType("invalid")));
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj2"), new RyaURI(RDFS.COMMENT.toString()), new RyaType("invalid")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj1"), new RyaIRI(RDFS.LABEL.toString()), new RyaType("invalid")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj2"), new RyaIRI(RDFS.COMMENT.toString()), new RyaType("invalid")));
- RyaURI pred1 = new RyaURI("pred:1");
- RyaURI pred2 = new RyaURI("pred:2");
+ RyaIRI pred1 = new RyaIRI("pred:1");
+ RyaIRI pred2 = new RyaIRI("pred:2");
// These should be stored because they are in the predicate list
- RyaStatement s3 = new RyaStatement(new RyaURI("foo:subj3"), pred1, new RyaType("valid"));
- RyaStatement s4 = new RyaStatement(new RyaURI("foo:subj4"), pred2, new RyaType("valid"));
+ RyaStatement s3 = new RyaStatement(new RyaIRI("foo:subj3"), pred1, new RyaType("valid"));
+ RyaStatement s4 = new RyaStatement(new RyaIRI("foo:subj4"), pred2, new RyaType("valid"));
f.storeStatement(s3);
f.storeStatement(s4);
// This should not be stored because the object is not a literal
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj5"), pred1, new RyaURI("in:valid")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj5"), pred1, new RyaIRI("in:valid")));
f.flush();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
index c5b7fa1..833858a 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/query/EntityQueryNodeIT.java
@@ -26,7 +26,7 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.entity.model.Entity;
@@ -56,18 +56,18 @@ import com.google.common.collect.ImmutableSet;
public class EntityQueryNodeIT extends MongoITBase {
private static final Type PERSON_TYPE =
- new Type(new RyaURI("urn:person"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:age"))
- .add(new RyaURI("urn:eye"))
+ new Type(new RyaIRI("urn:person"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:age"))
+ .add(new RyaIRI("urn:eye"))
.build());
private static final Type EMPLOYEE_TYPE =
- new Type(new RyaURI("urn:employee"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:hoursPerWeek"))
+ new Type(new RyaIRI("urn:employee"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:hoursPerWeek"))
.build());
@Test(expected = IllegalStateException.class)
@@ -154,13 +154,13 @@ public class EntityQueryNodeIT extends MongoITBase {
public void evaluate_constantSubject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
final ValueFactory vf = SimpleValueFactory.getInstance();
- final RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
+ final RyaIRI subject = new RyaIRI("urn:SSN:111-11-1111");
final Entity entity = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
storage.create(entity);
@@ -189,22 +189,22 @@ public class EntityQueryNodeIT extends MongoITBase {
public void evaluate_variableSubject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
final ValueFactory vf = SimpleValueFactory.getInstance();
- RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
+ RyaIRI subject = new RyaIRI("urn:SSN:111-11-1111");
final Entity bob = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
- subject = new RyaURI("urn:SSN:222-22-2222");
+ subject = new RyaIRI("urn:SSN:222-22-2222");
final Entity fred = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(25)))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("brown"))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Fred"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(25)))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("brown"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Fred"))))
.build();
storage.create(bob);
@@ -242,13 +242,13 @@ public class EntityQueryNodeIT extends MongoITBase {
public void evaluate_constantObject() throws Exception {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), "testDB");
final ValueFactory vf = SimpleValueFactory.getInstance();
- final RyaURI subject = new RyaURI("urn:SSN:111-11-1111");
+ final RyaIRI subject = new RyaIRI("urn:SSN:111-11-1111");
final Entity entity = Entity.builder()
.setSubject(subject)
.setExplicitType(PERSON_TYPE.getId())
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
- .setProperty(PERSON_TYPE.getId(), new Property(new RyaURI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:age"), RdfToRyaConversions.convertLiteral(vf.createLiteral(BigInteger.valueOf(20)))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:eye"), RdfToRyaConversions.convertLiteral(vf.createLiteral("blue"))))
+ .setProperty(PERSON_TYPE.getId(), new Property(new RyaIRI("urn:name"), RdfToRyaConversions.convertLiteral(vf.createLiteral("Bob"))))
.build();
storage.create(entity);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
index b124470..bdc67ae 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverterTest.java
@@ -21,7 +21,7 @@ package org.apache.rya.indexing.entity.storage.mongo;
import static org.junit.Assert.assertEquals;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
@@ -38,14 +38,14 @@ public class EntityDocumentConverterTest {
public void to_and_from_document() throws DocumentConverterException {
// Convert an Entity into a Document.
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:alice"))
+ .setSubject(new RyaIRI("urn:alice"))
// Add some explicily typed properties.
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType("blue")))
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType("blue")))
// Add some implicitly typed properties.
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:hours"), new RyaType(XMLSchema.INT, "40")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:employer"), new RyaType("Burger Joint")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:hours"), new RyaType(XMLSchema.INT, "40")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:employer"), new RyaType("Burger Joint")))
.build();
final Document document = new EntityDocumentConverter().toDocument(entity);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
index cec989e..67595a9 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorageIT.java
@@ -27,7 +27,7 @@ import java.util.Optional;
import java.util.Set;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -54,10 +54,10 @@ public class MongoEntityStorageIT extends MongoITBase {
public void create_and_get() throws Exception {
// An Entity that will be stored.
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
.build();
// Create it.
@@ -65,7 +65,7 @@ public class MongoEntityStorageIT extends MongoITBase {
storage.create(entity);
// Get it.
- final Optional<Entity> storedEntity = storage.get(new RyaURI("urn:GTIN-14/00012345600012"));
+ final Optional<Entity> storedEntity = storage.get(new RyaIRI("urn:GTIN-14/00012345600012"));
// Verify the correct value was returned.
assertEquals(entity, storedEntity.get());
@@ -75,10 +75,10 @@ public class MongoEntityStorageIT extends MongoITBase {
public void can_not_create_with_same_subject() throws Exception {
// A Type that will be stored.
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
.build();
// Create it.
@@ -99,7 +99,7 @@ public class MongoEntityStorageIT extends MongoITBase {
public void get_noneExisting() throws Exception {
// Get a Type that hasn't been created.
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final Optional<Entity> storedEntity = storage.get(new RyaURI("urn:GTIN-14/00012345600012"));
+ final Optional<Entity> storedEntity = storage.get(new RyaIRI("urn:GTIN-14/00012345600012"));
// Verify nothing was returned.
assertFalse(storedEntity.isPresent());
@@ -109,10 +109,10 @@ public class MongoEntityStorageIT extends MongoITBase {
public void delete() throws Exception {
// An Entity that will be stored.
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
.build();
// Create it.
@@ -120,7 +120,7 @@ public class MongoEntityStorageIT extends MongoITBase {
storage.create(entity);
// Delete it.
- final boolean deleted = storage.delete( new RyaURI("urn:GTIN-14/00012345600012") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:GTIN-14/00012345600012") );
// Verify a document was deleted.
assertTrue( deleted );
@@ -130,7 +130,7 @@ public class MongoEntityStorageIT extends MongoITBase {
public void delete_nonExisting() throws Exception {
// Delete an Entity that has not been created.
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final boolean deleted = storage.delete( new RyaURI("urn:GTIN-14/00012345600012") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:GTIN-14/00012345600012") );
// Verify no document was deleted.
assertFalse( deleted );
@@ -141,50 +141,50 @@ public class MongoEntityStorageIT extends MongoITBase {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
// The Type we will search by.
- final Type icecreamType = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type icecreamType = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
// Some Person typed entities.
final Entity alice = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/111-11-1111") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/111-11-1111") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
final Entity bob = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/222-22-2222") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "57")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/222-22-2222") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "57")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
// Some Icecream typed objects.
final Entity chocolateIcecream = Entity.builder()
- .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
.build();
final Entity vanillaIcecream = Entity.builder()
- .setSubject( new RyaURI("urn:GTIN-14/22356325213432") )
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Vanilla")))
+ .setSubject( new RyaIRI("urn:GTIN-14/22356325213432") )
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Vanilla")))
.build();
final Entity strawberryIcecream = Entity.builder()
- .setSubject( new RyaURI("urn:GTIN-14/77544325436721") )
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Strawberry")))
+ .setSubject( new RyaIRI("urn:GTIN-14/77544325436721") )
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Strawberry")))
.build();
// Create the objects in the storage.
@@ -204,8 +204,8 @@ public class MongoEntityStorageIT extends MongoITBase {
// Verify the expected results were returned.
final Set<TypedEntity> expected = Sets.newHashSet(
- chocolateIcecream.makeTypedEntity(new RyaURI("urn:icecream")).get(),
- vanillaIcecream.makeTypedEntity(new RyaURI("urn:icecream")).get());
+ chocolateIcecream.makeTypedEntity(new RyaIRI("urn:icecream")).get(),
+ vanillaIcecream.makeTypedEntity(new RyaIRI("urn:icecream")).get());
assertEquals(expected, objects);
}
@@ -214,67 +214,67 @@ public class MongoEntityStorageIT extends MongoITBase {
final EntityStorage storage = new MongoEntityStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
// A Type that defines a Person.
- final Type personType = new Type(new RyaURI("urn:person"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:age"))
- .add(new RyaURI("urn:eye"))
+ final Type personType = new Type(new RyaIRI("urn:person"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:age"))
+ .add(new RyaIRI("urn:eye"))
.build());
// Some Person typed objects.
final Entity alice = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/111-11-1111") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/111-11-1111") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
final Entity bob = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/222-22-2222") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "57")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/222-22-2222") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "57")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
final Entity charlie = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/333-33-3333") )
- .setExplicitType( new RyaURI("urn:person") )
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Charlie")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/333-33-3333") )
+ .setExplicitType( new RyaIRI("urn:person") )
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Charlie")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
final Entity david = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/444-44-4444") )
- .setExplicitType( new RyaURI("urn:person") )
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "David")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
+ .setSubject( new RyaIRI("urn:SSN/444-44-4444") )
+ .setExplicitType( new RyaIRI("urn:person") )
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "David")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
.build();
final Entity eve = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/555-55-5555") )
- .setExplicitType( new RyaURI("urn:person") )
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Eve")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setSubject( new RyaIRI("urn:SSN/555-55-5555") )
+ .setExplicitType( new RyaIRI("urn:person") )
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Eve")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
.build();
final Entity frank = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/666-66-6666") )
- .setExplicitType( new RyaURI("urn:person") )
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Frank")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
- .setProperty(new RyaURI("urn:someOtherType"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setSubject( new RyaIRI("urn:SSN/666-66-6666") )
+ .setExplicitType( new RyaIRI("urn:person") )
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Frank")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setProperty(new RyaIRI("urn:someOtherType"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
.build();
final Entity george = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/777-77-7777") )
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "George")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/777-77-7777") )
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "George")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
// Create the objects in the storage.
@@ -290,8 +290,8 @@ public class MongoEntityStorageIT extends MongoITBase {
final Set<TypedEntity> objects = new HashSet<>();
final Set<Property> searchValues = Sets.newHashSet(
- new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")),
- new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")));
+ new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")),
+ new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")));
try(final ConvertingCursor<TypedEntity> it = storage.search(Optional.empty(), personType, searchValues)) {
while(it.hasNext()) {
@@ -301,8 +301,8 @@ public class MongoEntityStorageIT extends MongoITBase {
// Verify the expected results were returned.
assertEquals(2, objects.size());
- assertTrue(objects.contains(alice.makeTypedEntity(new RyaURI("urn:person")).get()));
- assertTrue(objects.contains(charlie.makeTypedEntity(new RyaURI("urn:person")).get()));
+ assertTrue(objects.contains(alice.makeTypedEntity(new RyaIRI("urn:person")).get()));
+ assertTrue(objects.contains(charlie.makeTypedEntity(new RyaIRI("urn:person")).get()));
}
@Test
@@ -311,29 +311,29 @@ public class MongoEntityStorageIT extends MongoITBase {
// Store Alice in the repository.
final Entity alice = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/111-11-1111") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/111-11-1111") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
storage.create(alice);
// Show Alice was stored.
- Optional<Entity> latest = storage.get(new RyaURI("urn:SSN/111-11-1111"));
+ Optional<Entity> latest = storage.get(new RyaIRI("urn:SSN/111-11-1111"));
assertEquals(alice, latest.get());
// Change Alice's eye color to brown.
final Entity updated = Entity.builder(alice)
.setVersion(latest.get().getVersion() + 1)
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
.build();
storage.update(alice, updated);
// Fetch the Alice object and ensure it has the new value.
- latest = storage.get(new RyaURI("urn:SSN/111-11-1111"));
+ latest = storage.get(new RyaIRI("urn:SSN/111-11-1111"));
assertEquals(updated, latest.get());
}
@@ -344,17 +344,17 @@ public class MongoEntityStorageIT extends MongoITBase {
// Store Alice in the repository.
final Entity alice = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/111-11-1111") )
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setSubject( new RyaIRI("urn:SSN/111-11-1111") )
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.build();
storage.create(alice);
// Show Alice was stored.
- final Optional<Entity> latest = storage.get(new RyaURI("urn:SSN/111-11-1111"));
+ final Optional<Entity> latest = storage.get(new RyaIRI("urn:SSN/111-11-1111"));
assertEquals(alice, latest.get());
// Create the wrong old state and try to change Alice's eye color to brown.
@@ -364,7 +364,7 @@ public class MongoEntityStorageIT extends MongoITBase {
final Entity updated = Entity.builder(alice)
.setVersion(501)
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "brown")))
.build();
storage.update(wrongOld, updated);
@@ -374,13 +374,13 @@ public class MongoEntityStorageIT extends MongoITBase {
public void update_differentSubjects() throws Exception {
// Two objects that do not have the same Subjects.
final Entity old = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/111-11-1111") )
- .setExplicitType( new RyaURI("urn:person") )
+ .setSubject( new RyaIRI("urn:SSN/111-11-1111") )
+ .setExplicitType( new RyaIRI("urn:person") )
.build();
final Entity updated = Entity.builder()
- .setSubject( new RyaURI("urn:SSN/222-22-2222") )
- .setExplicitType( new RyaURI("urn:person") )
+ .setSubject( new RyaIRI("urn:SSN/222-22-2222") )
+ .setExplicitType( new RyaIRI("urn:person") )
.build();
// The update will fail.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java
index 8212dbf..d3342c0 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorageIT.java
@@ -26,7 +26,7 @@ import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.storage.TypeStorage;
import org.apache.rya.indexing.entity.storage.TypeStorage.TypeStorageException;
@@ -46,11 +46,11 @@ public class MongoTypeStorageIT extends MongoITBase {
@Test
public void create_and_get() throws TypeStorageException {
// A Type that will be stored.
- final Type type = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type type = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
// Create it.
@@ -58,7 +58,7 @@ public class MongoTypeStorageIT extends MongoITBase {
storage.create(type);
// Get it.
- final Optional<Type> storedType = storage.get(new RyaURI("urn:icecream"));
+ final Optional<Type> storedType = storage.get(new RyaIRI("urn:icecream"));
// Verify the correct value was returned.
assertEquals(type, storedType.get());
@@ -67,11 +67,11 @@ public class MongoTypeStorageIT extends MongoITBase {
@Test
public void can_not_create_with_same_id() throws TypeStorageException {
// A Type that will be stored.
- final Type type = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type type = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
// Create it.
@@ -92,7 +92,7 @@ public class MongoTypeStorageIT extends MongoITBase {
public void get_nonexisting() throws TypeStorageException {
// Get a Type that hasn't been created.
final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final Optional<Type> storedType = storage.get(new RyaURI("urn:icecream"));
+ final Optional<Type> storedType = storage.get(new RyaIRI("urn:icecream"));
// Verify nothing was returned.
assertFalse(storedType.isPresent());
@@ -101,11 +101,11 @@ public class MongoTypeStorageIT extends MongoITBase {
@Test
public void delete() throws TypeStorageException {
// An Type that will be stored.
- final Type type = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type type = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
// Create it.
@@ -113,7 +113,7 @@ public class MongoTypeStorageIT extends MongoITBase {
storage.create(type);
// Delete it.
- final boolean deleted = storage.delete( new RyaURI("urn:icecream") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:icecream") );
// Verify a document was deleted.
assertTrue( deleted );
@@ -123,7 +123,7 @@ public class MongoTypeStorageIT extends MongoITBase {
public void delete_nonexisting() throws TypeStorageException {
// Delete an Type that has not been created.
final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final boolean deleted = storage.delete( new RyaURI("urn:icecream") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:icecream") );
// Verify no document was deleted.
assertFalse( deleted );
@@ -132,25 +132,25 @@ public class MongoTypeStorageIT extends MongoITBase {
@Test
public void search() throws Exception {
// Add some Types to the storage.
- final Type cat = new Type(new RyaURI("urn:cat"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:numLegs"))
- .add(new RyaURI("urn:eye"))
- .add(new RyaURI("urn:species"))
+ final Type cat = new Type(new RyaIRI("urn:cat"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:numLegs"))
+ .add(new RyaIRI("urn:eye"))
+ .add(new RyaIRI("urn:species"))
.build());
- final Type dog = new Type(new RyaURI("urn:dog"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:numLegs"))
- .add(new RyaURI("urn:eye"))
- .add(new RyaURI("urn:species"))
+ final Type dog = new Type(new RyaIRI("urn:dog"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:numLegs"))
+ .add(new RyaIRI("urn:eye"))
+ .add(new RyaIRI("urn:species"))
.build());
- final Type icecream = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type icecream = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
final TypeStorage storage = new MongoTypeStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
@@ -159,7 +159,7 @@ public class MongoTypeStorageIT extends MongoITBase {
storage.create(icecream);
// Search for all Types that have the 'urn:eye' property.
- final ConvertingCursor<Type> typeIt = storage.search(new RyaURI("urn:eye"));
+ final ConvertingCursor<Type> typeIt = storage.search(new RyaIRI("urn:eye"));
final Set<Type> types = new HashSet<>();
while(typeIt.hasNext()) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java
index 4c795c2..6c8c1d4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverterTest.java
@@ -20,7 +20,7 @@ package org.apache.rya.indexing.entity.storage.mongo;
import static org.junit.Assert.assertEquals;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
import org.bson.Document;
@@ -37,11 +37,11 @@ public class TypeDocumentConverterTest {
@Test
public void toDocument() {
// Convert a Type into a Document.
- final Type type = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type type = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
final Document document = new TypeDocumentConverter().toDocument(type);
@@ -61,11 +61,11 @@ public class TypeDocumentConverterTest {
final Type type = new TypeDocumentConverter().fromDocument(document);
// Show the converted value has the expected structure.
- final Type expected = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type expected = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
assertEquals(expected, type);
}
[22/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
index 1503b53..c169dac 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPCJIndexIT.java
@@ -33,21 +33,21 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
public class MongoPCJIndexIT extends MongoITBase {
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
protected void updateConfiguration(final MongoDBRdfConfiguration conf) {
@@ -96,27 +96,27 @@ public class MongoPCJIndexIT extends MongoITBase {
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Alice"));
+ bs.addBinding("name", VF.createIRI("urn:Alice"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Bob"));
+ bs.addBinding("name", VF.createIRI("urn:Bob"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Charlie"));
+ bs.addBinding("name", VF.createIRI("urn:Charlie"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:David"));
+ bs.addBinding("name", VF.createIRI("urn:David"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Eve"));
+ bs.addBinding("name", VF.createIRI("urn:Eve"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Frank"));
+ bs.addBinding("name", VF.createIRI("urn:Frank"));
expectedResults.add(bs);
assertEquals(6, results.size());
@@ -173,15 +173,15 @@ public class MongoPCJIndexIT extends MongoITBase {
MapBindingSet bs = new MapBindingSet();
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:David"));
+ bs.addBinding("name", VF.createIRI("urn:David"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Eve"));
+ bs.addBinding("name", VF.createIRI("urn:Eve"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", VF.createURI("urn:Frank"));
+ bs.addBinding("name", VF.createIRI("urn:Frank"));
expectedResults.add(bs);
assertEquals(3, results.size());
@@ -202,32 +202,32 @@ public class MongoPCJIndexIT extends MongoITBase {
private Set<Statement> getStatements() throws Exception {
final Set<Statement> statements = new HashSet<>();
- statements.add(VF.createStatement(VF.createURI("urn:Alice"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Bob"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Charlie"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:David"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Eve"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Frank"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:George"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Hillary"), VF.createURI("urn:likes"), VF.createURI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Alice"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Bob"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Charlie"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:David"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Eve"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Frank"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:George"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Hillary"), VF.createIRI("urn:likes"), VF.createIRI("urn:icecream")));
- statements.add(VF.createStatement(VF.createURI("urn:Alice"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Bob"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Charlie"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:David"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Eve"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Frank"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:George"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:green")));
- statements.add(VF.createStatement(VF.createURI("urn:Hillary"), VF.createURI("urn:hasEyeColor"), VF.createURI("urn:brown")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Alice"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Bob"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Charlie"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:David"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Eve"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Frank"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:George"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:green")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Hillary"), VF.createIRI("urn:hasEyeColor"), VF.createIRI("urn:brown")));
- statements.add(VF.createStatement(VF.createURI("urn:Alice"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Bob"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:Charlie"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:blue")));
- statements.add(VF.createStatement(VF.createURI("urn:David"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:brown")));
- statements.add(VF.createStatement(VF.createURI("urn:Eve"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:brown")));
- statements.add(VF.createStatement(VF.createURI("urn:Frank"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:brown")));
- statements.add(VF.createStatement(VF.createURI("urn:George"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:blonde")));
- statements.add(VF.createStatement(VF.createURI("urn:Hillary"), VF.createURI("urn:hasHairColor"), VF.createURI("urn:blonde")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Alice"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Bob"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Charlie"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:blue")));
+ statements.add(VF.createStatement(VF.createIRI("urn:David"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:brown")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Eve"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:brown")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Frank"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:brown")));
+ statements.add(VF.createStatement(VF.createIRI("urn:George"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:blonde")));
+ statements.add(VF.createStatement(VF.createIRI("urn:Hillary"), VF.createIRI("urn:hasHairColor"), VF.createIRI("urn:blonde")));
return statements;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPcjIntegrationTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPcjIntegrationTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPcjIntegrationTest.java
index af81cf6..ea58d11 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPcjIntegrationTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoPcjIntegrationTest.java
@@ -38,42 +38,44 @@ import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
import com.google.common.collect.Lists;
public class MongoPcjIntegrationTest extends MongoITBase {
- private static final URI talksTo = new URIImpl("uri:talksTo");
- private static final URI sub = new URIImpl("uri:entity");
- private static final URI sub2 = new URIImpl("uri:entity2");
- private static final URI subclass = new URIImpl("uri:class");
- private static final URI subclass2 = new URIImpl("uri:class2");
- private static final URI obj = new URIImpl("uri:obj");
- private static final URI obj2 = new URIImpl("uri:obj2");
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
+ private static final IRI talksTo = VF.createIRI("uri:talksTo");
+ private static final IRI sub = VF.createIRI("uri:entity");
+ private static final IRI sub2 = VF.createIRI("uri:entity2");
+ private static final IRI subclass = VF.createIRI("uri:class");
+ private static final IRI subclass2 = VF.createIRI("uri:class2");
+ private static final IRI obj = VF.createIRI("uri:obj");
+ private static final IRI obj2 = VF.createIRI("uri:obj2");
private void addPCJS(final SailRepositoryConnection conn) throws Exception {
conn.add(sub, RDF.TYPE, subclass);
- conn.add(sub, RDFS.LABEL, new LiteralImpl("label"));
+ conn.add(sub, RDFS.LABEL, VF.createLiteral("label"));
conn.add(sub, talksTo, obj);
conn.add(sub2, RDF.TYPE, subclass2);
- conn.add(sub2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(sub2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub2, talksTo, obj2);
}
@@ -135,13 +137,13 @@ public class MongoPcjIntegrationTest extends MongoITBase {
final SailRepositoryConnection pcjConn = new SailRepository(pcjSail).getConnection();
addPCJS(pcjConn);
try {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -178,13 +180,13 @@ public class MongoPcjIntegrationTest extends MongoITBase {
final SailRepositoryConnection pcjConn = new SailRepository(pcjSail).getConnection();
addPCJS(pcjConn);
try {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
final String indexSparqlString = ""//
+ "SELECT ?dog ?pig ?duck " //
@@ -252,17 +254,17 @@ public class MongoPcjIntegrationTest extends MongoITBase {
final SailRepositoryConnection pcjConn = new SailRepository(pcjSail).getConnection();
addPCJS(pcjConn);
try {
- final URI superclass = new URIImpl("uri:superclass");
- final URI superclass2 = new URIImpl("uri:superclass2");
+ final IRI superclass = VF.createIRI("uri:superclass");
+ final IRI superclass2 = VF.createIRI("uri:superclass2");
- final URI howlsAt = new URIImpl("uri:howlsAt");
- final URI subType = new URIImpl("uri:subType");
- final URI superSuperclass = new URIImpl("uri:super_superclass");
+ final IRI howlsAt = VF.createIRI("uri:howlsAt");
+ final IRI subType = VF.createIRI("uri:subType");
+ final IRI superSuperclass = VF.createIRI("uri:super_superclass");
conn.add(subclass, RDF.TYPE, superclass);
conn.add(subclass2, RDF.TYPE, superclass2);
- conn.add(obj, RDFS.LABEL, new LiteralImpl("label"));
- conn.add(obj2, RDFS.LABEL, new LiteralImpl("label2"));
+ conn.add(obj, RDFS.LABEL, VF.createLiteral("label"));
+ conn.add(obj2, RDFS.LABEL, VF.createLiteral("label2"));
conn.add(sub, howlsAt, superclass);
conn.add(superclass, subType, superSuperclass);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoTemporalIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoTemporalIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoTemporalIndexerIT.java
index e92bcbb..5a7598e 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoTemporalIndexerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoTemporalIndexerIT.java
@@ -40,14 +40,14 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.mongodb.temporal.MongoTemporalIndexer;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.QueryEvaluationException;
import com.mongodb.DB;
import com.mongodb.DBCollection;
@@ -56,8 +56,6 @@ import com.mongodb.DBObject;
import com.mongodb.MongoException;
import com.mongodb.MongoSecurityException;
-import info.aduna.iteration.CloseableIteration;
-
/**
* JUnit tests for TemporalIndexer and it's implementation MongoTemporalIndexer
*
@@ -138,23 +136,23 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
static {
// Setup the statements only once. Each test will store some of these in there own index table.
- final ValueFactory vf = new ValueFactoryImpl();
- final URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
// tiB03_E20 read as: time interval that Begins 3 seconds, ends at 20 seconds,
// Each time element the same, except seconds. year, month, .... minute are the same for each statement below.
- spo_B00_E01 = new StatementImpl(vf.createURI("foo:event0"), pred1_atTime, vf.createLiteral(tvB00_E01.toString()));
- spo_B02_E29 = new StatementImpl(vf.createURI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E29.toString()));
- spo_B02_E30 = new StatementImpl(vf.createURI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E30.toString()));
- spo_B02_E31 = new StatementImpl(vf.createURI("foo:event3"), pred1_atTime, vf.createLiteral(tvB02_E31.toString()));
- spo_B02_E40 = new StatementImpl(vf.createURI("foo:event4"), pred1_atTime, vf.createLiteral(tvB02_E40.toString()));
- spo_B03_E20 = new StatementImpl(vf.createURI("foo:event5"), pred1_atTime, vf.createLiteral(tvB03_E20.toString()));
- spo_B29_E30 = new StatementImpl(vf.createURI("foo:event1"), pred1_atTime, vf.createLiteral(tvB29_E30.toString()));
- spo_B30_E32 = new StatementImpl(vf.createURI("foo:event1"), pred1_atTime, vf.createLiteral(tvB30_E32.toString()));
- spo_B02 = new StatementImpl(vf.createURI("foo:event6"), pred1_atTime, vf.createLiteral(tsB02.getAsReadable()));
+ spo_B00_E01 = vf.createStatement(vf.createIRI("foo:event0"), pred1_atTime, vf.createLiteral(tvB00_E01.toString()));
+ spo_B02_E29 = vf.createStatement(vf.createIRI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E29.toString()));
+ spo_B02_E30 = vf.createStatement(vf.createIRI("foo:event2"), pred1_atTime, vf.createLiteral(tvB02_E30.toString()));
+ spo_B02_E31 = vf.createStatement(vf.createIRI("foo:event3"), pred1_atTime, vf.createLiteral(tvB02_E31.toString()));
+ spo_B02_E40 = vf.createStatement(vf.createIRI("foo:event4"), pred1_atTime, vf.createLiteral(tvB02_E40.toString()));
+ spo_B03_E20 = vf.createStatement(vf.createIRI("foo:event5"), pred1_atTime, vf.createLiteral(tvB03_E20.toString()));
+ spo_B29_E30 = vf.createStatement(vf.createIRI("foo:event1"), pred1_atTime, vf.createLiteral(tvB29_E30.toString()));
+ spo_B30_E32 = vf.createStatement(vf.createIRI("foo:event1"), pred1_atTime, vf.createLiteral(tvB30_E32.toString()));
+ spo_B02 = vf.createStatement(vf.createIRI("foo:event6"), pred1_atTime, vf.createLiteral(tsB02.getAsReadable()));
// Create statements about time instants 0 - 40 seconds
for (int i = 0; i < seriesTs.length; i++) {
- seriesSpo[i] = new StatementImpl(vf.createURI("foo:event0" + i), pred1_atTime, vf.createLiteral(seriesTs[i].getAsReadable()));
+ seriesSpo[i] = vf.createStatement(vf.createIRI("foo:event0" + i), pred1_atTime, vf.createLiteral(seriesTs[i].getAsReadable()));
}
}
@@ -169,7 +167,7 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
}
/**
- * Test method for {@link MongoTemporalIndexer#storeStatement(convertStatement(org.openrdf.model.Statement)}
+ * Test method for {@link MongoTemporalIndexer#storeStatement(convertStatement(org.eclipse.rdf4j.model.Statement)}
*/
@Test
public void testStoreStatement() throws IOException {
@@ -177,17 +175,17 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
tIndexer.setConf(conf);
tIndexer.init();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
- final URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
- final URI pred2_circa = vf.createURI(URI_PROPERTY_CIRCA);
+ final IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
+ final IRI pred2_circa = vf.createIRI(URI_PROPERTY_CIRCA);
// Should not be stored because they are not in the predicate list
final String validDateStringWithThirteens = "1313-12-13T13:13:13Z";
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), RDFS.LABEL, vf.createLiteral(validDateStringWithThirteens))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), RDFS.LABEL, vf.createLiteral(validDateStringWithThirteens))));
final String invalidDateString = "ThisIsAnInvalidDate";
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), pred1_atTime, vf.createLiteral(invalidDateString))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), pred1_atTime, vf.createLiteral(invalidDateString))));
// These are different datetimes instant but from different time zones.
// This is an arbitrary zone, BRST=Brazil, better if not local.
@@ -198,13 +196,13 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
// These should be stored because they are in the predicate list.
// BUT they will get converted to the same exact datetime in UTC.
- final Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
- final Statement s4 = new StatementImpl(vf.createURI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
+ final Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
+ final Statement s4 = vf.createStatement(vf.createIRI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
tIndexer.storeStatement(convertStatement(s3));
tIndexer.storeStatement(convertStatement(s4));
// This should not be stored because the object is not a literal
- tIndexer.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj5"), pred1_atTime, vf.createURI("in:valid"))));
+ tIndexer.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj5"), pred1_atTime, vf.createIRI("in:valid"))));
printTables(tIndexer, "junit testing: Temporal entities stored in testStoreStatement");
assertEquals(2, tIndexer.getCollection().find().count());
@@ -217,18 +215,18 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
tIndexer.setConf(conf);
tIndexer.init();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
- final URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
- final URI pred2_circa = vf.createURI(URI_PROPERTY_CIRCA);
+ final IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
+ final IRI pred2_circa = vf.createIRI(URI_PROPERTY_CIRCA);
final String testDate2014InBRST = "2014-12-31T23:59:59-02:00";
final String testDate2016InET = "2016-12-31T20:59:59-05:00";
// These should be stored because they are in the predicate list.
// BUT they will get converted to the same exact datetime in UTC.
- final Statement s1 = new StatementImpl(vf.createURI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
- final Statement s2 = new StatementImpl(vf.createURI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
+ final Statement s1 = vf.createStatement(vf.createIRI("foo:subj3"), pred1_atTime, vf.createLiteral(testDate2014InBRST));
+ final Statement s2 = vf.createStatement(vf.createIRI("foo:subj4"), pred2_circa, vf.createLiteral(testDate2016InET));
tIndexer.storeStatement(convertStatement(s1));
tIndexer.storeStatement(convertStatement(s2));
@@ -649,15 +647,15 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
tIndexer.storeStatement(convertStatement(seriesSpo[s]));
}
- final ValueFactory vf = new ValueFactoryImpl();
- final URI pred3_CIRCA_ = vf.createURI(URI_PROPERTY_CIRCA); // this one to ignore.
- final URI pred2_eventTime = vf.createURI(URI_PROPERTY_EVENT_TIME);
- final URI pred1_atTime = vf.createURI(URI_PROPERTY_AT_TIME);
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final IRI pred3_CIRCA_ = vf.createIRI(URI_PROPERTY_CIRCA); // this one to ignore.
+ final IRI pred2_eventTime = vf.createIRI(URI_PROPERTY_EVENT_TIME);
+ final IRI pred1_atTime = vf.createIRI(URI_PROPERTY_AT_TIME);
// add the predicate = EventTime ; Store in an array for verification.
final Statement[] SeriesTs_EventTime = new Statement[expectedResultCount+1];
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
- final Statement statement = new StatementImpl(vf.createURI("foo:EventTimeSubj0" + s), pred2_eventTime, vf.createLiteral(seriesTs[s].getAsReadable()));
+ final Statement statement = vf.createStatement(vf.createIRI("foo:EventTimeSubj0" + s), pred2_eventTime, vf.createLiteral(seriesTs[s].getAsReadable()));
tIndexer.storeStatement(convertStatement(statement));
if (s>searchForSeconds) {
SeriesTs_EventTime[s - searchForSeconds -1 ] = statement;
@@ -665,7 +663,7 @@ public final class MongoTemporalIndexerIT extends MongoITBase {
}
// add the predicate = CIRCA ; to be ignored because it is not in the constraints.
for (int s = 0; s <= searchForSeconds + expectedResultCount; s++) { // <== logic here
- final Statement statement = new StatementImpl(vf.createURI("foo:CircaEventSubj0" + s), pred3_CIRCA_, vf.createLiteral(seriesTs[s].getAsReadable()));
+ final Statement statement = vf.createStatement(vf.createIRI("foo:CircaEventSubj0" + s), pred3_CIRCA_, vf.createLiteral(seriesTs[s].getAsReadable()));
tIndexer.storeStatement(convertStatement(statement));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/FlattenedOptionalTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/FlattenedOptionalTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/FlattenedOptionalTest.java
index 8f2cb8c..4136ab7 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/FlattenedOptionalTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/FlattenedOptionalTest.java
@@ -17,20 +17,21 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.List;
import org.apache.rya.indexing.external.matching.FlattenedOptional;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class FlattenedOptionalTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentPCJMatcherTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentPCJMatcherTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentPCJMatcherTest.java
index 8e61840..3258c02 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentPCJMatcherTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentPCJMatcherTest.java
@@ -18,7 +18,7 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -27,19 +27,19 @@ import org.apache.rya.indexing.external.matching.ExternalSetMatcher;
import org.apache.rya.indexing.external.matching.QuerySegmentFactory;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class JoinSegmentPCJMatcherTest {
@@ -139,7 +139,7 @@ public class JoinSegmentPCJMatcherTest {
- static class QueryNodeGatherer extends QueryModelVisitorBase<RuntimeException> {
+ static class QueryNodeGatherer extends AbstractQueryModelVisitor<RuntimeException> {
private static Set<QueryModelNode> nodes;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentTest.java
index 71b24fc..e38a157 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/JoinSegmentTest.java
@@ -18,7 +18,7 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -28,16 +28,16 @@ import org.apache.rya.indexing.external.matching.QuerySegmentFactory;
import org.apache.rya.indexing.external.matching.TopOfQueryFilterRelocator;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class JoinSegmentTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentPCJMatcherTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentPCJMatcherTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentPCJMatcherTest.java
index 5064572..577baed 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentPCJMatcherTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentPCJMatcherTest.java
@@ -18,7 +18,7 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -28,20 +28,20 @@ import org.apache.rya.indexing.external.matching.FlattenedOptional;
import org.apache.rya.indexing.external.matching.QuerySegmentFactory;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class OptionalJoinSegmentPCJMatcherTest {
@@ -251,7 +251,7 @@ public class OptionalJoinSegmentPCJMatcherTest {
- static class LeftJoinQueryNodeGatherer extends QueryModelVisitorBase<RuntimeException> {
+ static class LeftJoinQueryNodeGatherer extends AbstractQueryModelVisitor<RuntimeException> {
private static Set<QueryModelNode> nodes;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentTest.java
index 2a9d12a..dc3a8ef 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/OptionalJoinSegmentTest.java
@@ -18,7 +18,7 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-
+
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -28,17 +28,17 @@ import org.apache.rya.indexing.external.matching.QuerySegmentFactory;
import org.apache.rya.indexing.external.matching.TopOfQueryFilterRelocator;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class OptionalJoinSegmentTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJNodeConsolidatorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJNodeConsolidatorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJNodeConsolidatorTest.java
index 607e072..e91c7a2 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJNodeConsolidatorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJNodeConsolidatorTest.java
@@ -17,25 +17,25 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.List;
-import org.apache.rya.indexing.external.matching.OptionalJoinSegment;
import org.apache.rya.indexing.external.matching.QueryNodeConsolidator;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.external.matching.QuerySegmentFactory;
import org.apache.rya.indexing.external.matching.TopOfQueryFilterRelocator;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class PCJNodeConsolidatorTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerTest.java
index d28d826..0d80797 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerTest.java
@@ -18,6 +18,7 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -33,17 +34,17 @@ import org.apache.rya.indexing.pcj.matching.provider.AbstractPcjIndexSetProvider
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.mongodb.EmbeddedMongoSingleton;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -548,7 +549,7 @@ public class PCJOptimizerTest {
}
- public static class NodeCollector extends QueryModelVisitorBase<RuntimeException> {
+ public static class NodeCollector extends AbstractQueryModelVisitor<RuntimeException> {
List<QueryModelNode> qNodes = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilitesTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilitesTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilitesTest.java
index f56500a..48ed202 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilitesTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/pcj/matching/PCJOptimizerUtilitesTest.java
@@ -17,15 +17,15 @@ package org.apache.rya.indexing.pcj.matching;
* specific language governing permissions and limitations
* under the License.
*/
-import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class PCJOptimizerUtilitesTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
index 85d27e3..fa55df4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
@@ -63,11 +63,10 @@ import org.apache.rya.indexing.mongodb.update.RyaObjectStorage.ObjectStorageExce
import org.apache.rya.indexing.smarturi.SmartUriException;
import org.apache.rya.indexing.smarturi.duplication.conf.DuplicateDataConfig;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.joda.time.DateTime;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -80,7 +79,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
private static final String RYA_INSTANCE_NAME = "testInstance";
private static final String NAMESPACE = RyaSchema.NAMESPACE;
- private static final ValueFactory VALUE_FACTORY = ValueFactoryImpl.getInstance();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
// People
private static final RyaURI BOB = createRyaUri("Bob");
@@ -131,7 +130,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
* @return the {@link RyraURI}.
*/
private static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createURI(namespace, localName));
+ return RdfToRyaConversions.convertURI(VF.createIRI(namespace, localName));
}
private static Entity createBobEntity() {
@@ -151,7 +150,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime()).minusYears(40))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(NOW)))
.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)))
- .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bob.smitch00@gmail.com"))))
+ .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_ATTRIBUTE_SPACE, stringRyaType("attribute space")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_MOTTO, stringRyaType("!@#*\\&%20^ smörgåsbord")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_BLOOD_TYPE, stringRyaType("A+ blood type")))
@@ -291,7 +290,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testBooleanProperty() throws SmartUriException {
System.out.println("Boolean Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(false, tolerance, false));
@@ -326,7 +325,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testByteProperty() throws SmartUriException {
System.out.println("Byte Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Byte.MIN_VALUE, tolerance, false));
@@ -410,7 +409,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
public void testDateProperty() throws SmartUriException {
System.out.println("Date Property Test");
final long ONE_YEAR_IN_MILLIS = 1000L * 60L * 60L * 24L * 365L;
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(new Date(0L), tolerance, false));
@@ -591,7 +590,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
System.out.println("DateTime Property Test");
final DateTime dob = new DateTime(NOW).minusYears(40);
final long ONE_YEAR_IN_MILLIS = 1000L * 60L * 60L * 24L * 365L;
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(new DateTime(0L), tolerance, false));
@@ -770,7 +769,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testDoubleProperty() throws SmartUriException {
System.out.println("Double Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Double.MIN_VALUE, tolerance, false));
@@ -950,7 +949,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testFloatProperty() throws SmartUriException {
System.out.println("Float Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Float.MIN_VALUE, tolerance, false));
@@ -1117,7 +1116,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testIntegerProperty() throws SmartUriException {
System.out.println("Integer Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Integer.MIN_VALUE, tolerance, false));
@@ -1254,7 +1253,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testLongProperty() throws SmartUriException {
System.out.println("Long Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Long.MIN_VALUE, tolerance, false));
@@ -1373,7 +1372,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testShortProperty() throws SmartUriException {
System.out.println("Short Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput(Short.MIN_VALUE, tolerance, false));
@@ -1482,7 +1481,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testStringProperty() throws SmartUriException {
System.out.println("String Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
builder.add(new TestInput("123 Wrong St. Washington, DC 20024", tolerance, false));
@@ -1553,74 +1552,74 @@ public class DuplicateDataDetectorIT extends MongoITBase {
@Test
public void testUriProperty() throws SmartUriException {
System.out.println("URI Property Test");
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 0.0
Tolerance tolerance = new Tolerance(0.0, ToleranceType.DIFFERENCE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
// Tolerance 1.0
tolerance = new Tolerance(1.0, ToleranceType.DIFFERENCE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
// Tolerance 2.0
tolerance = new Tolerance(2.0, ToleranceType.DIFFERENCE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
// Tolerance 0.0%
tolerance = new Tolerance(0.00, ToleranceType.PERCENTAGE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
// Tolerance 5.0%
tolerance = new Tolerance(0.05, ToleranceType.PERCENTAGE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, false));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, false));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
// Tolerance 100.0%
tolerance = new Tolerance(1.00, ToleranceType.PERCENTAGE);
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch01@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bobsmitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@yahoo.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@hotmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:susan.smitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:ron.smitch00@gmail.com"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.org"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:susan.dillon@yahoo.org"), tolerance, true));
- builder.add(new TestInput(new URIImpl("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch01@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bobsmitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@yahoo.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@hotmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.smitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:ron.smitch00@gmail.com"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.org"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:susan.dillon@yahoo.org"), tolerance, true));
+ builder.add(new TestInput(VF.createIRI("mailto:bob.smitch00@gmail.com"), tolerance, true)); // Equals value
final ImmutableList<TestInput> testInputs = builder.build();
@@ -1691,7 +1690,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
"blue"
)
);
- final ImmutableList.Builder<TestInput> builder = ImmutableList.<TestInput>builder();
+ final ImmutableList.Builder<TestInput> builder = ImmutableList.builder();
// Tolerance 1.0 - tolerance doesn't apply to equivalents but is still needed for the test
final Tolerance tolerance = new Tolerance(1.0, ToleranceType.DIFFERENCE);
// Color equivalents
@@ -1813,7 +1812,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 1).minusYears(40))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 1))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)));
- duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bob.smitch01@gmail.com"))));
+ duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("124 Fake St. Washington, DC 20024")));
duplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 556)));
final Entity duplicateBobEntity = duplicateBobBuilder.build();
@@ -1841,7 +1840,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 10000000L).minusYears(40))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 10000000L))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(false)));
- notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bad.email.address@gmail.com"))));
+ notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("123456789 Fake St. Washington, DC 20024")));
notDuplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 1000)));
final Entity notDuplicateBobEntity = notDuplicateBobBuilder.build();
@@ -1904,7 +1903,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 1).minusYears(40))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 1))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)));
- duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bob.smitch01@gmail.com"))));
+ duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("124 Fake St. Washington, DC 20024")));
duplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 556)));
final Entity duplicateBobEntity = duplicateBobBuilder.build();
@@ -1930,7 +1929,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 10000000L).minusYears(40))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 10000000L))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(false)));
- notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(new URIImpl("mailto:bad.email.address@gmail.com"))));
+ notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("123456789 Fake St. Washington, DC 20024")));
notDuplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 1000)));
final Entity notDuplicateBobEntity = notDuplicateBobBuilder.build();
[35/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
index 5d357c3..91997a3 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/IterativeJoinTest.java
@@ -18,22 +18,25 @@
*/
package org.apache.rya.api.function.join;
-import static org.junit.Assert.assertEquals;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.apache.rya.api.function.join.IterativeJoin;
+import org.apache.rya.api.function.join.LeftOuterJoin;
+import org.apache.rya.api.function.join.NaturalJoin;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
+
+import static org.junit.Assert.assertEquals;
/**
* Tests the methods of {@link IterativeJoin}.
@@ -59,7 +62,7 @@ public class IterativeJoinTest {
@Test
public void naturalJoin_sideDoesNotMatter() {
// Create the binding sets that will be joined.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs1 = new MapBindingSet();
bs1.addBinding("id", vf.createLiteral("some_uid"));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/LeftOuterJoinTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/LeftOuterJoinTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/LeftOuterJoinTest.java
index 7d17e22..bcbaa11 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/LeftOuterJoinTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/LeftOuterJoinTest.java
@@ -21,17 +21,20 @@ package org.apache.rya.api.function.join;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.apache.rya.api.function.join.IterativeJoin;
+import org.apache.rya.api.function.join.LeftOuterJoin;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -41,7 +44,7 @@ import com.google.common.collect.Sets;
*/
public class LeftOuterJoinTest {
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void newLeftResult_noRightMatches() {
@@ -49,7 +52,7 @@ public class LeftOuterJoinTest {
// There is a new left result.
final MapBindingSet mapLeftResult = new MapBindingSet();
- mapLeftResult.addBinding("name", vf.createLiteral("Bob"));
+ mapLeftResult.addBinding("name", VF.createLiteral("Bob"));
final VisibilityBindingSet newLeftResult = new VisibilityBindingSet(mapLeftResult);
// There are no right results that join with the left result.
@@ -74,22 +77,22 @@ public class LeftOuterJoinTest {
// There is a new left result.
final MapBindingSet mapLeftResult = new MapBindingSet();
- mapLeftResult.addBinding("name", vf.createLiteral("Bob"));
- mapLeftResult.addBinding("height", vf.createLiteral("5'9\""));
+ mapLeftResult.addBinding("name", VF.createLiteral("Bob"));
+ mapLeftResult.addBinding("height", VF.createLiteral("5'9\""));
final VisibilityBindingSet newLeftResult = new VisibilityBindingSet(mapLeftResult);
// There are a few right results that join with the left result.
final MapBindingSet nameAge = new MapBindingSet();
- nameAge.addBinding("name", vf.createLiteral("Bob"));
- nameAge.addBinding("age", vf.createLiteral(56));
+ nameAge.addBinding("name", VF.createLiteral("Bob"));
+ nameAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
final VisibilityBindingSet visiAge = new VisibilityBindingSet(nameAge);
final MapBindingSet nameHair = new MapBindingSet();
- nameHair.addBinding("name", vf.createLiteral("Bob"));
- nameHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHair.addBinding("hairColor", VF.createLiteral("Brown"));
final VisibilityBindingSet visiHair = new VisibilityBindingSet(nameHair);
- final Iterator<VisibilityBindingSet> rightResults = Lists.<VisibilityBindingSet>newArrayList(visiAge, visiHair).iterator();
+ final Iterator<VisibilityBindingSet> rightResults = Lists.newArrayList(visiAge, visiHair).iterator();
// Therefore, there are a few new join results that mix the two together.
final Iterator<VisibilityBindingSet> newJoinResultsIt = leftOuterJoin.newLeftResult(newLeftResult, rightResults);
@@ -99,17 +102,17 @@ public class LeftOuterJoinTest {
newJoinResults.add( newJoinResultsIt.next() );
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet();
+ final Set<BindingSet> expected = Sets.newHashSet();
final MapBindingSet nameHeightAge = new MapBindingSet();
- nameHeightAge.addBinding("name", vf.createLiteral("Bob"));
- nameHeightAge.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightAge.addBinding("age", vf.createLiteral(56));
+ nameHeightAge.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightAge.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
expected.add(new VisibilityBindingSet(nameHeightAge));
final MapBindingSet nameHeightHair = new MapBindingSet();
- nameHeightHair.addBinding("name", vf.createLiteral("Bob"));
- nameHeightHair.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHeightHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightHair.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightHair.addBinding("hairColor", VF.createLiteral("Brown"));
expected.add(new VisibilityBindingSet(nameHeightHair));
assertEquals(expected, newJoinResults);
@@ -124,7 +127,7 @@ public class LeftOuterJoinTest {
// There is a new right result.
final MapBindingSet newRightResult = new MapBindingSet();
- newRightResult.addBinding("name", vf.createLiteral("Bob"));
+ newRightResult.addBinding("name", VF.createLiteral("Bob"));
// Therefore, there are no new join results.
final Iterator<VisibilityBindingSet> newJoinResultsIt = leftOuterJoin.newRightResult(leftResults, new VisibilityBindingSet(newRightResult));
@@ -137,21 +140,21 @@ public class LeftOuterJoinTest {
// There are a few left results that join with the new right result.
final MapBindingSet nameAge = new MapBindingSet();
- nameAge.addBinding("name", vf.createLiteral("Bob"));
- nameAge.addBinding("age", vf.createLiteral(56));
+ nameAge.addBinding("name", VF.createLiteral("Bob"));
+ nameAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
final MapBindingSet nameHair = new MapBindingSet();
- nameHair.addBinding("name", vf.createLiteral("Bob"));
- nameHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHair.addBinding("hairColor", VF.createLiteral("Brown"));
- final Iterator<VisibilityBindingSet> leftResults = Lists.<VisibilityBindingSet>newArrayList(
+ final Iterator<VisibilityBindingSet> leftResults = Lists.newArrayList(
new VisibilityBindingSet(nameAge),
new VisibilityBindingSet(nameHair)).iterator();
// There is a new right result.
final MapBindingSet newRightResult = new MapBindingSet();
- newRightResult.addBinding("name", vf.createLiteral("Bob"));
- newRightResult.addBinding("height", vf.createLiteral("5'9\""));
+ newRightResult.addBinding("name", VF.createLiteral("Bob"));
+ newRightResult.addBinding("height", VF.createLiteral("5'9\""));
// Therefore, there are a few new join results that mix the two together.
final Iterator<VisibilityBindingSet> newJoinResultsIt = leftOuterJoin.newRightResult(leftResults, new VisibilityBindingSet(newRightResult));
@@ -161,17 +164,17 @@ public class LeftOuterJoinTest {
newJoinResults.add( newJoinResultsIt.next() );
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet();
+ final Set<BindingSet> expected = Sets.newHashSet();
final MapBindingSet nameHeightAge = new MapBindingSet();
- nameHeightAge.addBinding("name", vf.createLiteral("Bob"));
- nameHeightAge.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightAge.addBinding("age", vf.createLiteral(56));
+ nameHeightAge.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightAge.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
expected.add(new VisibilityBindingSet(nameHeightAge));
final MapBindingSet nameHeightHair = new MapBindingSet();
- nameHeightHair.addBinding("name", vf.createLiteral("Bob"));
- nameHeightHair.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHeightHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightHair.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightHair.addBinding("hairColor", VF.createLiteral("Brown"));
expected.add(new VisibilityBindingSet(nameHeightHair));
assertEquals(expected, newJoinResults);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/NaturalJoinTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/NaturalJoinTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/NaturalJoinTest.java
index dd3b7e6..f6818ba 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/NaturalJoinTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/join/NaturalJoinTest.java
@@ -21,17 +21,20 @@ package org.apache.rya.api.function.join;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.apache.rya.api.function.join.IterativeJoin;
+import org.apache.rya.api.function.join.NaturalJoin;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -41,7 +44,7 @@ import com.google.common.collect.Sets;
*/
public class NaturalJoinTest {
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void newLeftResult_noRightMatches() {
@@ -49,7 +52,7 @@ public class NaturalJoinTest {
// There is a new left result.
final MapBindingSet newLeftResult = new MapBindingSet();
- newLeftResult.addBinding("name", vf.createLiteral("Bob"));
+ newLeftResult.addBinding("name", VF.createLiteral("Bob"));
// There are no right results that join with the left result.
final Iterator<VisibilityBindingSet> rightResults= new ArrayList<VisibilityBindingSet>().iterator();
@@ -65,19 +68,19 @@ public class NaturalJoinTest {
// There is a new left result.
final MapBindingSet newLeftResult = new MapBindingSet();
- newLeftResult.addBinding("name", vf.createLiteral("Bob"));
- newLeftResult.addBinding("height", vf.createLiteral("5'9\""));
+ newLeftResult.addBinding("name", VF.createLiteral("Bob"));
+ newLeftResult.addBinding("height", VF.createLiteral("5'9\""));
// There are a few right results that join with the left result.
final MapBindingSet nameAge = new MapBindingSet();
- nameAge.addBinding("name", vf.createLiteral("Bob"));
- nameAge.addBinding("age", vf.createLiteral(56));
+ nameAge.addBinding("name", VF.createLiteral("Bob"));
+ nameAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
final MapBindingSet nameHair = new MapBindingSet();
- nameHair.addBinding("name", vf.createLiteral("Bob"));
- nameHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHair.addBinding("hairColor", VF.createLiteral("Brown"));
- final Iterator<VisibilityBindingSet> rightResults = Lists.<VisibilityBindingSet>newArrayList(
+ final Iterator<VisibilityBindingSet> rightResults = Lists.newArrayList(
new VisibilityBindingSet(nameAge),
new VisibilityBindingSet(nameHair)).iterator();
@@ -89,17 +92,17 @@ public class NaturalJoinTest {
newJoinResults.add( newJoinResultsIt.next() );
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet();
+ final Set<BindingSet> expected = Sets.newHashSet();
final MapBindingSet nameHeightAge = new MapBindingSet();
- nameHeightAge.addBinding("name", vf.createLiteral("Bob"));
- nameHeightAge.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightAge.addBinding("age", vf.createLiteral(56));
+ nameHeightAge.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightAge.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
expected.add(new VisibilityBindingSet(nameHeightAge));
final MapBindingSet nameHeightHair = new MapBindingSet();
- nameHeightHair.addBinding("name", vf.createLiteral("Bob"));
- nameHeightHair.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHeightHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightHair.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightHair.addBinding("hairColor", VF.createLiteral("Brown"));
expected.add(new VisibilityBindingSet(nameHeightHair));
assertEquals(expected, newJoinResults);
@@ -114,7 +117,7 @@ public class NaturalJoinTest {
// There is a new right result.
final MapBindingSet newRightResult = new MapBindingSet();
- newRightResult.addBinding("name", vf.createLiteral("Bob"));
+ newRightResult.addBinding("name", VF.createLiteral("Bob"));
// Therefore, there are no new join results.
final Iterator<VisibilityBindingSet> newJoinResultsIt = naturalJoin.newRightResult(leftResults, new VisibilityBindingSet(newRightResult));
@@ -127,21 +130,21 @@ public class NaturalJoinTest {
// There are a few left results that join with the new right result.
final MapBindingSet nameAge = new MapBindingSet();
- nameAge.addBinding("name", vf.createLiteral("Bob"));
- nameAge.addBinding("age", vf.createLiteral(56));
+ nameAge.addBinding("name", VF.createLiteral("Bob"));
+ nameAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
final MapBindingSet nameHair = new MapBindingSet();
- nameHair.addBinding("name", vf.createLiteral("Bob"));
- nameHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHair.addBinding("hairColor", VF.createLiteral("Brown"));
- final Iterator<VisibilityBindingSet> leftResults = Lists.<VisibilityBindingSet>newArrayList(
+ final Iterator<VisibilityBindingSet> leftResults = Lists.newArrayList(
new VisibilityBindingSet(nameAge),
new VisibilityBindingSet(nameHair)).iterator();
// There is a new right result.
final MapBindingSet newRightResult = new MapBindingSet();
- newRightResult.addBinding("name", vf.createLiteral("Bob"));
- newRightResult.addBinding("height", vf.createLiteral("5'9\""));
+ newRightResult.addBinding("name", VF.createLiteral("Bob"));
+ newRightResult.addBinding("height", VF.createLiteral("5'9\""));
// Therefore, there are a few new join results that mix the two together.
final Iterator<VisibilityBindingSet> newJoinResultsIt = naturalJoin.newRightResult(leftResults, new VisibilityBindingSet(newRightResult));
@@ -151,17 +154,17 @@ public class NaturalJoinTest {
newJoinResults.add( newJoinResultsIt.next() );
}
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet();
+ final Set<BindingSet> expected = Sets.newHashSet();
final MapBindingSet nameHeightAge = new MapBindingSet();
- nameHeightAge.addBinding("name", vf.createLiteral("Bob"));
- nameHeightAge.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightAge.addBinding("age", vf.createLiteral(56));
+ nameHeightAge.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightAge.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightAge.addBinding("age", VF.createLiteral(BigInteger.valueOf(56)));
expected.add(new VisibilityBindingSet(nameHeightAge));
final MapBindingSet nameHeightHair = new MapBindingSet();
- nameHeightHair.addBinding("name", vf.createLiteral("Bob"));
- nameHeightHair.addBinding("height", vf.createLiteral("5'9\""));
- nameHeightHair.addBinding("hairColor", vf.createLiteral("Brown"));
+ nameHeightHair.addBinding("name", VF.createLiteral("Bob"));
+ nameHeightHair.addBinding("height", VF.createLiteral("5'9\""));
+ nameHeightHair.addBinding("hairColor", VF.createLiteral("Brown"));
expected.add(new VisibilityBindingSet(nameHeightHair));
assertEquals(expected, newJoinResults);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
index f5f18f7..48bbefa 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/AfterTemporalFunctionsTest.java
@@ -22,17 +22,17 @@ import static org.junit.Assert.assertEquals;
import java.time.ZonedDateTime;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
public class AfterTemporalFunctionsTest {
private static final ZonedDateTime TIME = ZonedDateTime.parse("2015-12-30T12:00:00Z");
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = ValueFactoryImpl.getInstance();
+ final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testAfter_same() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
index 1b15035..7fb5680 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/BeforeTemporalFunctionsTest.java
@@ -22,17 +22,17 @@ import static org.junit.Assert.assertEquals;
import java.time.ZonedDateTime;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
public class BeforeTemporalFunctionsTest {
private static final ZonedDateTime TIME = ZonedDateTime.parse("2015-12-30T12:00:00Z");
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = ValueFactoryImpl.getInstance();
+ final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testBefore_same() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
index 0d14d48..bffade6 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/EqualsTemporalFunctionsTest.java
@@ -22,17 +22,17 @@ import static org.junit.Assert.assertEquals;
import java.time.ZonedDateTime;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
public class EqualsTemporalFunctionsTest {
private static final ZonedDateTime TIME = ZonedDateTime.parse("2015-12-30T12:00:00Z");
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = ValueFactoryImpl.getInstance();
+ final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void testEquals_equal() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
index 6dee711..2761287 100644
--- a/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
+++ b/common/rya.api.function/src/main/test/org/apache/rya/api/function/temporal/WithinTemporalFunctionsTest.java
@@ -22,18 +22,18 @@ import static org.junit.Assert.assertEquals;
import java.time.ZonedDateTime;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
public class WithinTemporalFunctionsTest {
private static final ZonedDateTime TIME = ZonedDateTime.parse("2015-12-30T12:00:00Z");
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
private static final ZonedDateTime TIME_20 = ZonedDateTime.parse("2015-12-30T12:00:20Z");
- final ValueFactory VF = ValueFactoryImpl.getInstance();
+ final ValueFactory VF = SimpleValueFactory.getInstance();
@Test(expected = ValueExprEvaluationException.class)
public void within_NotInterval() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/test/java/org/apache/rya/api/function/filter/FilterEvaluatorTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/test/java/org/apache/rya/api/function/filter/FilterEvaluatorTest.java b/common/rya.api.function/src/test/java/org/apache/rya/api/function/filter/FilterEvaluatorTest.java
index 5e5cbe6..a47ae4d 100644
--- a/common/rya.api.function/src/test/java/org/apache/rya/api/function/filter/FilterEvaluatorTest.java
+++ b/common/rya.api.function/src/test/java/org/apache/rya/api/function/filter/FilterEvaluatorTest.java
@@ -24,16 +24,15 @@ import static org.junit.Assert.assertTrue;
import java.util.concurrent.atomic.AtomicReference;
-import org.apache.rya.api.function.filter.FilterEvaluator;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.Nullable;
@@ -53,9 +52,9 @@ public class FilterEvaluatorTest {
"}");
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("age", vf.createLiteral(9));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bs);
@@ -74,9 +73,9 @@ public class FilterEvaluatorTest {
"}");
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("age", vf.createLiteral(11));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bs);
@@ -96,7 +95,7 @@ public class FilterEvaluatorTest {
final AtomicReference<Filter> filter = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final Filter node) throws Exception {
filter.set(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/MultiProjectionEvaluatorTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/MultiProjectionEvaluatorTest.java b/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/MultiProjectionEvaluatorTest.java
index c02e87b..8f4094b 100644
--- a/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/MultiProjectionEvaluatorTest.java
+++ b/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/MultiProjectionEvaluatorTest.java
@@ -27,18 +27,18 @@ import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.Nullable;
@@ -62,7 +62,7 @@ public class MultiProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
bs.addBinding("location", vf.createLiteral("South St and 5th St"));
bs.addBinding("direction", vf.createLiteral("NW"));
@@ -76,18 +76,18 @@ public class MultiProjectionEvaluatorTest {
bs = new MapBindingSet();
bs.addBinding("subject", blankNode);
bs.addBinding("predicate", RDF.TYPE);
- bs.addBinding("object", vf.createURI("urn:movementObservation"));
+ bs.addBinding("object", vf.createIRI("urn:movementObservation"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
bs = new MapBindingSet();
bs.addBinding("subject", blankNode);
- bs.addBinding("predicate", vf.createURI("urn:location"));
+ bs.addBinding("predicate", vf.createIRI("urn:location"));
bs.addBinding("object", vf.createLiteral("South St and 5th St"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
bs = new MapBindingSet();
bs.addBinding("subject", blankNode);
- bs.addBinding("predicate", vf.createURI("urn:direction"));
+ bs.addBinding("predicate", vf.createIRI("urn:direction"));
bs.addBinding("object", vf.createLiteral("NW"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
@@ -116,12 +116,12 @@ public class MultiProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
bs.addBinding("vehicle", vf.createLiteral("Alice's car"));
- bs.addBinding("owner", vf.createURI("urn:Alice"));
+ bs.addBinding("owner", vf.createIRI("urn:Alice"));
bs.addBinding("plates", vf.createLiteral("XXXXXXX"));
- bs.addBinding("pet", vf.createURI("urn:Kitty"));
+ bs.addBinding("pet", vf.createIRI("urn:Kitty"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// Run the projection evaluator.
@@ -132,9 +132,9 @@ public class MultiProjectionEvaluatorTest {
Value petBNode = null;
for(final VisibilityBindingSet result : results) {
final Value object = result.getValue("object");
- if(object.equals(vf.createURI("urn:vehicle"))) {
+ if(object.equals(vf.createIRI("urn:vehicle"))) {
vehicalBNode = result.getValue("subject");
- } else if(object.equals(vf.createURI("urn:pet"))) {
+ } else if(object.equals(vf.createIRI("urn:pet"))) {
petBNode = result.getValue("subject");
}
}
@@ -145,24 +145,24 @@ public class MultiProjectionEvaluatorTest {
bs = new MapBindingSet();
bs.addBinding("subject", vehicalBNode);
bs.addBinding("predicate", RDF.TYPE);
- bs.addBinding("object", vf.createURI("urn:vehicle"));
+ bs.addBinding("object", vf.createIRI("urn:vehicle"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
bs = new MapBindingSet();
bs.addBinding("subject", vehicalBNode);
- bs.addBinding("predicate", vf.createURI("urn:tiresCount"));
+ bs.addBinding("predicate", vf.createIRI("urn:tiresCount"));
bs.addBinding("object", vf.createLiteral("4", XMLSchema.INTEGER));
expected.add( new VisibilityBindingSet(bs, "a|b") );
bs = new MapBindingSet();
bs.addBinding("subject", petBNode);
bs.addBinding("predicate", RDF.TYPE);
- bs.addBinding("object", vf.createURI("urn:pet"));
+ bs.addBinding("object", vf.createIRI("urn:pet"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
bs = new MapBindingSet();
bs.addBinding("subject", petBNode);
- bs.addBinding("predicate", vf.createURI("urn:isDead"));
+ bs.addBinding("predicate", vf.createIRI("urn:isDead"));
bs.addBinding("object", vf.createLiteral(false));
expected.add( new VisibilityBindingSet(bs, "a|b") );
@@ -181,7 +181,7 @@ public class MultiProjectionEvaluatorTest {
final AtomicReference<MultiProjection> multiProjection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final MultiProjection node) throws Exception {
multiProjection.set(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/ProjectionEvaluatorTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/ProjectionEvaluatorTest.java b/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/ProjectionEvaluatorTest.java
index e4a26a0..c2e6367 100644
--- a/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/ProjectionEvaluatorTest.java
+++ b/common/rya.api.function/src/test/java/org/apache/rya/api/function/projection/ProjectionEvaluatorTest.java
@@ -24,14 +24,14 @@ import static org.junit.Assert.assertEquals;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.Nullable;
@@ -55,11 +55,11 @@ public class ProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// Execute the projection.
@@ -81,18 +81,18 @@ public class ProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// The expected binding set changes the "person" binding name to "p" and "employee" to "e".
bs = new MapBindingSet();
- bs.addBinding("p", vf.createURI("urn:Alice"));
- bs.addBinding("e", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ bs.addBinding("p", vf.createIRI("urn:Alice"));
+ bs.addBinding("e", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet expected = new VisibilityBindingSet(bs, "a|b");
// Execute the projection.
@@ -114,16 +114,16 @@ public class ProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoJoint"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// The expected binding set only has the "person" binding.
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
final VisibilityBindingSet expected = new VisibilityBindingSet(bs, "a|b");
// Execute the projection.
@@ -145,18 +145,18 @@ public class ProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("child", vf.createURI("urn:Bob"));
- bs.addBinding("grandchild", vf.createURI("urn:Charlie"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("child", vf.createIRI("urn:Bob"));
+ bs.addBinding("grandchild", vf.createIRI("urn:Charlie"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// The expected binding set represents a statement.
bs = new MapBindingSet();
- bs.addBinding("subject", vf.createURI("urn:Alice"));
- bs.addBinding("predicate", vf.createURI("urn:hasGrandchild"));
- bs.addBinding("object", vf.createURI("urn:Charlie"));
+ bs.addBinding("subject", vf.createIRI("urn:Alice"));
+ bs.addBinding("predicate", vf.createIRI("urn:hasGrandchild"));
+ bs.addBinding("object", vf.createIRI("urn:Charlie"));
final VisibilityBindingSet expected = new VisibilityBindingSet(bs, "a|b");
// Execute the projection.
@@ -177,10 +177,10 @@ public class ProjectionEvaluatorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("hasGrandchild", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("hasGrandchild", vf.createIRI("urn:Bob"));
final VisibilityBindingSet original = new VisibilityBindingSet(bs, "a|b");
// Execute the projection.
@@ -189,8 +189,8 @@ public class ProjectionEvaluatorTest {
// The expected binding set represents a statement. We need to get the blank node's id from the
// result since that is different every time.
bs = new MapBindingSet();
- bs.addBinding("subject", vf.createURI("urn:Alice"));
- bs.addBinding("predicate", vf.createURI("urn:hasChild"));
+ bs.addBinding("subject", vf.createIRI("urn:Alice"));
+ bs.addBinding("predicate", vf.createIRI("urn:hasChild"));
bs.addBinding("object", result.getValue("object"));
final VisibilityBindingSet expected = new VisibilityBindingSet(bs, "a|b");
@@ -209,7 +209,7 @@ public class ProjectionEvaluatorTest {
final AtomicReference<Projection> projection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final Projection node) throws Exception {
projection.set(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/test/java/org/apache/rya/api/function/sp/StatementPatternMatcherTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/test/java/org/apache/rya/api/function/sp/StatementPatternMatcherTest.java b/common/rya.api.function/src/test/java/org/apache/rya/api/function/sp/StatementPatternMatcherTest.java
index 78a5418..27d3a3a 100644
--- a/common/rya.api.function/src/test/java/org/apache/rya/api/function/sp/StatementPatternMatcherTest.java
+++ b/common/rya.api.function/src/test/java/org/apache/rya/api/function/sp/StatementPatternMatcherTest.java
@@ -25,16 +25,16 @@ import static org.junit.Assert.assertFalse;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.Nullable;
@@ -52,13 +52,13 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that matches the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Create the expected resulting Binding Set.
final QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("p", vf.createURI("urn:talksTo"));
- expected.addBinding("o", vf.createURI("urn:Bob"));
+ expected.addBinding("p", vf.createIRI("urn:talksTo"));
+ expected.addBinding("o", vf.createIRI("urn:Bob"));
// Show the expected Binding Set matches the resulting Binding Set.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -74,8 +74,8 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that does not match the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Show the statement did not match.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -91,13 +91,13 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that matches the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Create the expected resulting Binding Set.
final QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("s", vf.createURI("urn:Alice"));
- expected.addBinding("o", vf.createURI("urn:Bob"));
+ expected.addBinding("s", vf.createIRI("urn:Alice"));
+ expected.addBinding("o", vf.createIRI("urn:Bob"));
// Show the expected Binding Set matches the resulting Binding Set.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -113,8 +113,8 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that does not match the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:knows"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:knows"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Show the statement did not match.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -130,13 +130,13 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that matches the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Create the expected resulting Binding Set.
final QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("s", vf.createURI("urn:Alice"));
- expected.addBinding("p", vf.createURI("urn:talksTo"));
+ expected.addBinding("s", vf.createIRI("urn:Alice"));
+ expected.addBinding("p", vf.createIRI("urn:talksTo"));
// Show the expected Binding Set matches the resulting Binding Set.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -152,8 +152,8 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that does not match the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:knows"), vf.createURI("urn:Alice"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:knows"), vf.createIRI("urn:Alice"), vf.createIRI("urn:testGraph"));
// Show the statement did not match.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -171,14 +171,14 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that matches the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Create the expected resulting Binding Set.
final QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("s", vf.createURI("urn:Alice"));
- expected.addBinding("p", vf.createURI("urn:talksTo"));
- expected.addBinding("o", vf.createURI("urn:Bob"));
+ expected.addBinding("s", vf.createIRI("urn:Alice"));
+ expected.addBinding("p", vf.createIRI("urn:talksTo"));
+ expected.addBinding("o", vf.createIRI("urn:Bob"));
// Show the expected Binding Set matches the resulting Binding Set.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -196,8 +196,8 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that does not match the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:wrong"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:wrong"));
// Show the statement did not match.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -215,15 +215,15 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that matches the pattern.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"), vf.createURI("urn:testGraph"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"), vf.createIRI("urn:testGraph"));
// Create the expected resulting Binding Set.
final QueryBindingSet expected = new QueryBindingSet();
- expected.addBinding("s", vf.createURI("urn:Alice"));
- expected.addBinding("p", vf.createURI("urn:talksTo"));
- expected.addBinding("o", vf.createURI("urn:Bob"));
- expected.addBinding("c", vf.createURI("urn:testGraph"));
+ expected.addBinding("s", vf.createIRI("urn:Alice"));
+ expected.addBinding("p", vf.createIRI("urn:talksTo"));
+ expected.addBinding("o", vf.createIRI("urn:Bob"));
+ expected.addBinding("c", vf.createIRI("urn:testGraph"));
// Show the expected Binding Set matches the resulting Binding Set.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -241,8 +241,8 @@ public class StatementPatternMatcherTest {
"}"));
// Create a statement that does not have a context value.
- final ValueFactory vf = new ValueFactoryImpl();
- final Statement statement = vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Statement statement = vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"));
// Show the statement did not match.
final Optional<BindingSet> bs = matcher.match(statement);
@@ -261,7 +261,7 @@ public class StatementPatternMatcherTest {
final AtomicReference<StatementPattern> statementPattern = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visitChildren(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visitChildren(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final StatementPattern node) throws Exception {
statementPattern.set(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.api.model/pom.xml b/common/rya.api.model/pom.xml
index 6af6801..b03c389 100644
--- a/common/rya.api.model/pom.xml
+++ b/common/rya.api.model/pom.xml
@@ -32,12 +32,12 @@ under the License.
<dependencies>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-model</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-model</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-query</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-query</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/src/main/java/org/apache/rya/api/model/BindingSetDecorator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.model/src/main/java/org/apache/rya/api/model/BindingSetDecorator.java b/common/rya.api.model/src/main/java/org/apache/rya/api/model/BindingSetDecorator.java
index e4126fd..cc2d0aa 100644
--- a/common/rya.api.model/src/main/java/org/apache/rya/api/model/BindingSetDecorator.java
+++ b/common/rya.api.model/src/main/java/org/apache/rya/api/model/BindingSetDecorator.java
@@ -23,9 +23,9 @@ import static java.util.Objects.requireNonNull;
import java.util.Iterator;
import java.util.Set;
-import org.openrdf.model.Value;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Abstracts out the decoration of a {@link BindingSet}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/src/main/java/org/apache/rya/api/model/StatementDecorator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.model/src/main/java/org/apache/rya/api/model/StatementDecorator.java b/common/rya.api.model/src/main/java/org/apache/rya/api/model/StatementDecorator.java
index ed4b511..e261253 100644
--- a/common/rya.api.model/src/main/java/org/apache/rya/api/model/StatementDecorator.java
+++ b/common/rya.api.model/src/main/java/org/apache/rya/api/model/StatementDecorator.java
@@ -22,10 +22,10 @@ import static java.util.Objects.requireNonNull;
import java.util.Objects;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -61,7 +61,7 @@ public abstract class StatementDecorator implements Statement {
}
@Override
- public URI getPredicate() {
+ public IRI getPredicate() {
return statement.getPredicate();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityBindingSet.java
----------------------------------------------------------------------
diff --git a/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityBindingSet.java b/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityBindingSet.java
index b741539..a80af3c 100644
--- a/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityBindingSet.java
+++ b/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityBindingSet.java
@@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Objects;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityStatement.java
----------------------------------------------------------------------
diff --git a/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityStatement.java b/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityStatement.java
index ffe95d7..6008fb3 100644
--- a/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityStatement.java
+++ b/common/rya.api.model/src/main/java/org/apache/rya/api/model/VisibilityStatement.java
@@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Objects;
-import org.openrdf.model.Statement;
+import org.eclipse.rdf4j.model.Statement;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.model/src/test/java/org/apache/rya/api/model/VisibilityBindingSetTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api.model/src/test/java/org/apache/rya/api/model/VisibilityBindingSetTest.java b/common/rya.api.model/src/test/java/org/apache/rya/api/model/VisibilityBindingSetTest.java
index 04f0c17..516027f 100644
--- a/common/rya.api.model/src/test/java/org/apache/rya/api/model/VisibilityBindingSetTest.java
+++ b/common/rya.api.model/src/test/java/org/apache/rya/api/model/VisibilityBindingSetTest.java
@@ -20,10 +20,10 @@ package org.apache.rya.api.model;
import static org.junit.Assert.assertNotEquals;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit tests the methods of {@link VisibilityBindingSet}.
@@ -33,7 +33,7 @@ public class VisibilityBindingSetTest {
@Test
public void hashcode() {
// Create a BindingSet, decorate it, and grab its hash code.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bSet = new MapBindingSet();
bSet.addBinding("name", vf.createLiteral("alice"));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.api/pom.xml b/common/rya.api/pom.xml
index 2529f2f..70bc691 100644
--- a/common/rya.api/pom.xml
+++ b/common/rya.api/pom.xml
@@ -41,32 +41,32 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-model</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-model</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-query</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-query</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-model</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-model</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-evaluation</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-evaluation</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-turtle</artifactId>
</dependency>
<dependency>
@@ -108,6 +108,11 @@ under the License.
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-sail-base</artifactId>
+ <version>${org.eclipse.rdf4j.version}</version>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
index a837b4e..c5d3e5f 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
@@ -1,7 +1,3 @@
-package org.apache.rya.api;
-
-import java.util.HashSet;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,9 +16,9 @@ import java.util.HashSet;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.api;
-
-
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -31,7 +27,7 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.layout.TableLayoutStrategy;
import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
@@ -369,7 +365,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether rdfs:domain and rdfs:range inferencing is enabled or disabled.
- * @param value {@code true} if rdfs:domain/range inferencing is enabled.
+ * @param val {@code true} if rdfs:domain/range inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferDomainRange(final Boolean val) {
@@ -388,7 +384,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether owl:hasSelf inferencing is enabled or disabled.
- * @param value {@code true} if owl:hasSelf inferencing is enabled.
+ * @param val {@code true} if owl:hasSelf inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferHasSelf(final Boolean val) {
@@ -445,7 +441,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether owl:inverseOf inferencing is enabled or disabled.
- * @param value {@code true} if owl:inverseOf inferencing is enabled.
+ * @param val {@code true} if owl:inverseOf inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferInverseOf(final Boolean val) {
@@ -559,7 +555,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether rdfs:subClassOf inferencing is enabled or disabled.
- * @param value {@code true} if rdfs:subClassOf inferencing is enabled.
+ * @param val {@code true} if rdfs:subClassOf inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferSubClassOf(final Boolean val) {
@@ -578,7 +574,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether rdfs:subPropertyOf inferencing is enabled or disabled.
- * @param value {@code true} if rdfs:subPropertyOf inferencing is enabled.
+ * @param val {@code true} if rdfs:subPropertyOf inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferSubPropertyOf(final Boolean val) {
@@ -597,7 +593,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether owl:SymmetricProperty inferencing is enabled or disabled.
- * @param value {@code true} if owl:SymmetricProperty inferencing is enabled.
+ * @param val {@code true} if owl:SymmetricProperty inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferSymmetricProperty(final Boolean val) {
@@ -616,7 +612,7 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
/**
* Sets whether owl:TransitiveProperty inferencing is enabled or disabled.
- * @param value {@code true} if owl:TransitiveProperty inferencing is enabled.
+ * @param val {@code true} if owl:TransitiveProperty inferencing is enabled.
* {@code false} otherwise.
*/
public void setInferTransitiveProperty(final Boolean val) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java
index a39464c..519cfe5 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfigurationBuilder.java
@@ -88,8 +88,8 @@ public abstract class RdfCloudTripleStoreConfigurationBuilder<B extends RdfCloud
* - visibilities assigned to any triples inserted into Rya
* @return B - concrete builder class for chaining method invocations
*/
- public B setVisibilities(String visibilites) {
- this.visibilities = visibilites;
+ public B setVisibilities(String visibilities) {
+ this.visibilities = visibilities;
return confBuilder();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
index dd7ada0..a0ac20d 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
@@ -24,19 +24,19 @@ import org.apache.hadoop.io.Text;
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
public class RdfCloudTripleStoreConstants {
public static final String NAMESPACE = RyaSchema.NAMESPACE;
public static final String AUTH_NAMESPACE = RyaSchema.AUTH_NAMESPACE;
- public static ValueFactory VALUE_FACTORY = ValueFactoryImpl.getInstance();
- public static URI RANGE = VALUE_FACTORY.createURI(NAMESPACE, "range");
- public static URI PARTITION_TIMERANGE = VALUE_FACTORY.createURI("urn:org.apache.mmrts.partition.rdf/08/2011#", "timeRange");
+ public static ValueFactory VALUE_FACTORY = SimpleValueFactory.getInstance();
+ public static IRI RANGE = VALUE_FACTORY.createIRI(NAMESPACE, "range");
+ public static IRI PARTITION_TIMERANGE = VALUE_FACTORY.createIRI("urn:org.apache.mmrts.partition.rdf/08/2011#", "timeRange");
public static Literal EMPTY_LITERAL = VALUE_FACTORY.createLiteral(0);
public static final byte EMPTY_BYTES[] = new byte[0];
public static final Text EMPTY_TEXT = new Text();
@@ -135,14 +135,14 @@ public class RdfCloudTripleStoreConstants {
// public static final Authorizations ALL_AUTHORIZATIONS = new Authorizations(
// "_");
- public static enum TABLE_LAYOUT {
+ public enum TABLE_LAYOUT {
SPO, PO, OSP
}
//TODO: This should be in a version file somewhere
- public static URI RTS_SUBJECT = VALUE_FACTORY.createURI(NAMESPACE, "rts");
+ public static IRI RTS_SUBJECT = VALUE_FACTORY.createIRI(NAMESPACE, "rts");
public static RyaURI RTS_SUBJECT_RYA = new RyaURI(RTS_SUBJECT.stringValue());
- public static URI RTS_VERSION_PREDICATE = VALUE_FACTORY.createURI(NAMESPACE, "version");
+ public static IRI RTS_VERSION_PREDICATE = VALUE_FACTORY.createIRI(NAMESPACE, "version");
public static RyaURI RTS_VERSION_PREDICATE_RYA = new RyaURI(RTS_VERSION_PREDICATE.stringValue());
public static final Value VERSION = VALUE_FACTORY.createLiteral("3.0.0");
public static RyaType VERSION_RYA = new RyaType(VERSION.stringValue());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreStatement.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreStatement.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreStatement.java
index 00ecb22..662d168 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreStatement.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreStatement.java
@@ -19,27 +19,29 @@ package org.apache.rya.api;
* under the License.
*/
-
-
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-
import java.util.ArrayList;
import java.util.Collection;
-public class RdfCloudTripleStoreStatement extends StatementImpl {
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleStatement;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+
+public class RdfCloudTripleStoreStatement extends SimpleStatement {
+ private static final long serialVersionUID = 1L;
+
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private Resource[] contexts; //TODO: no blank nodes
- public RdfCloudTripleStoreStatement(Resource subject, URI predicate, Value object) {
+ public RdfCloudTripleStoreStatement(Resource subject, IRI predicate, Value object) {
super(subject, predicate, object);
}
- public RdfCloudTripleStoreStatement(Resource subject, URI predicate, Value object,
+ public RdfCloudTripleStoreStatement(Resource subject, IRI predicate, Value object,
Resource... contexts) {
super(subject, predicate, object);
this.contexts = contexts;
@@ -54,7 +56,7 @@ public class RdfCloudTripleStoreStatement extends StatementImpl {
if (getContexts() != null && getContexts().length > 1) {
for (Resource contxt : getContexts()) {
- statements.add(new ContextStatementImpl(getSubject(),
+ statements.add(VF.createStatement(getSubject(),
getPredicate(), getObject(), contxt));
}
} else
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
index 0a366d7..acb0b91 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreUtils.java
@@ -19,28 +19,22 @@ package org.apache.rya.api;
* under the License.
*/
-
-
-import org.apache.rya.api.layout.TableLayoutStrategy;
-import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.BNodeImpl;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import static org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
+import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
+import org.apache.rya.api.layout.TableLayoutStrategy;
+import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
public class RdfCloudTripleStoreUtils {
- public static ValueFactory valueFactory = new ValueFactoryImpl();
+ public static final ValueFactory VF = SimpleValueFactory.getInstance();
public static final Pattern literalPattern = Pattern.compile("^\"(.*?)\"((\\^\\^<(.+?)>)$|(@(.{2}))$)");
// public static byte[] writeValue(Value value) throws IOException {
@@ -93,7 +87,7 @@ public class RdfCloudTripleStoreUtils {
//// Value ret = null;
//// if (valueTypeMarker == RdfCloudTripleStoreConstants.URI_MARKER) {
//// String uriString = readString(dataIn);
-//// ret = vf.createURI(uriString);
+//// ret = vf.createIRI(uriString);
//// } else if (valueTypeMarker == RdfCloudTripleStoreConstants.BNODE_MARKER) {
//// String bnodeID = readString(dataIn);
//// ret = vf.createBNode(bnodeID);
@@ -246,9 +240,7 @@ public class RdfCloudTripleStoreUtils {
CustomEntry that = (CustomEntry) o;
if (key != null ? !key.equals(that.key) : that.key != null) return false;
- if (value != null ? !value.equals(that.value) : that.value != null) return false;
-
- return true;
+ return value != null ? value.equals(that.value) : that.value == null;
}
@Override
@@ -266,17 +258,17 @@ public class RdfCloudTripleStoreUtils {
* @param value
* @return
*/
- public static URI convertToUri(String namespace, String value) {
+ public static IRI convertToUri(String namespace, String value) {
if (value == null)
return null;
- URI subjUri;
+ IRI subjUri;
try {
- subjUri = valueFactory.createURI(value);
+ subjUri = VF.createIRI(value);
} catch (Exception e) {
//not uri
if (namespace == null)
return null;
- subjUri = valueFactory.createURI(namespace, value);
+ subjUri = VF.createIRI(namespace, value);
}
return subjUri;
}
@@ -293,7 +285,7 @@ public class RdfCloudTripleStoreUtils {
}
String dataType = s.substring(dt_i_start, dt_i_end);
- return valueFactory.createLiteral(val, valueFactory.createURI(dataType));
+ return VF.createLiteral(val, VF.createIRI(dataType));
}
return null;
}
@@ -305,7 +297,7 @@ public class RdfCloudTripleStoreUtils {
public static boolean isUri(String uri) {
if (uri == null) return false;
try {
- valueFactory.createURI(uri);
+ VF.createIRI(uri);
} catch (Exception e) {
return false;
}
@@ -381,12 +373,12 @@ public class RdfCloudTripleStoreUtils {
//helper methods to createValue
public static Value createValue(String resource) {
if (isBNode(resource))
- return new BNodeImpl(resource.substring(2));
+ return VF.createBNode(resource.substring(2));
Literal literal;
if ((literal = makeLiteral(resource)) != null)
return literal;
if (resource.contains(":") || resource.contains("/") || resource.contains("#")) {
- return new URIImpl(resource);
+ return VF.createIRI(resource);
} else {
throw new RuntimeException((new StringBuilder()).append(resource).append(" is not a valid URI, blank node, or literal value").toString());
}
@@ -408,11 +400,11 @@ public class RdfCloudTripleStoreUtils {
Matcher matcher = literalPattern.matcher(resource);
if (matcher.matches())
if (null != matcher.group(4))
- return new LiteralImpl(matcher.group(1), new URIImpl(matcher.group(4)));
+ return VF.createLiteral(matcher.group(1), VF.createIRI(matcher.group(4)));
else
- return new LiteralImpl(matcher.group(1), matcher.group(6));
+ return VF.createLiteral(matcher.group(1), matcher.group(6));
if (resource.startsWith("\"") && resource.endsWith("\"") && resource.length() > 1)
- return new LiteralImpl(resource.substring(1, resource.length() - 1));
+ return VF.createLiteral(resource.substring(1, resource.length() - 1));
else
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/client/ExecuteSparqlQuery.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/client/ExecuteSparqlQuery.java b/common/rya.api/src/main/java/org/apache/rya/api/client/ExecuteSparqlQuery.java
index 082beb1..212399a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/client/ExecuteSparqlQuery.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/client/ExecuteSparqlQuery.java
@@ -20,8 +20,8 @@ package org.apache.rya.api.client;
import java.io.Closeable;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.TupleQueryResult;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatements.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatements.java b/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatements.java
index 2fdb77b..9cac606 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatements.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatements.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -18,7 +18,7 @@
*/
package org.apache.rya.api.client;
-import org.openrdf.model.Statement;
+import org.eclipse.rdf4j.model.Statement;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatementsFile.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatementsFile.java b/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatementsFile.java
index 0fd987a..85cebb8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatementsFile.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/client/LoadStatementsFile.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -20,7 +20,7 @@ package org.apache.rya.api.client;
import java.nio.file.Path;
-import org.openrdf.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFFormat;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
index 5b086d2..62ee8c0 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/DateTimeTtlValueConverter.java
@@ -19,14 +19,12 @@ package org.apache.rya.api.date;
* under the License.
*/
-
-
-import org.openrdf.model.Value;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
+import org.eclipse.rdf4j.model.Value;
/**
* Class DateTimeTtlValueConverter
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
index 97e4804..a52e0b4 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/date/TimestampTtlStrValueConverter.java
@@ -19,9 +19,7 @@ package org.apache.rya.api.date;
* under the License.
*/
-
-
-import org.openrdf.model.Value;
+import org.eclipse.rdf4j.model.Value;
/**
* Class TimestampTtlValueConverter
[02/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java
index 9c6cc86..c1c6356 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/OneOfVisitorTest.java
@@ -28,22 +28,22 @@ import java.util.Iterator;
import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -53,31 +53,31 @@ import com.google.common.collect.Sets;
*/
public class OneOfVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- private static final URI SUITS = VF.createURI("urn:Suits");
- private static final URI RANKS = VF.createURI("urn:Ranks");
+ private static final IRI SUITS = VF.createIRI("urn:Suits");
+ private static final IRI RANKS = VF.createIRI("urn:Ranks");
// Definition #1: :Suits owl:oneOf(:Clubs, :Diamonds, :Hearts, :Spades)
- private static final URI CLUBS = VF.createURI("urn:Clubs");
- private static final URI DIAMONDS = VF.createURI("urn:Diamonds");
- private static final URI HEARTS = VF.createURI("urn:Hearts");
- private static final URI SPADES = VF.createURI("urn:Spades");
+ private static final IRI CLUBS = VF.createIRI("urn:Clubs");
+ private static final IRI DIAMONDS = VF.createIRI("urn:Diamonds");
+ private static final IRI HEARTS = VF.createIRI("urn:Hearts");
+ private static final IRI SPADES = VF.createIRI("urn:Spades");
// Definition #2: :Ranks owl:oneOf(:Ace, :2, :3, :4, :5, :6, :7, :8, :9, :10, :Jack, :Queen, :King)
- private static final URI ACE = VF.createURI("urn:Ace");
- private static final URI TWO = VF.createURI("urn:2");
- private static final URI THREE = VF.createURI("urn:3");
- private static final URI FOUR = VF.createURI("urn:4");
- private static final URI FIVE = VF.createURI("urn:5");
- private static final URI SIX = VF.createURI("urn:6");
- private static final URI SEVEN = VF.createURI("urn:7");
- private static final URI EIGHT = VF.createURI("urn:8");
- private static final URI NINE = VF.createURI("urn:9");
- private static final URI TEN = VF.createURI("urn:10");
- private static final URI JACK = VF.createURI("urn:Jack");
- private static final URI QUEEN = VF.createURI("urn:Queen");
- private static final URI KING = VF.createURI("urn:King");
+ private static final IRI ACE = VF.createIRI("urn:Ace");
+ private static final IRI TWO = VF.createIRI("urn:2");
+ private static final IRI THREE = VF.createIRI("urn:3");
+ private static final IRI FOUR = VF.createIRI("urn:4");
+ private static final IRI FIVE = VF.createIRI("urn:5");
+ private static final IRI SIX = VF.createIRI("urn:6");
+ private static final IRI SEVEN = VF.createIRI("urn:7");
+ private static final IRI EIGHT = VF.createIRI("urn:8");
+ private static final IRI NINE = VF.createIRI("urn:9");
+ private static final IRI TEN = VF.createIRI("urn:10");
+ private static final IRI JACK = VF.createIRI("urn:Jack");
+ private static final IRI QUEEN = VF.createIRI("urn:Queen");
+ private static final IRI KING = VF.createIRI("urn:King");
private static final Set<Resource> CARD_SUIT_ENUMERATION =
Sets.newLinkedHashSet(
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
index cf37c43..a3fd6ce 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/PropertyChainTest.java
@@ -1,4 +1,3 @@
-package org.apache.rya.rdftriplestore.inference;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,6 +16,8 @@ package org.apache.rya.rdftriplestore.inference;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.rdftriplestore.inference;
+
import java.util.List;
import org.apache.accumulo.core.Constants;
@@ -25,41 +26,22 @@ import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
-import org.junit.Assert;
-import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.Update;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-
-import junit.framework.TestCase;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.rya.rdftriplestore.inference.InferenceEngine;
-import org.apache.rya.rdftriplestore.inference.InverseURI;
-/*
- * 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.
- */
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.junit.Assert;
+import org.junit.Test;
+
+import junit.framework.TestCase;
+
public class PropertyChainTest extends TestCase {
private String user = "user";
private String pwd = "pwd";
@@ -68,7 +50,7 @@ public class PropertyChainTest extends TestCase {
private Authorizations auths = Constants.NO_AUTHS;
private Connector connector;
private AccumuloRyaDAO ryaDAO;
- private ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private String namespace = "urn:test#";
private AccumuloRdfConfiguration conf;
@@ -131,10 +113,10 @@ public class PropertyChainTest extends TestCase {
Update update = conn.prepareUpdate(QueryLanguage.SPARQL, query);
update.execute();
inferenceEngine.refreshGraph();
- List<URI> chain = inferenceEngine.getPropertyChain(vf.createURI("urn:greatMother"));
+ List<IRI> chain = inferenceEngine.getPropertyChain(VF.createIRI("urn:greatMother"));
Assert.assertEquals(chain.size(), 2);
- Assert.assertEquals(chain.get(0), new InverseURI(vf.createURI("urn:isChildOf")));
- Assert.assertEquals(chain.get(1), vf.createURI("urn:MotherOf"));
+ Assert.assertEquals(chain.get(0), new InverseURI(VF.createIRI("urn:isChildOf")));
+ Assert.assertEquals(chain.get(1), VF.createIRI("urn:MotherOf"));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitorTest.java
index f151bd3..bebf143 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitorTest.java
@@ -23,29 +23,29 @@ import static org.mockito.Mockito.when;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.ZeroLengthPath;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.ZeroLengthPath;
/**
* Tests the methods of {@link ReflexivePropertyVisitor}.
*/
public class ReflexivePropertyVisitorTest {
private final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
- private static final URI ALICE = VF.createURI("urn:Alice");
- private static final URI HAS_FAMILY = VF.createURI("urn:hasFamilyMember");
+ private static final IRI ALICE = VF.createIRI("urn:Alice");
+ private static final IRI HAS_FAMILY = VF.createIRI("urn:hasFamilyMember");
@Test
public void testReflexiveProperty() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SameAsTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SameAsTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SameAsTest.java
index 43184c4..16d2539 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SameAsTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SameAsTest.java
@@ -1,5 +1,3 @@
-package org.apache.rya.rdftriplestore.inference;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,17 +16,7 @@ package org.apache.rya.rdftriplestore.inference;
* specific language governing permissions and limitations
* under the License.
*/
-
-
-
-import info.aduna.iteration.Iterations;
-import junit.framework.TestCase;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.rya.rdftriplestore.inference.InferenceEngine;
+package org.apache.rya.rdftriplestore.inference;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Connector;
@@ -36,13 +24,20 @@ import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.TablePermission;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+import org.apache.rya.api.resolver.RdfToRyaConversions;
+import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.eclipse.rdf4j.common.iteration.Iterations;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
+
+import junit.framework.TestCase;
public class SameAsTest extends TestCase {
private String user = "user";
@@ -52,7 +47,7 @@ public class SameAsTest extends TestCase {
private Authorizations auths = Constants.NO_AUTHS;
private Connector connector;
private AccumuloRyaDAO ryaDAO;
- private ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private String namespace = "urn:test#";
private AccumuloRdfConfiguration conf;
@@ -91,13 +86,13 @@ public class SameAsTest extends TestCase {
@Test
//This isn't a good test. It's simply a cut-and-paste from a test that was failing in a different package in the SameAsVisitor.
public void testGraphConfiguration() throws Exception {
- URI a = vf.createURI(namespace, "a");
- Statement statement = new StatementImpl(a, vf.createURI(namespace, "p"), vf.createLiteral("l"));
- Statement statement2 = new StatementImpl(a, vf.createURI(namespace, "p2"), vf.createLiteral("l"));
+ IRI a = VF.createIRI(namespace, "a");
+ Statement statement = VF.createStatement(a, VF.createIRI(namespace, "p"), VF.createLiteral("l"));
+ Statement statement2 = VF.createStatement(a, VF.createIRI(namespace, "p2"), VF.createLiteral("l"));
ryaDAO.add(RdfToRyaConversions.convertStatement(statement));
ryaDAO.add(RdfToRyaConversions.convertStatement(statement2));
- ryaDAO.add(RdfToRyaConversions.convertStatement(new StatementImpl(vf.createURI(namespace, "b"), vf.createURI(namespace, "p"), vf.createLiteral("l"))));
- ryaDAO.add(RdfToRyaConversions.convertStatement(new StatementImpl(vf.createURI(namespace, "c"), vf.createURI(namespace, "n"), vf.createLiteral("l"))));
+ ryaDAO.add(RdfToRyaConversions.convertStatement(VF.createStatement(VF.createIRI(namespace, "b"), VF.createIRI(namespace, "p"), VF.createLiteral("l"))));
+ ryaDAO.add(RdfToRyaConversions.convertStatement(VF.createStatement(VF.createIRI(namespace, "c"), VF.createIRI(namespace, "n"), VF.createLiteral("l"))));
// build a connection
RdfCloudTripleStore store = new RdfCloudTripleStore();
@@ -110,6 +105,6 @@ public class SameAsTest extends TestCase {
store.initialize();
- System.out.println(Iterations.asList(store.getConnection().getStatements(a, vf.createURI(namespace, "p"), vf.createLiteral("l"), false, new Resource[0])).size());
+ System.out.println(Iterations.asList(store.getConnection().getStatements(a, VF.createIRI(namespace, "p"), VF.createLiteral("l"), false, new Resource[0])).size());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitorTest.java
----------------------------------------------------------------------
diff --git a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitorTest.java b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitorTest.java
index 013e535..603144e 100644
--- a/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitorTest.java
+++ b/sail/src/test/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitorTest.java
@@ -28,46 +28,46 @@ import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
import com.google.common.collect.Sets;
public class SomeValuesFromVisitorTest {
private static final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
// Value types
- private final URI course = vf.createURI("lubm:Course");
- private final URI gradCourse = vf.createURI("lubm:GraduateCourse");
- private final URI department = vf.createURI("lubm:Department");
- private final URI organization = vf.createURI("lubm:Organization");
+ private final IRI course = VF.createIRI("lubm:Course");
+ private final IRI gradCourse = VF.createIRI("lubm:GraduateCourse");
+ private final IRI department = VF.createIRI("lubm:Department");
+ private final IRI organization = VF.createIRI("lubm:Organization");
// Predicates
- private final URI takesCourse = vf.createURI("lubm:takesCourse");
- private final URI headOf = vf.createURI("lubm:headOf");
- private final URI worksFor = vf.createURI("lubm:worksFor");
+ private final IRI takesCourse = VF.createIRI("lubm:takesCourse");
+ private final IRI headOf = VF.createIRI("lubm:headOf");
+ private final IRI worksFor = VF.createIRI("lubm:worksFor");
// Supertype of restriction types
- private final URI person = vf.createURI("lubm:Person");
+ private final IRI person = VF.createIRI("lubm:Person");
@Test
public void testSomeValuesFrom() throws Exception {
// Configure a mock instance engine with an ontology:
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- Map<Resource, Set<URI>> personSVF = new HashMap<>();
+ Map<Resource, Set<IRI>> personSVF = new HashMap<>();
personSVF.put(gradCourse, Sets.newHashSet(takesCourse));
personSVF.put(course, Sets.newHashSet(takesCourse));
personSVF.put(department, Sets.newHashSet(headOf));
@@ -136,7 +136,7 @@ public class SomeValuesFromVisitorTest {
disabledConf.setInferSomeValuesFrom(false);
// Configure a mock instance engine with an ontology:
final InferenceEngine inferenceEngine = mock(InferenceEngine.class);
- Map<Resource, Set<URI>> personSVF = new HashMap<>();
+ Map<Resource, Set<IRI>> personSVF = new HashMap<>();
personSVF.put(gradCourse, Sets.newHashSet(takesCourse));
personSVF.put(course, Sets.newHashSet(takesCourse));
personSVF.put(department, Sets.newHashSet(headOf));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/spark/pom.xml
----------------------------------------------------------------------
diff --git a/spark/pom.xml b/spark/pom.xml
index 92ad4b0..cdf5259 100644
--- a/spark/pom.xml
+++ b/spark/pom.xml
@@ -69,16 +69,16 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-ntriples</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-ntriples</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-nquads</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-nquads</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-trig</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-trig</artifactId>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/test/rdf/pom.xml
----------------------------------------------------------------------
diff --git a/test/rdf/pom.xml b/test/rdf/pom.xml
index de4a58f..81cd2e7 100644
--- a/test/rdf/pom.xml
+++ b/test/rdf/pom.xml
@@ -36,12 +36,12 @@ under the License.
<dependencies>
<!-- Third Party Dependencies -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-model</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-model</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryparser-sparql</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryparser-sparql</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/test/rdf/src/main/java/org/apache/rya/streams/kafka/RdfTestUtil.java
----------------------------------------------------------------------
diff --git a/test/rdf/src/main/java/org/apache/rya/streams/kafka/RdfTestUtil.java b/test/rdf/src/main/java/org/apache/rya/streams/kafka/RdfTestUtil.java
index b4388c3..4e91dee 100644
--- a/test/rdf/src/main/java/org/apache/rya/streams/kafka/RdfTestUtil.java
+++ b/test/rdf/src/main/java/org/apache/rya/streams/kafka/RdfTestUtil.java
@@ -22,13 +22,13 @@ import static java.util.Objects.requireNonNull;
import java.util.concurrent.atomic.AtomicReference;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -45,7 +45,7 @@ public final class RdfTestUtil {
/**
* Fetch the {@link StatementPattern} from a SPARQL string.
*
- * @param sparql - A SPARQL query that contains only a single Statement Patern. (not nul)
+ * @param sparql - A SPARQL query that contains only a single Statement Pattern. (not null)
* @return The {@link StatementPattern} that was in the query, if it could be found. Otherwise {@code null}
* @throws Exception The statement pattern could not be found in the parsed SPARQL query.
*/
@@ -54,7 +54,7 @@ public final class RdfTestUtil {
final AtomicReference<StatementPattern> statementPattern = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visitChildren(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visitChildren(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final StatementPattern node) throws Exception {
statementPattern.set(node);
@@ -75,7 +75,7 @@ public final class RdfTestUtil {
final AtomicReference<Projection> projection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final Projection node) throws Exception {
projection.set(node);
@@ -97,7 +97,7 @@ public final class RdfTestUtil {
final AtomicReference<MultiProjection> multiProjection = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final MultiProjection node) throws Exception {
multiProjection.set(node);
@@ -119,7 +119,7 @@ public final class RdfTestUtil {
final AtomicReference<Filter> filter = new AtomicReference<>();
final ParsedQuery parsed = new SPARQLParser().parseQuery(sparql, null);
- parsed.getTupleExpr().visit(new QueryModelVisitorBase<Exception>() {
+ parsed.getTupleExpr().visit(new AbstractQueryModelVisitor<Exception>() {
@Override
public void meet(final Filter node) throws Exception {
filter.set(node);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/pom.xml
----------------------------------------------------------------------
diff --git a/web/web.rya/pom.xml b/web/web.rya/pom.xml
index 5ac191d..371ca8f 100644
--- a/web/web.rya/pom.xml
+++ b/web/web.rya/pom.xml
@@ -54,12 +54,12 @@ under the License.
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-rdfxml</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-rdfxml</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryresultio-sparqljson</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryresultio-sparqljson</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/AbstractRDFWebServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/AbstractRDFWebServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/AbstractRDFWebServlet.java
index b94af1e..0f1b44a 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/AbstractRDFWebServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/AbstractRDFWebServlet.java
@@ -25,9 +25,9 @@
//import org.apache.rya.cloudbase.CloudbaseRdfDAO;
//import org.apache.rya.cloudbase.CloudbaseRdfEvalStatsDAO;
//import RdfCloudTripleStore;
-//import org.openrdf.repository.Repository;
-//import org.openrdf.repository.RepositoryException;
-//import org.openrdf.repository.sail.SailRepository;
+//import org.eclipse.rdf4j.repository.Repository;
+//import org.eclipse.rdf4j.repository.RepositoryException;
+//import org.eclipse.rdf4j.repository.sail.SailRepository;
//
//import javax.servlet.ServletConfig;
//import javax.servlet.ServletException;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/DeleteDataServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/DeleteDataServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/DeleteDataServlet.java
index 7cff739..fd1081b 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/DeleteDataServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/DeleteDataServlet.java
@@ -20,11 +20,11 @@
//package org.apache.cloud.rdf.web.cloudbase.sail;
//
-//import org.openrdf.query.QueryLanguage;
-//import org.openrdf.query.TupleQuery;
-//import org.openrdf.query.resultio.TupleQueryResultWriter;
-//import org.openrdf.repository.RepositoryConnection;
-//import org.openrdf.repository.RepositoryException;
+//import org.eclipse.rdf4j.query.QueryLanguage;
+//import org.eclipse.rdf4j.query.TupleQuery;
+//import org.eclipse.rdf4j.query.resultio.TupleQueryResultWriter;
+//import org.eclipse.rdf4j.repository.RepositoryConnection;
+//import org.eclipse.rdf4j.repository.RepositoryException;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/LoadDataServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/LoadDataServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/LoadDataServlet.java
index 17e3478..b534ff4 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/LoadDataServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/LoadDataServlet.java
@@ -20,11 +20,11 @@
//package org.apache.cloud.rdf.web.cloudbase.sail;
//
-//import org.openrdf.model.Resource;
-//import org.openrdf.repository.RepositoryConnection;
-//import org.openrdf.repository.RepositoryException;
-//import org.openrdf.rio.RDFFormat;
-//import org.openrdf.rio.RDFParseException;
+//import org.eclipse.rdf4j.model.Resource;
+//import org.eclipse.rdf4j.repository.RepositoryConnection;
+//import org.eclipse.rdf4j.repository.RepositoryException;
+//import org.eclipse.rdf4j.rio.RDFFormat;
+//import org.eclipse.rdf4j.rio.RDFParseException;
//
//import javax.servlet.ServletException;
//import javax.servlet.ServletInputStream;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
index fdc0598..a60440d 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QueryDataServlet.java
@@ -22,16 +22,16 @@
//
//import RdfCloudTripleStoreConstants;
//import RdfCloudTripleStoreConstants;
-//import org.openrdf.model.ValueFactory;
-//import org.openrdf.model.impl.ValueFactoryImpl;
-//import org.openrdf.query.GraphQuery;
-//import org.openrdf.query.QueryLanguage;
-//import org.openrdf.query.TupleQuery;
-//import org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
-//import org.openrdf.repository.Repository;
-//import org.openrdf.repository.RepositoryConnection;
-//import org.openrdf.repository.RepositoryException;
-//import org.openrdf.rio.rdfxml.RDFXMLWriter;
+//import org.eclipse.rdf4j.model.ValueFactory;
+//import org.eclipse.rdf4j.model.impl.ValueFactoryImpl;
+//import org.eclipse.rdf4j.query.GraphQuery;
+//import org.eclipse.rdf4j.query.QueryLanguage;
+//import org.eclipse.rdf4j.query.TupleQuery;
+//import org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
+//import org.eclipse.rdf4j.repository.Repository;
+//import org.eclipse.rdf4j.repository.RepositoryConnection;
+//import org.eclipse.rdf4j.repository.RepositoryException;
+//import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter;
//
//import javax.servlet.ServletException;
//import javax.servlet.ServletOutputStream;
@@ -42,7 +42,7 @@
//
//public class QueryDataServlet extends AbstractRDFWebServlet {
//
-// private ValueFactory vf = new ValueFactoryImpl();
+// private static final ValueFactory VF = SimpleValueFactory.getInstance();
//
// @Override
// protected void doGet(HttpServletRequest req, HttpServletResponse resp)
@@ -99,17 +99,17 @@
// GraphQuery graphQuery = conn.prepareGraphQuery(
// QueryLanguage.SPARQL, query);
// if (ttl != null && ttl.length() > 0)
-// graphQuery.setBinding("ttl", vf.createLiteral(Long.parseLong(ttl)));
+// graphQuery.setBinding("ttl", VF.createLiteral(Long.parseLong(ttl)));
// if (startTime != null && startTime.length() > 0)
-// graphQuery.setBinding("startTime", vf.createLiteral(Long.parseLong(startTime)));
+// graphQuery.setBinding("startTime", VF.createLiteral(Long.parseLong(startTime)));
// if (performant != null && performant.length() > 0)
-// graphQuery.setBinding("performant", vf.createLiteral(Boolean.parseBoolean(performant)));
+// graphQuery.setBinding("performant", VF.createLiteral(Boolean.parseBoolean(performant)));
// if (infer != null && infer.length() > 0)
-// graphQuery.setBinding("infer", vf.createLiteral(Boolean.parseBoolean(infer)));
+// graphQuery.setBinding("infer", VF.createLiteral(Boolean.parseBoolean(infer)));
// if (useStats != null && useStats.length() > 0)
-// graphQuery.setBinding("useStats", vf.createLiteral(Boolean.parseBoolean(useStats)));
+// graphQuery.setBinding("useStats", VF.createLiteral(Boolean.parseBoolean(useStats)));
// if (timeUris != null && timeUris.length() > 0)
-// graphQuery.setBinding("timeUris", vf.createURI(timeUris));
+// graphQuery.setBinding("timeUris", VF.createIRI(timeUris));
// if (tablePrefix != null && tablePrefix.length() > 0)
// RdfCloudTripleStoreConstants.prefixTables(tablePrefix);
// RDFXMLWriter rdfWriter = new RDFXMLWriter(os);
@@ -143,17 +143,17 @@
// TupleQuery tupleQuery = conn.prepareTupleQuery(
// QueryLanguage.SPARQL, query);
// if (ttl != null && ttl.length() > 0)
-// tupleQuery.setBinding("ttl", vf.createLiteral(Long.parseLong(ttl)));
+// tupleQuery.setBinding("ttl", VF.createLiteral(Long.parseLong(ttl)));
// if (startTime != null && startTime.length() > 0)
-// tupleQuery.setBinding("startTime", vf.createLiteral(Long.parseLong(startTime)));
+// tupleQuery.setBinding("startTime", VF.createLiteral(Long.parseLong(startTime)));
// if (performant != null && performant.length() > 0)
-// tupleQuery.setBinding("performant", vf.createLiteral(Boolean.parseBoolean(performant)));
+// tupleQuery.setBinding("performant", VF.createLiteral(Boolean.parseBoolean(performant)));
// if (infer != null && infer.length() > 0)
-// tupleQuery.setBinding("infer", vf.createLiteral(Boolean.parseBoolean(infer)));
+// tupleQuery.setBinding("infer", VF.createLiteral(Boolean.parseBoolean(infer)));
// if (useStats != null && useStats.length() > 0)
-// tupleQuery.setBinding("useStats", vf.createLiteral(Boolean.parseBoolean(useStats)));
+// tupleQuery.setBinding("useStats", VF.createLiteral(Boolean.parseBoolean(useStats)));
// if (timeUris != null && timeUris.length() > 0)
-// tupleQuery.setBinding("timeUris", vf.createURI(timeUris));
+// tupleQuery.setBinding("timeUris", VF.createIRI(timeUris));
// if (tablePrefix != null && tablePrefix.length() > 0)
// RdfCloudTripleStoreConstants.prefixTables(tablePrefix);
// SPARQLResultsXMLWriter sparqlWriter = new SPARQLResultsXMLWriter(os);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QuerySerqlDataServlet.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QuerySerqlDataServlet.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QuerySerqlDataServlet.java
index 89dd84a..2576da2 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QuerySerqlDataServlet.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/cloudbase/sail/QuerySerqlDataServlet.java
@@ -20,14 +20,14 @@
//package org.apache.cloud.rdf.web.cloudbase.sail;
//
-//import org.openrdf.query.GraphQuery;
-//import org.openrdf.query.QueryLanguage;
-//import org.openrdf.query.TupleQuery;
-//import org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
-//import org.openrdf.repository.Repository;
-//import org.openrdf.repository.RepositoryConnection;
-//import org.openrdf.repository.RepositoryException;
-//import org.openrdf.rio.rdfxml.RDFXMLWriter;
+//import org.eclipse.rdf4j.query.GraphQuery;
+//import org.eclipse.rdf4j.query.QueryLanguage;
+//import org.eclipse.rdf4j.query.TupleQuery;
+//import org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
+//import org.eclipse.rdf4j.repository.Repository;
+//import org.eclipse.rdf4j.repository.RepositoryConnection;
+//import org.eclipse.rdf4j.repository.RepositoryException;
+//import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter;
//
//import javax.servlet.ServletException;
//import javax.servlet.ServletOutputStream;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/java/org/apache/cloud/rdf/web/sail/RdfController.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/sail/RdfController.java b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/sail/RdfController.java
index ab539c4..5044413 100644
--- a/web/web.rya/src/main/java/org/apache/cloud/rdf/web/sail/RdfController.java
+++ b/web/web.rya/src/main/java/org/apache/cloud/rdf/web/sail/RdfController.java
@@ -19,8 +19,6 @@ package org.apache.cloud.rdf.web.sail;
* under the License.
*/
-
-
import static org.apache.rya.api.RdfCloudTripleStoreConstants.VALUE_FACTORY;
import java.io.IOException;
@@ -40,35 +38,36 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.log.LogUtils;
import org.apache.rya.api.security.SecurityProvider;
import org.apache.rya.rdftriplestore.RdfCloudTripleStoreConnection;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.GraphQuery;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.QueryResultHandlerException;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResultHandler;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.Update;
-import org.openrdf.query.UpdateExecutionException;
-import org.openrdf.query.parser.ParsedGraphQuery;
-import org.openrdf.query.parser.ParsedOperation;
-import org.openrdf.query.parser.ParsedTupleQuery;
-import org.openrdf.query.parser.ParsedUpdate;
-import org.openrdf.query.parser.QueryParserUtil;
-import org.openrdf.query.resultio.sparqljson.SPARQLResultsJSONWriter;
-import org.openrdf.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandler;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.rdfxml.RDFXMLWriter;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.GraphQuery;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.QueryResultHandlerException;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResultHandler;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.query.UpdateExecutionException;
+import org.eclipse.rdf4j.query.parser.ParsedGraphQuery;
+import org.eclipse.rdf4j.query.parser.ParsedOperation;
+import org.eclipse.rdf4j.query.parser.ParsedTupleQuery;
+import org.eclipse.rdf4j.query.parser.ParsedUpdate;
+import org.eclipse.rdf4j.query.parser.QueryParserUtil;
+import org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLResultsJSONWriter;
+import org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsXMLWriter;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandler;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
@@ -332,7 +331,7 @@ public class RdfController {
throws RepositoryException, IOException, RDFParseException {
RDFFormat format_r = RDFFormat.RDFXML;
if (format != null) {
- format_r = RDFFormat.valueOf(format);
+ format_r = RdfFormatUtils.getRdfFormatFromName(format);
if (format_r == null) {
throw new RuntimeException("RDFFormat[" + format + "] not found");
}
@@ -341,7 +340,7 @@ public class RdfController {
// add named graph as context (if specified).
final List<Resource> contextList = new ArrayList<Resource>();
if (graph != null) {
- contextList.add(VALUE_FACTORY.createURI(graph));
+ contextList.add(VALUE_FACTORY.createIRI(graph));
}
SailRepositoryConnection conn = null;
try {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml
----------------------------------------------------------------------
diff --git a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml
index 9f96b6f..ba9a945 100644
--- a/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml
+++ b/web/web.rya/src/main/webapp/WEB-INF/spring/spring-root-extensions.xml
@@ -99,7 +99,7 @@ under the License.
<constructor-arg ref="indexerSettings"/>
</bean>
- <bean id="indexingSailRepo" class="org.openrdf.repository.sail.SailRepository" init-method="initialize" destroy-method="shutDown">
+ <bean id="indexingSailRepo" class="org.eclipse.rdf4j.repository.sail.SailRepository" init-method="initialize" destroy-method="shutDown">
<constructor-arg ref="ryaIndexingSail"/>
</bean>
</beans>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerAccumuloTest.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerAccumuloTest.java b/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerAccumuloTest.java
index 4d50df0..88c0739 100644
--- a/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerAccumuloTest.java
+++ b/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerAccumuloTest.java
@@ -19,7 +19,6 @@ package org.apache.cloud.rdf.web.sail;
* under the License.
*/
-
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@@ -30,18 +29,18 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standal
import java.io.ByteArrayInputStream;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.resultio.QueryResultIO;
+import org.eclipse.rdf4j.query.resultio.TupleQueryResultFormat;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.resultio.QueryResultIO;
-import org.openrdf.query.resultio.TupleQueryResultFormat;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.rio.RDFFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpServletResponse;
@@ -154,7 +153,7 @@ public class RdfControllerAccumuloTest {
private static void validateCount(MockHttpServletResponse response, int count) throws Exception {
String rstString = response.getContentAsString();
- TupleQueryResult result = QueryResultIO.parse(new ByteArrayInputStream(rstString.getBytes()), TupleQueryResultFormat.SPARQL);
+ TupleQueryResult result = QueryResultIO.parseTuple(new ByteArrayInputStream(rstString.getBytes()), TupleQueryResultFormat.SPARQL);
assertEquals(1, result.getBindingNames().size());
String binding = result.getBindingNames().get(0);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerTest.java
----------------------------------------------------------------------
diff --git a/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerTest.java b/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerTest.java
index f69de61..80227b1 100644
--- a/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerTest.java
+++ b/web/web.rya/src/test/java/org/apache/cloud/rdf/web/sail/RdfControllerTest.java
@@ -28,17 +28,17 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.repository.Repository;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
-import org.openrdf.model.Literal;
-import org.openrdf.model.URI;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.rio.RDFFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
@@ -170,8 +170,8 @@ public class RdfControllerTest {
ValueFactory vf = repository.getValueFactory();
RepositoryConnection con = repository.getConnection();
- URI s = vf.createURI("http://mynamespace/ProductType1");
- URI p = vf.createURI("http://mynamespace#pred1");
+ IRI s = vf.createIRI("http://mynamespace/ProductType1");
+ IRI p = vf.createIRI("http://mynamespace#pred1");
Literal o = vf.createLiteral("test");
assertTrue(con.getStatements(s, p, o, false).hasNext());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/web/web.rya/src/test/resources/controllerTest-context.xml
----------------------------------------------------------------------
diff --git a/web/web.rya/src/test/resources/controllerTest-context.xml b/web/web.rya/src/test/resources/controllerTest-context.xml
index 39c018d..4286fae 100644
--- a/web/web.rya/src/test/resources/controllerTest-context.xml
+++ b/web/web.rya/src/test/resources/controllerTest-context.xml
@@ -27,11 +27,11 @@ under the License.
<bean id="controller" class="org.apache.cloud.rdf.web.sail.RdfController">
</bean>
- <bean id="repository" class="org.openrdf.repository.sail.SailRepository" init-method="initialize">
+ <bean id="repository" class="org.eclipse.rdf4j.repository.sail.SailRepository" init-method="initialize">
<constructor-arg ref="memoryStore"/>
</bean>
- <bean id="memoryStore" class="org.openrdf.sail.memory.MemoryStore">
+ <bean id="memoryStore" class="org.eclipse.rdf4j.sail.memory.MemoryStore">
<property name="persist" value="false"/>
</bean>
[05/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
index 86359f0..8d6feb6 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferenceEngine.java
@@ -52,24 +52,22 @@ import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.helpers.RDFHandlerBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
import com.google.common.collect.Sets;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Will pull down inference relationships from dao every x seconds. <br>
* Will infer extra relationships. <br>
@@ -77,9 +75,9 @@ import info.aduna.iteration.CloseableIteration;
*/
public class InferenceEngine {
private static final Logger log = Logger.getLogger(InferenceEngine.class);
- private static final ValueFactory VF = ValueFactoryImpl.getInstance();
- private static final URI HAS_SELF = VF.createURI(OWL.NAMESPACE, "hasSelf");
- private static final URI REFLEXIVE_PROPERTY = VF.createURI(OWL.NAMESPACE, "ReflexiveProperty");
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+ private static final IRI HAS_SELF = VF.createIRI(OWL.NAMESPACE, "hasSelf");
+ private static final IRI REFLEXIVE_PROPERTY = VF.createIRI(OWL.NAMESPACE, "ReflexiveProperty");
public static final String URI_PROP = "uri";
private final ReentrantLock refreshLock = new ReentrantLock();
@@ -87,22 +85,22 @@ public class InferenceEngine {
private final AtomicReference<Graph> subClassOfGraph = new AtomicReference<>();
private final AtomicReference<Graph> subPropertyOfGraph = new AtomicReference<>();
- private final Set<URI> symmetricPropertySet = ConcurrentHashMap.newKeySet();;
- private final Map<URI, URI> inverseOfMap = new ConcurrentHashMap<>();
- private final Set<URI> transitivePropertySet = ConcurrentHashMap.newKeySet();;
- private final Set<URI> reflexivePropertySet = ConcurrentHashMap.newKeySet();;
- private final Map<URI, Set<URI>> domainByType = new ConcurrentHashMap<>();
- private final Map<URI, Set<URI>> rangeByType = new ConcurrentHashMap<>();
- private final Map<Resource, Map<URI, Value>> hasValueByType = new ConcurrentHashMap<>();
- private final Map<URI, Map<Resource, Value>> hasValueByProperty = new ConcurrentHashMap<>();
- private final Map<Resource, Map<Resource, URI>> someValuesFromByRestrictionType = new ConcurrentHashMap<>();
- private final Map<Resource, Map<Resource, URI>> allValuesFromByValueType = new ConcurrentHashMap<>();
+ private final Set<IRI> symmetricPropertySet = ConcurrentHashMap.newKeySet();;
+ private final Map<IRI, IRI> inverseOfMap = new ConcurrentHashMap<>();
+ private final Set<IRI> transitivePropertySet = ConcurrentHashMap.newKeySet();;
+ private final Set<IRI> reflexivePropertySet = ConcurrentHashMap.newKeySet();;
+ private final Map<IRI, Set<IRI>> domainByType = new ConcurrentHashMap<>();
+ private final Map<IRI, Set<IRI>> rangeByType = new ConcurrentHashMap<>();
+ private final Map<Resource, Map<IRI, Value>> hasValueByType = new ConcurrentHashMap<>();
+ private final Map<IRI, Map<Resource, Value>> hasValueByProperty = new ConcurrentHashMap<>();
+ private final Map<Resource, Map<Resource, IRI>> someValuesFromByRestrictionType = new ConcurrentHashMap<>();
+ private final Map<Resource, Map<Resource, IRI>> allValuesFromByValueType = new ConcurrentHashMap<>();
private final Map<Resource, List<Set<Resource>>> intersections = new ConcurrentHashMap<>();
private final Map<Resource, Set<Resource>> enumerations = new ConcurrentHashMap<>();
- private final Map<URI, List<URI>> propertyChainPropertyToChain = new ConcurrentHashMap<>();
+ private final Map<IRI, List<IRI>> propertyChainPropertyToChain = new ConcurrentHashMap<>();
// hasSelf maps.
- private final Map<URI, Set<Resource>> hasSelfByProperty = new ConcurrentHashMap<>();
- private final Map<Resource, Set<URI>> hasSelfByType = new ConcurrentHashMap<>();
+ private final Map<IRI, Set<Resource>> hasSelfByProperty = new ConcurrentHashMap<>();
+ private final Map<Resource, Set<IRI>> hasSelfByType = new ConcurrentHashMap<>();
private RyaDAO<?> ryaDAO;
private RdfCloudTripleStoreConfiguration conf;
@@ -207,13 +205,13 @@ public class InferenceEngine {
* to have few members, such as ontology vocabulary terms, as instances will be collected in
* memory.
*/
- private Set<URI> fetchInstances(final URI type) throws QueryEvaluationException {
- final Set<URI> instances = new HashSet<>();
- ryaDaoQueryWrapper.queryAll(null, RDF.TYPE, type, new RDFHandlerBase() {
+ private Set<IRI> fetchInstances(final IRI type) throws QueryEvaluationException {
+ final Set<IRI> instances = new HashSet<>();
+ ryaDaoQueryWrapper.queryAll(null, RDF.TYPE, type, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement st) throws RDFHandlerException {
- if (st.getSubject() instanceof URI) {
- instances.add((URI) st.getSubject());
+ if (st.getSubject() instanceof IRI) {
+ instances.add((IRI) st.getSubject());
}
}
});
@@ -231,7 +229,7 @@ public class InferenceEngine {
* @param edgeName Label that will be given to all added edges
* @throws QueryEvaluationException
*/
- private void addPredicateEdges(final URI predicate, final Direction dir, final Graph graph, final String edgeName)
+ private void addPredicateEdges(final IRI predicate, final Direction dir, final Graph graph, final String edgeName)
throws QueryEvaluationException {
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO,
null, predicate, null, conf);
@@ -242,7 +240,7 @@ public class InferenceEngine {
addStatementEdge(graph, edgeName, st);
}
if (Direction.IN.equals(dir) || Direction.BOTH.equals(dir)) {
- addStatementEdge(graph, edgeName, new StatementImpl((Resource) st.getObject(),
+ addStatementEdge(graph, edgeName, VF.createStatement((Resource) st.getObject(),
st.getPredicate(), st.getSubject()));
}
}
@@ -309,12 +307,12 @@ public class InferenceEngine {
private void refreshInverseOf() throws QueryEvaluationException {
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, null, OWL.INVERSEOF, null, conf);
- final Map<URI, URI> invProp = new HashMap<>();
+ final Map<IRI, IRI> invProp = new HashMap<>();
try {
while (iter.hasNext()) {
final Statement st = iter.next();
- invProp.put((URI) st.getSubject(), (URI) st.getObject());
- invProp.put((URI) st.getObject(), (URI) st.getSubject());
+ invProp.put((IRI) st.getSubject(), (IRI) st.getObject());
+ invProp.put((IRI) st.getObject(), (IRI) st.getSubject());
}
} finally {
if (iter != null) {
@@ -329,14 +327,14 @@ public class InferenceEngine {
private void refreshPropertyChainPropertyToChain() throws QueryEvaluationException {
CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, null,
- VF.createURI("http://www.w3.org/2002/07/owl#propertyChainAxiom"),
+ VF.createIRI("http://www.w3.org/2002/07/owl#propertyChainAxiom"),
null, conf);
- final Map<URI,URI> propertyChainPropertiesToBNodes = new HashMap<>();
- final Map<URI, List<URI>> tempPropertyChainPropertyToChain = new HashMap<>();
+ final Map<IRI, IRI> propertyChainPropertiesToBNodes = new HashMap<>();
+ final Map<IRI, List<IRI>> tempPropertyChainPropertyToChain = new HashMap<>();
try {
while (iter.hasNext()){
final Statement st = iter.next();
- propertyChainPropertiesToBNodes.put((URI)st.getSubject(), (URI)st.getObject());
+ propertyChainPropertiesToBNodes.put((IRI)st.getSubject(), (IRI)st.getObject());
}
} finally {
if (iter != null) {
@@ -344,19 +342,19 @@ public class InferenceEngine {
}
}
// now for each property chain bNode, get the indexed list of properties associated with that chain
- for (final URI propertyChainProperty : propertyChainPropertiesToBNodes.keySet()){
- final URI bNode = propertyChainPropertiesToBNodes.get(propertyChainProperty);
+ for (final IRI propertyChainProperty : propertyChainPropertiesToBNodes.keySet()){
+ final IRI bNode = propertyChainPropertiesToBNodes.get(propertyChainProperty);
// query for the list of indexed properties
- iter = RyaDAOHelper.query(ryaDAO, bNode, VF.createURI("http://www.w3.org/2000/10/swap/list#index"),
+ iter = RyaDAOHelper.query(ryaDAO, bNode, VF.createIRI("http://www.w3.org/2000/10/swap/list#index"),
null, conf);
- final TreeMap<Integer, URI> orderedProperties = new TreeMap<>();
+ final TreeMap<Integer, IRI> orderedProperties = new TreeMap<>();
// TODO refactor this. Wish I could execute sparql
try {
while (iter.hasNext()){
final Statement st = iter.next();
final String indexedElement = st.getObject().stringValue();
log.info(indexedElement);
- CloseableIteration<Statement, QueryEvaluationException> iter2 = RyaDAOHelper.query(ryaDAO, VF.createURI(st.getObject().stringValue()), RDF.FIRST,
+ CloseableIteration<Statement, QueryEvaluationException> iter2 = RyaDAOHelper.query(ryaDAO, VF.createIRI(st.getObject().stringValue()), RDF.FIRST,
null, conf);
String integerValue = "";
Value anonPropNode = null;
@@ -369,7 +367,7 @@ public class InferenceEngine {
}
iter2.close();
}
- iter2 = RyaDAOHelper.query(ryaDAO, VF.createURI(st.getObject().stringValue()), RDF.REST,
+ iter2 = RyaDAOHelper.query(ryaDAO, VF.createIRI(st.getObject().stringValue()), RDF.REST,
null, conf);
if (iter2 != null){
while (iter2.hasNext()){
@@ -379,7 +377,7 @@ public class InferenceEngine {
}
iter2.close();
if (anonPropNode != null){
- iter2 = RyaDAOHelper.query(ryaDAO, VF.createURI(anonPropNode.stringValue()), RDF.FIRST,
+ iter2 = RyaDAOHelper.query(ryaDAO, VF.createIRI(anonPropNode.stringValue()), RDF.FIRST,
null, conf);
while (iter2.hasNext()){
final Statement iter2Statement = iter2.next();
@@ -392,7 +390,7 @@ public class InferenceEngine {
if (!integerValue.isEmpty() && propURI!=null) {
try {
final int indexValue = Integer.parseInt(integerValue);
- final URI chainPropURI = VF.createURI(propURI.stringValue());
+ final IRI chainPropURI = VF.createIRI(propURI.stringValue());
orderedProperties.put(indexValue, chainPropURI);
}
catch (final Exception e){
@@ -405,44 +403,44 @@ public class InferenceEngine {
iter.close();
}
}
- final List<URI> properties = new ArrayList<>();
- for (final Map.Entry<Integer, URI> entry : orderedProperties.entrySet()){
+ final List<IRI> properties = new ArrayList<>();
+ for (final Map.Entry<Integer, IRI> entry : orderedProperties.entrySet()){
properties.add(entry.getValue());
}
tempPropertyChainPropertyToChain.put(propertyChainProperty, properties);
}
// could also be represented as a list of properties (some of which may be blank nodes)
- for (final URI propertyChainProperty : propertyChainPropertiesToBNodes.keySet()){
- final List<URI> existingChain = tempPropertyChainPropertyToChain.get(propertyChainProperty);
+ for (final IRI propertyChainProperty : propertyChainPropertiesToBNodes.keySet()){
+ final List<IRI> existingChain = tempPropertyChainPropertyToChain.get(propertyChainProperty);
// if we didn't get a chain, try to get it through following the collection
if ((existingChain == null) || existingChain.isEmpty()) {
CloseableIteration<Statement, QueryEvaluationException> iter2 = RyaDAOHelper.query(ryaDAO, propertyChainPropertiesToBNodes.get(propertyChainProperty), RDF.FIRST,
null, conf);
- final List<URI> properties = new ArrayList<>();
- URI previousBNode = propertyChainPropertiesToBNodes.get(propertyChainProperty);
+ final List<IRI> properties = new ArrayList<>();
+ IRI previousBNode = propertyChainPropertiesToBNodes.get(propertyChainProperty);
if (iter2.hasNext()) {
Statement iter2Statement = iter2.next();
Value currentPropValue = iter2Statement.getObject();
while ((currentPropValue != null) && (!currentPropValue.stringValue().equalsIgnoreCase(RDF.NIL.stringValue()))){
- if (currentPropValue instanceof URI){
- iter2 = RyaDAOHelper.query(ryaDAO, VF.createURI(currentPropValue.stringValue()), RDF.FIRST,
+ if (currentPropValue instanceof IRI){
+ iter2 = RyaDAOHelper.query(ryaDAO, VF.createIRI(currentPropValue.stringValue()), RDF.FIRST,
null, conf);
if (iter2.hasNext()){
iter2Statement = iter2.next();
- if (iter2Statement.getObject() instanceof URI){
- properties.add((URI)iter2Statement.getObject());
+ if (iter2Statement.getObject() instanceof IRI){
+ properties.add((IRI)iter2Statement.getObject());
}
}
// otherwise see if there is an inverse declaration
else {
- iter2 = RyaDAOHelper.query(ryaDAO, VF.createURI(currentPropValue.stringValue()), OWL.INVERSEOF,
+ iter2 = RyaDAOHelper.query(ryaDAO, VF.createIRI(currentPropValue.stringValue()), OWL.INVERSEOF,
null, conf);
if (iter2.hasNext()){
iter2Statement = iter2.next();
- if (iter2Statement.getObject() instanceof URI){
- properties.add(new InverseURI((URI)iter2Statement.getObject()));
+ if (iter2Statement.getObject() instanceof IRI){
+ properties.add(new InverseURI((IRI)iter2Statement.getObject()));
}
}
}
@@ -451,7 +449,7 @@ public class InferenceEngine {
null, conf);
if (iter2.hasNext()){
iter2Statement = iter2.next();
- previousBNode = (URI)currentPropValue;
+ previousBNode = (IRI)currentPropValue;
currentPropValue = iter2Statement.getObject();
}
else {
@@ -490,8 +488,8 @@ public class InferenceEngine {
* @throws QueryEvaluationException
*/
private void refreshDomainRange() throws QueryEvaluationException {
- final Map<URI, Set<URI>> domainByTypePartial = new ConcurrentHashMap<>();
- final Map<URI, Set<URI>> rangeByTypePartial = new ConcurrentHashMap<>();
+ final Map<IRI, Set<IRI>> domainByTypePartial = new ConcurrentHashMap<>();
+ final Map<IRI, Set<IRI>> rangeByTypePartial = new ConcurrentHashMap<>();
// First, populate domain and range based on direct domain/range triples.
CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, null, RDFS.DOMAIN, null, conf);
try {
@@ -499,11 +497,11 @@ public class InferenceEngine {
final Statement st = iter.next();
final Resource property = st.getSubject();
final Value domainType = st.getObject();
- if (domainType instanceof URI && property instanceof URI) {
+ if (domainType instanceof IRI && property instanceof IRI) {
if (!domainByTypePartial.containsKey(domainType)) {
- domainByTypePartial.put((URI) domainType, new HashSet<>());
+ domainByTypePartial.put((IRI) domainType, new HashSet<>());
}
- domainByTypePartial.get(domainType).add((URI) property);
+ domainByTypePartial.get(domainType).add((IRI) property);
}
}
} finally {
@@ -517,11 +515,11 @@ public class InferenceEngine {
final Statement st = iter.next();
final Resource property = st.getSubject();
final Value rangeType = st.getObject();
- if (rangeType instanceof URI && property instanceof URI) {
+ if (rangeType instanceof IRI && property instanceof IRI) {
if (!rangeByTypePartial.containsKey(rangeType)) {
- rangeByTypePartial.put((URI) rangeType, new HashSet<>());
+ rangeByTypePartial.put((IRI) rangeType, new HashSet<>());
}
- rangeByTypePartial.get(rangeType).add((URI) property);
+ rangeByTypePartial.get(rangeType).add((IRI) property);
}
}
} finally {
@@ -531,26 +529,26 @@ public class InferenceEngine {
}
// Then combine with the subclass/subproperty graphs and the inverse property map to compute
// the closure of domain and range per class.
- final Set<URI> domainRangeTypeSet = new HashSet<>(domainByTypePartial.keySet());
+ final Set<IRI> domainRangeTypeSet = new HashSet<>(domainByTypePartial.keySet());
domainRangeTypeSet.addAll(rangeByTypePartial.keySet());
// Extend to subproperties: make sure that using a more specific form of a property
// still triggers its domain/range inferences.
// Mirror for inverse properties: make sure that using the inverse form of a property
// triggers the inverse domain/range inferences.
// These two rules can recursively trigger one another.
- for (final URI domainRangeType : domainRangeTypeSet) {
- final Set<URI> propertiesWithDomain = domainByTypePartial.getOrDefault(domainRangeType, new HashSet<>());
- final Set<URI> propertiesWithRange = rangeByTypePartial.getOrDefault(domainRangeType, new HashSet<>());
+ for (final IRI domainRangeType : domainRangeTypeSet) {
+ final Set<IRI> propertiesWithDomain = domainByTypePartial.getOrDefault(domainRangeType, new HashSet<>());
+ final Set<IRI> propertiesWithRange = rangeByTypePartial.getOrDefault(domainRangeType, new HashSet<>());
// Since findParents will traverse the subproperty graph and find all indirect
// subproperties, the subproperty rule does not need to trigger itself directly.
// And since no more than one inverseOf relationship is stored for any property, the
// inverse property rule does not need to trigger itself directly. However, each rule
// can trigger the other, so keep track of how the inferred domains/ranges were
// discovered so we can apply only those rules that might yield new information.
- final Stack<URI> domainViaSuperProperty = new Stack<>();
- final Stack<URI> rangeViaSuperProperty = new Stack<>();
- final Stack<URI> domainViaInverseProperty = new Stack<>();
- final Stack<URI> rangeViaInverseProperty = new Stack<>();
+ final Stack<IRI> domainViaSuperProperty = new Stack<>();
+ final Stack<IRI> rangeViaSuperProperty = new Stack<>();
+ final Stack<IRI> domainViaInverseProperty = new Stack<>();
+ final Stack<IRI> rangeViaInverseProperty = new Stack<>();
// Start with the direct domain/range assertions, which can trigger any rule.
domainViaSuperProperty.addAll(propertiesWithDomain);
domainViaInverseProperty.addAll(propertiesWithDomain);
@@ -563,8 +561,8 @@ public class InferenceEngine {
// For a type c and property p, if c is a domain of p, then c is the range of any
// inverse of p. Would be redundant for properties discovered via inverseOf.
while (!domainViaSuperProperty.isEmpty()) {
- final URI property = domainViaSuperProperty.pop();
- final URI inverseProperty = findInverseOf(property);
+ final IRI property = domainViaSuperProperty.pop();
+ final IRI inverseProperty = findInverseOf(property);
if (inverseProperty != null && propertiesWithRange.add(inverseProperty)) {
rangeViaInverseProperty.push(inverseProperty);
}
@@ -572,8 +570,8 @@ public class InferenceEngine {
// For a type c and property p, if c is a range of p, then c is the domain of any
// inverse of p. Would be redundant for properties discovered via inverseOf.
while (!rangeViaSuperProperty.isEmpty()) {
- final URI property = rangeViaSuperProperty.pop();
- final URI inverseProperty = findInverseOf(property);
+ final IRI property = rangeViaSuperProperty.pop();
+ final IRI inverseProperty = findInverseOf(property);
if (inverseProperty != null && propertiesWithDomain.add(inverseProperty)) {
domainViaInverseProperty.push(inverseProperty);
}
@@ -581,8 +579,8 @@ public class InferenceEngine {
// For a type c and property p, if c is a domain of p, then c is also a domain of
// p's subproperties. Would be redundant for properties discovered via this rule.
while (!domainViaInverseProperty.isEmpty()) {
- final URI property = domainViaInverseProperty.pop();
- final Set<URI> subProperties = getSubProperties(property);
+ final IRI property = domainViaInverseProperty.pop();
+ final Set<IRI> subProperties = getSubProperties(property);
subProperties.removeAll(propertiesWithDomain);
propertiesWithDomain.addAll(subProperties);
domainViaSuperProperty.addAll(subProperties);
@@ -590,8 +588,8 @@ public class InferenceEngine {
// For a type c and property p, if c is a range of p, then c is also a range of
// p's subproperties. Would be redundant for properties discovered via this rule.
while (!rangeViaInverseProperty.isEmpty()) {
- final URI property = rangeViaInverseProperty.pop();
- final Set<URI> subProperties = getSubProperties(property);
+ final IRI property = rangeViaInverseProperty.pop();
+ final Set<IRI> subProperties = getSubProperties(property);
subProperties.removeAll(propertiesWithRange);
propertiesWithRange.addAll(subProperties);
rangeViaSuperProperty.addAll(subProperties);
@@ -607,23 +605,23 @@ public class InferenceEngine {
// Once all properties have been found for each domain/range class, extend to superclasses:
// make sure that the consequent of a domain/range inference goes on to apply any more
// general classes as well.
- for (final URI subtype : domainRangeTypeSet) {
- final Set<URI> supertypes = getSuperClasses(subtype);
- final Set<URI> propertiesWithDomain = domainByTypePartial.getOrDefault(subtype, new HashSet<>());
- final Set<URI> propertiesWithRange = rangeByTypePartial.getOrDefault(subtype, new HashSet<>());
- for (final URI supertype : supertypes) {
+ for (final IRI subtype : domainRangeTypeSet) {
+ final Set<IRI> supertypes = getSuperClasses(subtype);
+ final Set<IRI> propertiesWithDomain = domainByTypePartial.getOrDefault(subtype, new HashSet<>());
+ final Set<IRI> propertiesWithRange = rangeByTypePartial.getOrDefault(subtype, new HashSet<>());
+ for (final IRI supertype : supertypes) {
// For a property p and its domain c: all of c's superclasses are also domains of p.
if (!propertiesWithDomain.isEmpty() && !domainByTypePartial.containsKey(supertype)) {
domainByTypePartial.put(supertype, new HashSet<>());
}
- for (final URI property : propertiesWithDomain) {
+ for (final IRI property : propertiesWithDomain) {
domainByTypePartial.get(supertype).add(property);
}
// For a property p and its range c: all of c's superclasses are also ranges of p.
if (!propertiesWithRange.isEmpty() && !rangeByTypePartial.containsKey(supertype)) {
rangeByTypePartial.put(supertype, new HashSet<>());
}
- for (final URI property : propertiesWithRange) {
+ for (final IRI property : propertiesWithRange) {
rangeByTypePartial.get(supertype).add(property);
}
}
@@ -641,11 +639,11 @@ public class InferenceEngine {
private void refreshPropertyRestrictions() throws QueryEvaluationException {
// Get a set of all property restrictions of any type
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, null, OWL.ONPROPERTY, null, conf);
- final Map<Resource, URI> restrictions = new HashMap<>();
+ final Map<Resource, IRI> restrictions = new HashMap<>();
try {
while (iter.hasNext()) {
final Statement st = iter.next();
- restrictions.put(st.getSubject(), (URI) st.getObject());
+ restrictions.put(st.getSubject(), (IRI) st.getObject());
}
} finally {
if (iter != null) {
@@ -659,7 +657,7 @@ public class InferenceEngine {
refreshHasSelfRestrictions(restrictions);
}
- private void refreshHasValueRestrictions(final Map<Resource, URI> restrictions) throws QueryEvaluationException {
+ private void refreshHasValueRestrictions(final Map<Resource, IRI> restrictions) throws QueryEvaluationException {
hasValueByType.clear();
hasValueByProperty.clear();
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, null, OWL.HASVALUE, null, conf);
@@ -668,7 +666,7 @@ public class InferenceEngine {
final Statement st = iter.next();
final Resource restrictionClass = st.getSubject();
if (restrictions.containsKey(restrictionClass)) {
- final URI property = restrictions.get(restrictionClass);
+ final IRI property = restrictions.get(restrictionClass);
final Value value = st.getObject();
if (!hasValueByType.containsKey(restrictionClass)) {
hasValueByType.put(restrictionClass, new HashMap<>());
@@ -687,20 +685,20 @@ public class InferenceEngine {
}
}
- private void refreshSomeValuesFromRestrictions(final Map<Resource, URI> restrictions) throws QueryEvaluationException {
+ private void refreshSomeValuesFromRestrictions(final Map<Resource, IRI> restrictions) throws QueryEvaluationException {
someValuesFromByRestrictionType.clear();
- ryaDaoQueryWrapper.queryAll(null, OWL.SOMEVALUESFROM, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryAll(null, OWL.SOMEVALUESFROM, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
final Resource restrictionClass = statement.getSubject();
if (restrictions.containsKey(restrictionClass) && statement.getObject() instanceof Resource) {
- final URI property = restrictions.get(restrictionClass);
+ final IRI property = restrictions.get(restrictionClass);
final Resource valueClass = (Resource) statement.getObject();
// Should also be triggered by subclasses of the value class
final Set<Resource> valueClasses = new HashSet<>();
valueClasses.add(valueClass);
- if (valueClass instanceof URI) {
- valueClasses.addAll(getSubClasses((URI) valueClass));
+ if (valueClass instanceof IRI) {
+ valueClasses.addAll(getSubClasses((IRI) valueClass));
}
for (final Resource valueSubClass : valueClasses) {
if (!someValuesFromByRestrictionType.containsKey(restrictionClass)) {
@@ -713,20 +711,20 @@ public class InferenceEngine {
});
}
- private void refreshAllValuesFromRestrictions(final Map<Resource, URI> restrictions) throws QueryEvaluationException {
+ private void refreshAllValuesFromRestrictions(final Map<Resource, IRI> restrictions) throws QueryEvaluationException {
allValuesFromByValueType.clear();
- ryaDaoQueryWrapper.queryAll(null, OWL.ALLVALUESFROM, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryAll(null, OWL.ALLVALUESFROM, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
final Resource directRestrictionClass = statement.getSubject();
if (restrictions.containsKey(directRestrictionClass) && statement.getObject() instanceof Resource) {
- final URI property = restrictions.get(directRestrictionClass);
+ final IRI property = restrictions.get(directRestrictionClass);
final Resource valueClass = (Resource) statement.getObject();
// Should also be triggered by subclasses of the property restriction
final Set<Resource> restrictionClasses = new HashSet<>();
restrictionClasses.add(directRestrictionClass);
- if (directRestrictionClass instanceof URI) {
- restrictionClasses.addAll(getSubClasses((URI) directRestrictionClass));
+ if (directRestrictionClass instanceof IRI) {
+ restrictionClasses.addAll(getSubClasses((IRI) directRestrictionClass));
}
for (final Resource restrictionClass : restrictionClasses) {
if (!allValuesFromByValueType.containsKey(valueClass)) {
@@ -739,16 +737,16 @@ public class InferenceEngine {
});
}
- private void refreshHasSelfRestrictions(final Map<Resource, URI> restrictions) throws QueryEvaluationException {
+ private void refreshHasSelfRestrictions(final Map<Resource, IRI> restrictions) throws QueryEvaluationException {
hasSelfByType.clear();
hasSelfByProperty.clear();
for(final Resource type : restrictions.keySet()) {
- final URI property = restrictions.get(type);
+ final IRI property = restrictions.get(type);
final CloseableIteration<Statement, QueryEvaluationException> iter = RyaDAOHelper.query(ryaDAO, type, HAS_SELF, null, conf);
try {
if (iter.hasNext()) {
- Set<URI> typeSet = hasSelfByType.get(type);
+ Set<IRI> typeSet = hasSelfByType.get(type);
Set<Resource> propSet = hasSelfByProperty.get(property);
if (typeSet == null) {
@@ -784,12 +782,12 @@ public class InferenceEngine {
// _:bnode1 rdf:rest _:bnode2 .
// _:bnode2 rdf:first <:C> .
// _:bnode2 rdf:rest rdf:nil .
- ryaDaoQueryWrapper.queryAll(null, OWL.INTERSECTIONOF, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryAll(null, OWL.INTERSECTIONOF, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
final Resource type = statement.getSubject();
// head will point to a type that is part of the intersection.
- final URI head = (URI) statement.getObject();
+ final IRI head = (IRI) statement.getObject();
if (!intersectionsProp.containsKey(type)) {
intersectionsProp.put(type, new ArrayList<Set<Resource>>());
}
@@ -840,8 +838,8 @@ public class InferenceEngine {
final Resource type = entry.getKey();
final List<Set<Resource>> intersectionList = entry.getValue();
- final Set<URI> superClasses = getSuperClasses((URI) type);
- for (final URI superClass : superClasses) {
+ final Set<IRI> superClasses = getSuperClasses((IRI) type);
+ for (final IRI superClass : superClasses) {
// Add intersections to super classes if applicable.
// IF:
// :A intersectionOf[:B, :C]
@@ -881,12 +879,12 @@ public class InferenceEngine {
// _:bnode1 rdf:rest _:bnode2 .
// _:bnode2 rdf:first <:C> .
// _:bnode2 rdf:rest rdf:nil .
- ryaDaoQueryWrapper.queryAll(null, OWL.ONEOF, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryAll(null, OWL.ONEOF, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
final Resource enumType = statement.getSubject();
// listHead will point to a type class of the enumeration.
- final URI listHead = (URI) statement.getObject();
+ final IRI listHead = (IRI) statement.getObject();
if (!enumTypes.containsKey(enumType)) {
enumTypes.put(enumType, new LinkedHashSet<Resource>());
}
@@ -926,17 +924,17 @@ public class InferenceEngine {
* resource has that value for that property, it is implied to
* belong to the type.
*/
- public Set<URI> getHasSelfImplyingType(final Resource type){
+ public Set<IRI> getHasSelfImplyingType(final Resource type){
// return properties that imply this type if reflexive
- final Set<URI> properties = new HashSet<>();
- Set<URI> tempProperties = hasSelfByType.get(type);
+ final Set<IRI> properties = new HashSet<>();
+ Set<IRI> tempProperties = hasSelfByType.get(type);
if (tempProperties != null) {
properties.addAll(tempProperties);
}
//findParent gets all subclasses, add self.
- if (type instanceof URI) {
- for (final URI subtype : findParents(subClassOfGraph.get(), (URI) type)) {
+ if (type instanceof IRI) {
+ for (final IRI subtype : findParents(subClassOfGraph.get(), (IRI) type)) {
tempProperties = hasSelfByType.get(subtype);
if (tempProperties != null) {
properties.addAll(tempProperties);
@@ -957,7 +955,7 @@ public class InferenceEngine {
* @param property The property whose owl:hasSelf restrictions to return
* @return A set of types that possess the implied property.
*/
- public Set<Resource> getHasSelfImplyingProperty(final URI property) {
+ public Set<Resource> getHasSelfImplyingProperty(final IRI property) {
// return types that imply this type if reflexive
final Set<Resource> types = new HashSet<>();
final Set<Resource> baseTypes = hasSelfByProperty.get(property);
@@ -966,8 +964,8 @@ public class InferenceEngine {
types.addAll(baseTypes);
// findParent gets all subclasses, add self.
for (final Resource baseType : baseTypes) {
- if (baseType instanceof URI) {
- types.addAll(findParents(subClassOfGraph.get(), (URI) baseType));
+ if (baseType instanceof IRI) {
+ types.addAll(findParents(subClassOfGraph.get(), (IRI) baseType));
}
}
}
@@ -992,28 +990,28 @@ public class InferenceEngine {
* @return the {@link List} of {@link Resource}s.
* @throws QueryEvaluationException
*/
- private List<Resource> getList(final URI firstItem) throws QueryEvaluationException {
- URI head = firstItem;
+ private List<Resource> getList(final IRI firstItem) throws QueryEvaluationException {
+ IRI head = firstItem;
final List<Resource> list = new ArrayList<>();
// Go through and find all bnodes that are part of the defined list.
while (!RDF.NIL.equals(head)) {
// rdf.first will point to a type item that is in the list.
- ryaDaoQueryWrapper.queryFirst(head, RDF.FIRST, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryFirst(head, RDF.FIRST, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
// The object found in the query represents a type
// that should be included in the list.
- final URI object = (URI) statement.getObject();
+ final IRI object = (IRI) statement.getObject();
list.add(object);
}
});
- final MutableObject<URI> headHolder = new MutableObject<>();
+ final MutableObject<IRI> headHolder = new MutableObject<>();
// rdf.rest will point to the next bnode that's part of the list.
- ryaDaoQueryWrapper.queryFirst(head, RDF.REST, null, new RDFHandlerBase() {
+ ryaDaoQueryWrapper.queryFirst(head, RDF.REST, null, new AbstractRDFHandler() {
@Override
public void handleStatement(final Statement statement) throws RDFHandlerException {
// This object is the next bnode head to look for.
- final URI object = (URI) statement.getObject();
+ final IRI object = (IRI) statement.getObject();
headHolder.setValue(object);
}
});
@@ -1029,7 +1027,7 @@ public class InferenceEngine {
}
private void addSubClassOf(final Resource s, final Resource o) {
- final Statement statement = new StatementImpl(s, RDFS.SUBCLASSOF, o);
+ final Statement statement = VF.createStatement(s, RDFS.SUBCLASSOF, o);
final String edgeName = RDFS.SUBCLASSOF.stringValue();
addStatementEdge(subClassOfGraph.get(), edgeName, statement);
@@ -1075,48 +1073,48 @@ public class InferenceEngine {
/**
* Returns all super class types of the specified type based on the
* internal subclass graph.
- * @param type the type {@link URI} to find super classes for.
- * @return the {@link Set} of {@link URI} types that are super classes types
+ * @param type the type {@link IRI} to find super classes for.
+ * @return the {@link Set} of {@link IRI} types that are super classes types
* of the specified {@code type}. Returns an empty set if nothing was found,
* or if either type or the subclass graph is {@code null}.
*/
- public Set<URI> getSuperClasses(final URI type) {
+ public Set<IRI> getSuperClasses(final IRI type) {
return findChildren(subClassOfGraph.get(), type);
}
/**
* Returns all sub class types of the specified type based on the
* internal subclass graph.
- * @param type the type {@link URI} to find sub classes for.
- * @return the {@link Set} of {@link URI} types that are sub classes types
+ * @param type the type {@link IRI} to find sub classes for.
+ * @return the {@link Set} of {@link IRI} types that are sub classes types
* of the specified {@code type}. Returns an empty set if nothing was found,
* or if either type or the subclass graph is {@code null}.
*/
- public Set<URI> getSubClasses(final URI type) {
+ public Set<IRI> getSubClasses(final IRI type) {
return findParents(subClassOfGraph.get(), type);
}
/**
* Returns all superproperties of the specified property based on the
* internal subproperty graph.
- * @param property the property {@link URI} to find superproperties for.
- * @return the {@link Set} of {@link URI} properties that are superproperties
+ * @param property the property {@link IRI} to find superproperties for.
+ * @return the {@link Set} of {@link IRI} properties that are superproperties
* of the specified {@code property}. Returns an empty set if nothing was found,
* or if either property or the subproperty graph is {@code null}.
*/
- public Set<URI> getSuperProperties(final URI property) {
+ public Set<IRI> getSuperProperties(final IRI property) {
return findChildren(subPropertyOfGraph.get(), property);
}
/**
* Returns all subproperties of the specified property based on the
* internal subproperty graph.
- * @param property the property {@link URI} to find subproperties for.
- * @return the {@link Set} of {@link URI} properties that are subproperties
+ * @param property the property {@link IRI} to find subproperties for.
+ * @return the {@link Set} of {@link IRI} properties that are subproperties
* of the specified {@code property}. Returns an empty set if nothing was found,
* or if either property or the subproperty graph is {@code null}.
*/
- public Set<URI> getSubProperties(final URI property) {
+ public Set<IRI> getSubProperties(final IRI property) {
return findParents(subPropertyOfGraph.get(), property);
}
@@ -1128,7 +1126,7 @@ public class InferenceEngine {
* @return The set of predecessors, or an empty set if none are found or if
* either argument is {@code null}
*/
- public static Set<URI> findParents(final Graph graph, final URI vertexId) {
+ public static Set<IRI> findParents(final Graph graph, final IRI vertexId) {
return findParents(graph, vertexId, true);
}
@@ -1141,7 +1139,7 @@ public class InferenceEngine {
* @return The set of predecessors, or an empty set if none are found or if
* either argument is {@code null}
*/
- public static Set<URI> findParents(final Graph graph, final URI vertexId, final boolean isRecursive) {
+ public static Set<IRI> findParents(final Graph graph, final IRI vertexId, final boolean isRecursive) {
return findConnected(graph, vertexId, Direction.IN, isRecursive);
}
@@ -1153,7 +1151,7 @@ public class InferenceEngine {
* @return The set of successors, or an empty set if none are found or if
* either argument is {@code null}
*/
- public static Set<URI> findChildren(final Graph graph, final URI vertexId) {
+ public static Set<IRI> findChildren(final Graph graph, final IRI vertexId) {
return findChildren(graph, vertexId, true);
}
@@ -1166,7 +1164,7 @@ public class InferenceEngine {
* @return The set of successors, or an empty set if none are found or if
* either argument is {@code null}
*/
- public static Set<URI> findChildren(final Graph graph, final URI vertexId, final boolean isRecursive) {
+ public static Set<IRI> findChildren(final Graph graph, final IRI vertexId, final boolean isRecursive) {
return findConnected(graph, vertexId, Direction.OUT, isRecursive);
}
@@ -1182,8 +1180,8 @@ public class InferenceEngine {
* @return The set of connected nodes, or an empty set if none are found, or
* if either the graph or the starting vertex are {@code null}.
*/
- private static Set<URI> findConnected(final Graph graph, final URI vertexId, final Direction traversal, final boolean isRecursive) {
- final Set<URI> connected = new HashSet<>();
+ private static Set<IRI> findConnected(final Graph graph, final IRI vertexId, final Direction traversal, final boolean isRecursive) {
+ final Set<IRI> connected = new HashSet<>();
if (graph == null || vertexId == null) {
return connected;
}
@@ -1195,14 +1193,14 @@ public class InferenceEngine {
return connected;
}
- private static void addConnected(final Vertex v, final Set<URI> connected, final Direction traversal, final boolean isRecursive) {
+ private static void addConnected(final Vertex v, final Set<IRI> connected, final Direction traversal, final boolean isRecursive) {
v.edges(traversal).forEachRemaining(edge -> {
final Vertex ov = edge.vertices(traversal.opposite()).next();
final Object o = ov.property(URI_PROP).value();
- if (o != null && o instanceof URI) {
+ if (o != null && o instanceof IRI) {
final boolean contains = connected.contains(o);
if (!contains) {
- connected.add((URI) o);
+ connected.add((IRI) o);
if (isRecursive) {
addConnected(ov, connected, traversal, isRecursive);
}
@@ -1211,15 +1209,15 @@ public class InferenceEngine {
});
}
- public boolean isSymmetricProperty(final URI prop) {
+ public boolean isSymmetricProperty(final IRI prop) {
return (symmetricPropertySet != null) && symmetricPropertySet.contains(prop);
}
- public URI findInverseOf(final URI prop) {
+ public IRI findInverseOf(final IRI prop) {
return (inverseOfMap != null) ? inverseOfMap.get(prop) : (null);
}
- public boolean isTransitiveProperty(final URI prop) {
+ public boolean isTransitiveProperty(final IRI prop) {
return (transitivePropertySet != null) && transitivePropertySet.contains(prop);
}
@@ -1228,14 +1226,14 @@ public class InferenceEngine {
* @param prop A URI
* @return True if the given URI corresponds to an owl:ReflexiveProperty
*/
- public boolean isReflexiveProperty(final URI prop) {
+ public boolean isReflexiveProperty(final IRI prop) {
return (reflexivePropertySet != null) && reflexivePropertySet.contains(prop);
}
/**
* TODO: This chaining can be slow at query execution. the other option is to perform this in the query itself, but that will be constrained to how many levels we decide to go
*/
- public Set<Statement> findTransitiveProperty(final Resource subj, final URI prop, final Value obj, final Resource... contxts) throws InferenceEngineException {
+ public Set<Statement> findTransitiveProperty(final Resource subj, final IRI prop, final Value obj, final Resource... contxts) throws InferenceEngineException {
if (transitivePropertySet.contains(prop)) {
final Set<Statement> sts = new HashSet<>();
final boolean goUp = subj == null;
@@ -1256,7 +1254,7 @@ public class InferenceEngine {
return sameAs;
}
- public CloseableIteration<Statement, QueryEvaluationException> queryDao(final Resource subject, final URI predicate, final Value object, final Resource... contexts) throws QueryEvaluationException {
+ public CloseableIteration<Statement, QueryEvaluationException> queryDao(final Resource subject, final IRI predicate, final Value object, final Resource... contexts) throws QueryEvaluationException {
return RyaDAOHelper.query(ryaDAO, subject, predicate, object, conf, contexts);
}
@@ -1305,13 +1303,13 @@ public class InferenceEngine {
}
}
- protected void chainTransitiveProperty(final Resource subj, final URI prop, final Value obj, final Value core, final Set<Statement> sts, final boolean goUp, final Resource[] contxts) throws InferenceEngineException {
+ protected void chainTransitiveProperty(final Resource subj, final IRI prop, final Value obj, final Value core, final Set<Statement> sts, final boolean goUp, final Resource[] contxts) throws InferenceEngineException {
CloseableIteration<Statement, QueryEvaluationException> iter = null;
try {
iter = queryDao(subj, prop, obj, contxts);
while (iter.hasNext()) {
final Statement st = iter.next();
- sts.add(new StatementImpl((goUp) ? (st.getSubject()) : (Resource) (core), prop, (!goUp) ? (st.getObject()) : (core)));
+ sts.add(VF.createStatement((goUp) ? (st.getSubject()) : (Resource) (core), prop, (!goUp) ? (st.getObject()) : (core)));
if (goUp) {
chainTransitiveProperty(null, prop, st.getSubject(), core, sts, goUp, contxts);
} else {
@@ -1360,15 +1358,15 @@ public class InferenceEngine {
return subClassOfGraph.get();
}
- public Map<URI, List<URI>> getPropertyChainMap() {
+ public Map<IRI, List<IRI>> getPropertyChainMap() {
return propertyChainPropertyToChain;
}
- public List<URI> getPropertyChain(final URI chainProp) {
+ public List<IRI> getPropertyChain(final IRI chainProp) {
if (propertyChainPropertyToChain.containsKey(chainProp)){
return propertyChainPropertyToChain.get(chainProp);
}
- return new ArrayList<URI>();
+ return new ArrayList<IRI>();
}
public Graph getSubPropertyOfGraph() {
@@ -1383,15 +1381,15 @@ public class InferenceEngine {
this.refreshGraphSchedule.set(refreshGraphSchedule);
}
- public Set<URI> getSymmetricPropertySet() {
+ public Set<IRI> getSymmetricPropertySet() {
return symmetricPropertySet;
}
- public Map<URI, URI> getInverseOfMap() {
+ public Map<IRI, IRI> getInverseOfMap() {
return inverseOfMap;
}
- public Set<URI> getTransitivePropertySet() {
+ public Set<IRI> getTransitivePropertySet() {
return transitivePropertySet;
}
@@ -1413,17 +1411,17 @@ public class InferenceEngine {
* @return For each relevant property, a set of values such that whenever a resource has that
* value for that property, it is implied to belong to the type.
*/
- public Map<URI, Set<Value>> getHasValueByType(final Resource type) {
- final Map<URI, Set<Value>> implications = new HashMap<>();
+ public Map<IRI, Set<Value>> getHasValueByType(final Resource type) {
+ final Map<IRI, Set<Value>> implications = new HashMap<>();
if (hasValueByType != null) {
final Set<Resource> types = new HashSet<>();
types.add(type);
- if (type instanceof URI) {
- types.addAll(getSubClasses((URI) type));
+ if (type instanceof IRI) {
+ types.addAll(getSubClasses((IRI) type));
}
for (final Resource relevantType : types) {
if (hasValueByType.containsKey(relevantType)) {
- for (final Map.Entry<URI, Value> propertyToValue : hasValueByType.get(relevantType).entrySet()) {
+ for (final Map.Entry<IRI, Value> propertyToValue : hasValueByType.get(relevantType).entrySet()) {
if (!implications.containsKey(propertyToValue.getKey())) {
implications.put(propertyToValue.getKey(), new HashSet<>());
}
@@ -1446,7 +1444,7 @@ public class InferenceEngine {
* @return A mapping from type (URIs or bnodes) to the set of any values that belonging to that
* type implies.
*/
- public Map<Resource, Set<Value>> getHasValueByProperty(final URI property) {
+ public Map<Resource, Set<Value>> getHasValueByProperty(final IRI property) {
final Map<Resource, Set<Value>> implications = new HashMap<>();
if (hasValueByProperty != null && hasValueByProperty.containsKey(property)) {
for (final Map.Entry<Resource, Value> typeToValue : hasValueByProperty.get(property).entrySet()) {
@@ -1455,8 +1453,8 @@ public class InferenceEngine {
implications.put(type, new HashSet<>());
}
implications.get(type).add(typeToValue.getValue());
- if (type instanceof URI) {
- for (final URI subtype : getSubClasses((URI) type)) {
+ if (type instanceof IRI) {
+ for (final IRI subtype : getSubClasses((IRI) type)) {
if (!implications.containsKey(subtype)) {
implications.put(subtype, new HashSet<>());
}
@@ -1478,8 +1476,8 @@ public class InferenceEngine {
* @return The set of properties with domain of that type, meaning that any triple whose
* predicate belongs to that set implies that the triple's subject belongs to the type.
*/
- public Set<URI> getPropertiesWithDomain(final URI domainType) {
- final Set<URI> properties = new HashSet<>();
+ public Set<IRI> getPropertiesWithDomain(final IRI domainType) {
+ final Set<IRI> properties = new HashSet<>();
if (domainByType.containsKey(domainType)) {
properties.addAll(domainByType.get(domainType));
}
@@ -1496,8 +1494,8 @@ public class InferenceEngine {
* @return The set of properties with range of that type, meaning that any triple whose
* predicate belongs to that set implies that the triple's object belongs to the type.
*/
- public Set<URI> getPropertiesWithRange(final URI rangeType) {
- final Set<URI> properties = new HashSet<>();
+ public Set<IRI> getPropertiesWithRange(final IRI rangeType) {
+ final Set<IRI> properties = new HashSet<>();
if (rangeByType.containsKey(rangeType)) {
properties.addAll(rangeByType.get(rangeType));
}
@@ -1520,23 +1518,23 @@ public class InferenceEngine {
* individual type/property combination is sufficient. Returns an empty map if either
* parameter is {@code null}.
*/
- private Map<Resource, Set<URI>> getTypePropertyImplyingType(final Resource queryType, final Map<Resource, Map<Resource, URI>> schemaMap) {
- final Map<Resource, Set<URI>> implications = new HashMap<>();
+ private Map<Resource, Set<IRI>> getTypePropertyImplyingType(final Resource queryType, final Map<Resource, Map<Resource, IRI>> schemaMap) {
+ final Map<Resource, Set<IRI>> implications = new HashMap<>();
if (schemaMap != null && queryType != null) {
// Check for any subtypes which would in turn imply the type being queried for
final HashSet<Resource> queryTypes = new HashSet<>();
queryTypes.add(queryType);
- if (queryType instanceof URI) {
- queryTypes.addAll(getSubClasses((URI) queryType));
+ if (queryType instanceof IRI) {
+ queryTypes.addAll(getSubClasses((IRI) queryType));
}
for (final Resource querySubType : queryTypes) {
if (schemaMap.containsKey(querySubType)) {
- final Map<Resource, URI> otherTypeToProperty = schemaMap.get(querySubType);
+ final Map<Resource, IRI> otherTypeToProperty = schemaMap.get(querySubType);
for (final Resource otherType : otherTypeToProperty.keySet()) {
if (!implications.containsKey(otherType)) {
implications.put(otherType, new HashSet<>());
}
- final URI property = otherTypeToProperty.get(otherType);
+ final IRI property = otherTypeToProperty.get(otherType);
if (property != null) {
implications.get(otherType).add(property);
// Also add subproperties that would in turn imply the property
@@ -1569,7 +1567,7 @@ public class InferenceEngine {
* to the restriction type. Empty map if the parameter is {@code null} or if the
* someValuesFrom schema has not been populated.
*/
- public Map<Resource, Set<URI>> getSomeValuesFromByRestrictionType(final Resource restrictionType) {
+ public Map<Resource, Set<IRI>> getSomeValuesFromByRestrictionType(final Resource restrictionType) {
return getTypePropertyImplyingType(restrictionType, someValuesFromByRestrictionType);
}
@@ -1590,7 +1588,7 @@ public class InferenceEngine {
* values it has for any of those properties belong to the value type. Empty map if the
* parameter is {@code null} or if the allValuesFrom schema has not been populated.
*/
- public Map<Resource, Set<URI>> getAllValuesFromByValueType(final Resource valueType) {
+ public Map<Resource, Set<IRI>> getAllValuesFromByValueType(final Resource valueType) {
return getTypePropertyImplyingType(valueType, allValuesFromByValueType);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitor.java
index b4853c0..0208d68 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/IntersectionOfVisitor.java
@@ -26,13 +26,14 @@ import java.util.TreeSet;
import org.apache.log4j.Logger;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Visitor for handling owl:intersectionOf inferencing on a node.
@@ -58,7 +59,7 @@ public class IntersectionOfVisitor extends AbstractInferVisitor {
final Var objVar = node.getObjectVar();
final Var conVar = node.getContextVar();
if (predVar != null && objVar != null && objVar.getValue() != null && RDF.TYPE.equals(predVar.getValue()) && !EXPANDED.equals(conVar)) {
- final List<Set<Resource>> intersections = inferenceEngine.getIntersectionsImplying((URI) objVar.getValue());
+ final List<Set<Resource>> intersections = inferenceEngine.getIntersectionsImplying((IRI) objVar.getValue());
if (intersections != null && !intersections.isEmpty()) {
final List<TupleExpr> joins = new ArrayList<>();
for (final Set<Resource> intersection : intersections) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
index 2f026fc..e3a74d5 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseOfVisitor.java
@@ -19,16 +19,14 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -48,7 +46,7 @@ public class InverseOfVisitor extends AbstractInferVisitor {
StatementPattern sp = node.clone();
final Var predVar = sp.getPredicateVar();
- URI pred = (URI) predVar.getValue();
+ IRI pred = (IRI) predVar.getValue();
String predNamespace = pred.getNamespace();
final Var objVar = sp.getObjectVar();
@@ -65,8 +63,8 @@ public class InverseOfVisitor extends AbstractInferVisitor {
" { ?b ?pred ?a }
*/
- URI predUri = (URI) predVar.getValue();
- URI invPropUri = inferenceEngine.findInverseOf(predUri);
+ IRI predUri = (IRI) predVar.getValue();
+ IRI invPropUri = inferenceEngine.findInverseOf(predUri);
if (invPropUri != null) {
Var subjVar = sp.getSubjectVar();
Union union = new InferUnion();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
index 13c068a..2a96ae6 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/InverseURI.java
@@ -18,14 +18,14 @@
*/
package org.apache.rya.rdftriplestore.inference;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
-public class InverseURI implements URI {
+public class InverseURI implements IRI {
private static final long serialVersionUID = 1L;
- private final URI impl;
+ private final IRI impl;
- public InverseURI(final URI uri) {
+ public InverseURI(final IRI uri) {
this.impl = uri;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/OneOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/OneOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/OneOfVisitor.java
index 004a4b0..5a5c2c7 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/OneOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/OneOfVisitor.java
@@ -23,13 +23,13 @@ import java.util.Set;
import org.apache.log4j.Logger;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.Resource;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.BindingSetAssignment;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.BindingSetAssignment;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
/**
* Visitor for handling owl:oneOf inferencing on a node.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
index ae7e059..2df3461 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/PropertyChainVisitor.java
@@ -23,14 +23,14 @@ import java.util.List;
import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -51,7 +51,7 @@ public class PropertyChainVisitor extends AbstractInferVisitor {
final StatementPattern sp = node.clone();
final Var predVar = sp.getPredicateVar();
- final URI pred = (URI) predVar.getValue();
+ final IRI pred = (IRI) predVar.getValue();
final String predNamespace = pred.getNamespace();
final Var objVar = sp.getObjectVar();
@@ -62,8 +62,8 @@ public class PropertyChainVisitor extends AbstractInferVisitor {
!RDFS.NAMESPACE.equals(predNamespace)
&& !EXPANDED.equals(cntxtVar)) {
- final URI chainPropURI = (URI) predVar.getValue();
- final List<URI> chain = inferenceEngine.getPropertyChain(chainPropURI);
+ final IRI chainPropURI = (IRI) predVar.getValue();
+ final List<IRI> chain = inferenceEngine.getPropertyChain(chainPropURI);
final List<StatementPattern> expandedPatterns = new ArrayList<StatementPattern>();
if (chain.size() > 0) {
final Var originalSubj = sp.getSubjectVar();
@@ -71,7 +71,7 @@ public class PropertyChainVisitor extends AbstractInferVisitor {
Var nextSubj = originalSubj;
StatementPattern lastStatementPatternAdded = null;
- for (final URI chainElement : chain ){
+ for (final IRI chainElement : chain ){
final String s = UUID.randomUUID().toString();
final Var currentObj = new Var("c-" + s);
StatementPattern statementPattern = new StatementPattern(nextSubj, new Var(chainElement.stringValue()), currentObj, sp.getContextVar());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitor.java
index d515bcf..23df2a4 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/ReflexivePropertyVisitor.java
@@ -19,10 +19,10 @@ package org.apache.rya.rdftriplestore.inference;
*/
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.ZeroLengthPath;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.ZeroLengthPath;
/**
* Expands the query tree to account for any relevant reflexive properties
@@ -59,7 +59,7 @@ public class ReflexivePropertyVisitor extends AbstractInferVisitor {
protected void meetSP(StatementPattern node) throws Exception {
// Only applies when the predicate is defined and reflexive
final Var predVar = node.getPredicateVar();
- if (predVar.getValue() != null && inferenceEngine.isReflexiveProperty((URI) predVar.getValue())) {
+ if (predVar.getValue() != null && inferenceEngine.isReflexiveProperty((IRI) predVar.getValue())) {
final StatementPattern originalSP = node.clone();
// The reflexive solution is a ZeroLengthPath between subject and
// object: they can be matched to one another, whether constants or
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SameAsVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SameAsVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SameAsVisitor.java
index c616419..a71aaaa 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SameAsVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SameAsVisitor.java
@@ -19,25 +19,23 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
+import java.util.HashSet;
+import java.util.Set;
+import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
import org.apache.rya.rdftriplestore.utils.TransitivePropertySP;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -74,7 +72,7 @@ public class SameAsVisitor extends AbstractInferVisitor {
boolean shouldExpand = true;
if (predVar.hasValue()){
- URI pred = (URI) predVar.getValue();
+ IRI pred = (IRI) predVar.getValue();
String predNamespace = pred.getNamespace();
shouldExpand = !pred.equals(OWL.SAMEAS) &&
!RDF.NAMESPACE.equals(predNamespace) &&
@@ -136,7 +134,8 @@ public class SameAsVisitor extends AbstractInferVisitor {
StatementPattern origDummyStatement = new DoNotExpandSP(origStatement.getSubjectVar(), origStatement.getPredicateVar(), dummyVar, cntxtVar);
FixedStatementPattern fsp = new FixedStatementPattern(dummyVar, new Var("c-" + s, OWL.SAMEAS), objVar, cntxtVar);
for (Resource sameAs : objURIs){
- NullableStatementImpl newStatement = new NullableStatementImpl(sameAs, OWL.SAMEAS, (Resource)objVar.getValue(), getVarValue(cntxtVar));
+ NullableStatementImpl newStatement = new NullableStatementImpl(sameAs, OWL.SAMEAS,
+ objVar.getValue(), getVarValue(cntxtVar));
fsp.statements.add(newStatement);
}
InferJoin interimJoin = new InferJoin(fsp, origDummyStatement);
@@ -169,7 +168,8 @@ public class SameAsVisitor extends AbstractInferVisitor {
}
FixedStatementPattern fsp = new FixedStatementPattern(dummyVar, new Var("c-" + s, OWL.SAMEAS), subVar, cntxtVar);
for (Resource sameAs : uris){
- NullableStatementImpl newStatement = new NullableStatementImpl(sameAs, OWL.SAMEAS, (Resource)subVar.getValue(), getVarValue(cntxtVar));
+ NullableStatementImpl newStatement = new NullableStatementImpl(sameAs, OWL.SAMEAS,
+ subVar.getValue(), getVarValue(cntxtVar));
fsp.statements.add(newStatement);
}
InferJoin join = new InferJoin(fsp, origStatement);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitor.java
index 16a315e..bd03f54 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SomeValuesFromVisitor.java
@@ -25,12 +25,12 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.OWL;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.vocabulary.OWL;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Expands the query tree to account for any existential class expressions (property restrictions
@@ -78,7 +78,7 @@ public class SomeValuesFromVisitor extends AbstractInferVisitor {
// Only applies to type queries where the type is defined
if (predVar != null && RDF.TYPE.equals(predVar.getValue()) && objVar != null && objVar.getValue() instanceof Resource) {
final Resource typeToInfer = (Resource) objVar.getValue();
- Map<Resource, Set<URI>> relevantSvfRestrictions = inferenceEngine.getSomeValuesFromByRestrictionType(typeToInfer);
+ Map<Resource, Set<IRI>> relevantSvfRestrictions = inferenceEngine.getSomeValuesFromByRestrictionType(typeToInfer);
if (!relevantSvfRestrictions.isEmpty()) {
// We can infer the queried type if it is to a someValuesFrom restriction (or a
// supertype of one), and the node in question (subjVar) is the subject of a triple
@@ -97,7 +97,7 @@ public class SomeValuesFromVisitor extends AbstractInferVisitor {
final FixedStatementPattern svfPropertyTypes = new FixedStatementPattern(svfPredVar,
new Var(OWL.SOMEVALUESFROM.stringValue(), OWL.SOMEVALUESFROM), valueTypeVar);
for (Resource svfValueType : relevantSvfRestrictions.keySet()) {
- for (URI svfProperty : relevantSvfRestrictions.get(svfValueType)) {
+ for (IRI svfProperty : relevantSvfRestrictions.get(svfValueType)) {
svfPropertyTypes.statements.add(new NullableStatementImpl(svfProperty,
OWL.SOMEVALUESFROM, svfValueType));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
index 1f2fd27..0d11918 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubClassOfVisitor.java
@@ -24,11 +24,11 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* Class SubClassOfVisitor
@@ -61,14 +61,14 @@ public class SubClassOfVisitor extends AbstractInferVisitor {
// join.getProperties().put(InferConstants.INFERRED, InferConstants.TRUE);
// node.replaceWith(join);
- final URI subclassof_uri = (URI) objVar.getValue();
- final Collection<URI> parents = InferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), subclassof_uri);
+ final IRI subclassof_uri = (IRI) objVar.getValue();
+ final Collection<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubClassOfGraph(), subclassof_uri);
if (parents != null && parents.size() > 0) {
final String s = UUID.randomUUID().toString();
final Var typeVar = new Var(s);
final FixedStatementPattern fsp = new FixedStatementPattern(typeVar, new Var("c-" + s, RDFS.SUBCLASSOF), objVar, conVar);
parents.add(subclassof_uri);
- for (final URI u : parents) {
+ for (final IRI u : parents) {
fsp.statements.add(new NullableStatementImpl(u, RDFS.SUBCLASSOF, subclassof_uri));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
index f3a40ab..102c0b2 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SubPropertyOfVisitor.java
@@ -24,12 +24,12 @@ import java.util.UUID;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.utils.NullableStatementImpl;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -49,7 +49,7 @@ public class SubPropertyOfVisitor extends AbstractInferVisitor {
final StatementPattern sp = node.clone();
final Var predVar = sp.getPredicateVar();
- final URI pred = (URI) predVar.getValue();
+ final IRI pred = (IRI) predVar.getValue();
final String predNamespace = pred.getNamespace();
final Var objVar = sp.getObjectVar();
@@ -94,8 +94,8 @@ public class SubPropertyOfVisitor extends AbstractInferVisitor {
// node.replaceWith(new StatementPattern(subjVar, vc, objVar, node.getContextVar()));
// }
- final URI subprop_uri = (URI) predVar.getValue();
- final Set<URI> parents = InferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), subprop_uri);
+ final IRI subprop_uri = (IRI) predVar.getValue();
+ final Set<IRI> parents = InferenceEngine.findParents(inferenceEngine.getSubPropertyOfGraph(), subprop_uri);
if (parents != null && parents.size() > 0) {
final String s = UUID.randomUUID().toString();
final Var typeVar = new Var(s);
@@ -103,7 +103,7 @@ public class SubPropertyOfVisitor extends AbstractInferVisitor {
// fsp.statements.add(new NullableStatementImpl(subprop_uri, RDFS.SUBPROPERTYOF, subprop_uri));
//add self
parents.add(subprop_uri);
- for (final URI u : parents) {
+ for (final IRI u : parents) {
fsp.statements.add(new NullableStatementImpl(u, RDFS.SUBPROPERTYOF, subprop_uri));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
----------------------------------------------------------------------
diff --git a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
index 7195ccd..c8e1a7d 100644
--- a/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
+++ b/sail/src/main/java/org/apache/rya/rdftriplestore/inference/SymmetricPropertyVisitor.java
@@ -19,16 +19,14 @@ package org.apache.rya.rdftriplestore.inference;
* under the License.
*/
-
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.model.vocabulary.SESAME;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Union;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.model.vocabulary.SESAME;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Union;
+import org.eclipse.rdf4j.query.algebra.Var;
/**
* All predicates are changed
@@ -48,7 +46,7 @@ public class SymmetricPropertyVisitor extends AbstractInferVisitor {
StatementPattern sp = node.clone();
final Var predVar = sp.getPredicateVar();
- URI pred = (URI) predVar.getValue();
+ IRI pred = (IRI) predVar.getValue();
String predNamespace = pred.getNamespace();
final Var objVar = sp.getObjectVar();
@@ -65,7 +63,7 @@ public class SymmetricPropertyVisitor extends AbstractInferVisitor {
" { ?b ?pred ?a }
*/
- URI symmPropUri = (URI) predVar.getValue();
+ IRI symmPropUri = (IRI) predVar.getValue();
if(inferenceEngine.isSymmetricProperty(symmPropUri)) {
Var subjVar = sp.getSubjectVar();
Union union = new InferUnion();
[09/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorIT.java
index 7fb228a..f2a8d36 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorIT.java
@@ -34,11 +34,11 @@ import org.apache.rya.streams.kafka.processors.filter.FilterProcessorSupplier.Fi
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the methods of {@link FilterProcessor}.
@@ -68,15 +68,15 @@ public class FilterProcessorIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add(new VisibilityStatement(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(11)), "a"));
- statements.add(new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral(9)), "a"));
+ statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(11)), "a"));
+ statements.add(new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral(9)), "a"));
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("age", vf.createLiteral(9));
expected.add( new VisibilityBindingSet(bs, "a") );
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorTest.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorTest.java
index 3ff8e8d..51bd919 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorTest.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/FilterProcessorTest.java
@@ -30,11 +30,11 @@ import org.apache.rya.streams.kafka.RdfTestUtil;
import org.apache.rya.streams.kafka.processors.ProcessorResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.UnaryResult;
import org.apache.rya.streams.kafka.processors.filter.FilterProcessorSupplier.FilterProcessor;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit tests the methods of {@link FilterProcessor}.
@@ -52,9 +52,9 @@ public class FilterProcessorTest {
"}");
// Create a Binding Set that will be passed into the Filter function based on the where clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
bs.addBinding("age", vf.createLiteral(9));
final VisibilityBindingSet inputVisBs = new VisibilityBindingSet(bs, "a");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
index 11637b7..15c33ee 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/filter/TemporalFilterIT.java
@@ -39,24 +39,23 @@ import org.apache.rya.streams.kafka.processors.filter.FilterProcessorSupplier.Fi
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.FunctionRegistry;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.function.Function;
-import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the temporal methods of {@link FilterProcessor}.
*/
public class TemporalFilterIT {
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final String TEMPORAL = "http://rya.apache.org/ns/temporal";
private static final ZonedDateTime TIME = ZonedDateTime.parse("2015-12-30T12:00:00Z");
private static final ZonedDateTime TIME_10 = ZonedDateTime.parse("2015-12-30T12:00:10Z");
@@ -100,13 +99,12 @@ public class TemporalFilterIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
final List<VisibilityStatement> statements = getStatements();
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("date", vf.createLiteral(TIME.toString()));
+ bs.addBinding("date", VF.createLiteral(TIME.toString()));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -134,13 +132,12 @@ public class TemporalFilterIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
final List<VisibilityStatement> statements = getStatements();
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("date", vf.createLiteral(TIME.toString()));
+ bs.addBinding("date", VF.createLiteral(TIME.toString()));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -168,13 +165,12 @@ public class TemporalFilterIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
final List<VisibilityStatement> statements = getStatements();
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("date", vf.createLiteral(TIME_20.toString()));
+ bs.addBinding("date", VF.createLiteral(TIME_20.toString()));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -202,13 +198,12 @@ public class TemporalFilterIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
final List<VisibilityStatement> statements = getStatements();
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("date", vf.createLiteral(TIME_10.toString()));
+ bs.addBinding("date", VF.createLiteral(TIME_10.toString()));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -224,9 +219,9 @@ public class TemporalFilterIT {
}
private static Statement statement(final ZonedDateTime time) {
- final Resource subject = vf.createURI("urn:time");
- final URI predicate = vf.createURI("http://www.w3.org/2006/time/atTime");
- final Value object = vf.createLiteral(time.toString());
- return new StatementImpl(subject, predicate, object);
+ final Resource subject = VF.createIRI("urn:time");
+ final IRI predicate = VF.createIRI("http://www.w3.org/2006/time/atTime");
+ final Value object = VF.createLiteral(time.toString());
+ return VF.createStatement(subject, predicate, object);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/join/JoinProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/join/JoinProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/join/JoinProcessorIT.java
index 5f09372..0de176d 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/join/JoinProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/join/JoinProcessorIT.java
@@ -37,11 +37,11 @@ import org.apache.rya.streams.kafka.processors.join.JoinProcessorSupplier.JoinPr
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
@@ -81,33 +81,33 @@ public class JoinProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements that generate a bunch of right SP results.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoPlace")), "a&b") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoPlace")), "a&b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "a") );
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:worksAt"), vf.createURI("urn:CoffeeShop")), "b") );
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:CoffeeShop")), "b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "b|c") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "b|c") );
// Add a statement that will generate a left result that joins with some of those right results.
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "c") );
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "c") );
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoPlace"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoPlace"));
expected.add( new VisibilityBindingSet(bs, "a&b&c") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add( new VisibilityBindingSet(bs, "c&(b|c)") );
// Run the test.
@@ -132,33 +132,33 @@ public class JoinProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements that generate a bunch of right SP results.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoPlace")), "a&b") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoPlace")), "a&b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "a") );
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:worksAt"), vf.createURI("urn:CoffeeShop")), "b") );
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:CoffeeShop")), "b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "b|c") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "b|c") );
// Add a statement that will generate a left result that joins with some of those right results.
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "c") );
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "c") );
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoPlace"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoPlace"));
expected.add( new VisibilityBindingSet(bs, "a&b&c") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add( new VisibilityBindingSet(bs, "c&(b|c)") );
// Run the test.
@@ -183,39 +183,39 @@ public class JoinProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements that generate a bunch of right SP results.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoPlace")), "a&b") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoPlace")), "a&b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "c") );
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "c") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "a") );
+ vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:worksAt"), vf.createURI("urn:CoffeeShop")), "b") );
+ vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:CoffeeShop")), "b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "b|c") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "b|c") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:talksTo"), vf.createURI("urn:Charlie")), "c") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Charlie")), "c") );
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoPlace"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoPlace"));
expected.add( new VisibilityBindingSet(bs, "a&b&c") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add( new VisibilityBindingSet(bs, "c&(b|c)") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("employee", vf.createURI("urn:Charlie"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("employee", vf.createIRI("urn:Charlie"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add( new VisibilityBindingSet(bs, "a&c") );
// Run the test.
@@ -241,21 +241,21 @@ public class JoinProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements that generate a bunch of right SP results.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "a") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hourlyWage"), vf.createLiteral(7.25)), "a") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hourlyWage"), vf.createLiteral(7.25)), "a") );
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
bs.addBinding("wage", vf.createLiteral(7.25));
expected.add( new VisibilityBindingSet(bs, "a") );
@@ -281,33 +281,33 @@ public class JoinProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements that generate a result that includes the optional value as well as one that does not.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
+ vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoPlace")), "b") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoPlace")), "b") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:talksTo"), vf.createURI("urn:Charlie")), "c") );
+ vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Charlie")), "c") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "d") );
+ vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "d") );
// Make the expected results.
final Set<VisibilityBindingSet> expected = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
expected.add( new VisibilityBindingSet(bs, "a") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("employee", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoPlace"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("employee", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoPlace"));
expected.add( new VisibilityBindingSet(bs, "a&b") );
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("employee", vf.createURI("urn:Charlie"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("employee", vf.createIRI("urn:Charlie"));
expected.add( new VisibilityBindingSet(bs, "c") );
// Run the test.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorIT.java
index c6fd1cf..7142cb7 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorIT.java
@@ -32,12 +32,12 @@ import org.apache.rya.streams.kafka.processors.projection.MultiProjectionProcess
import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.BNode;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
/**
* Integration tests the methods of {@link MultiProjectionProcessor}.
@@ -71,20 +71,20 @@ public class MultiProjectionProcessorIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, () -> bNodeId);
// Create the statements that will be input into the query.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:car1"), vf.createURI("urn:compass"), vf.createURI("urn:NW")), "a") );
+ vf.createStatement(vf.createIRI("urn:car1"), vf.createIRI("urn:compass"), vf.createIRI("urn:NW")), "a") );
statements.add( new VisibilityStatement(
- vf.createStatement(vf.createURI("urn:car1"), vf.createURI("urn:corner"), vf.createURI("urn:corner1")), "a") );
+ vf.createStatement(vf.createIRI("urn:car1"), vf.createIRI("urn:corner"), vf.createIRI("urn:corner1")), "a") );
// Make the expected results.
final Set<VisibilityStatement> expected = new HashSet<>();
final BNode blankNode = vf.createBNode(bNodeId);
- expected.add(new VisibilityStatement(vf.createStatement(blankNode, RDF.TYPE, vf.createURI("urn:movementObservation")), "a"));
- expected.add(new VisibilityStatement(vf.createStatement(blankNode, vf.createURI("urn:direction"), vf.createURI("urn:NW")), "a"));
- expected.add(new VisibilityStatement(vf.createStatement(blankNode, vf.createURI("urn:location"), vf.createURI("urn:corner1")), "a"));
+ expected.add(new VisibilityStatement(vf.createStatement(blankNode, RDF.TYPE, vf.createIRI("urn:movementObservation")), "a"));
+ expected.add(new VisibilityStatement(vf.createStatement(blankNode, vf.createIRI("urn:direction"), vf.createIRI("urn:NW")), "a"));
+ expected.add(new VisibilityStatement(vf.createStatement(blankNode, vf.createIRI("urn:location"), vf.createIRI("urn:corner1")), "a"));
// Run the test.
RyaStreamsTestUtil.runStreamProcessingTest(kafka, statementsTopic, resultsTopic, builder, statements, expected, VisibilityStatementDeserializer.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorIT.java
index f53f2c4..977e453 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/projection/ProjectionProcessorIT.java
@@ -34,11 +34,11 @@ import org.apache.rya.streams.kafka.processors.StatementPatternProcessorSupplier
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Sets;
@@ -68,16 +68,16 @@ public class ProjectionProcessorIT {
final TopologyBuilder builder = new TopologyFactory().build(sparql, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Load some data into the input topic.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
// Show the correct binding set results from the job.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final MapBindingSet expectedBs = new MapBindingSet();
- expectedBs.addBinding("p", vf.createURI("urn:Alice"));
- expectedBs.addBinding("otherPerson", vf.createURI("urn:Bob"));
+ expectedBs.addBinding("p", vf.createIRI("urn:Alice"));
+ expectedBs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
expected.add(new VisibilityBindingSet(expectedBs, "a"));
RyaStreamsTestUtil.runStreamProcessingTest(kafka, statementsTopic, resultsTopic, builder, statements, Sets.newHashSet(expected), VisibilityBindingSetDeserializer.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/sp/StatementPatternProcessorIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/sp/StatementPatternProcessorIT.java b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/sp/StatementPatternProcessorIT.java
index fd0a48d..1e65827 100644
--- a/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/sp/StatementPatternProcessorIT.java
+++ b/extras/rya.streams/integration/src/test/java/org/apache/rya/streams/kafka/processors/sp/StatementPatternProcessorIT.java
@@ -34,11 +34,11 @@ import org.apache.rya.streams.kafka.processors.StatementPatternProcessorSupplier
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetDeserializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
/**
* Integration tests the methods of {@link StatementPatternProcessor}.
@@ -62,16 +62,16 @@ public class StatementPatternProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create a statement that generate an SP result.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
// Show the correct binding set results from the job.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("otherPerson", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -92,24 +92,24 @@ public class StatementPatternProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements where some generates SP results and others do not.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:worksAt"), vf.createURI("urn:TacoJoin")), "b") );
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:talksTo"), vf.createURI("urn:Alice")), "a|b") );
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:worksAt"), vf.createURI("urn:BurgerJoint")), "c") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:TacoJoin")), "b") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Alice")), "a|b") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:worksAt"), vf.createIRI("urn:BurgerJoint")), "c") );
// Show the correct binding set results from the job.
final Set<VisibilityBindingSet> expected = new HashSet<>();
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("otherPerson", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
expected.add( new VisibilityBindingSet(bs, "a") );
bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("otherPerson", vf.createURI("urn:Alice"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Alice"));
expected.add( new VisibilityBindingSet(bs, "a|b") );
// Run the test.
@@ -133,17 +133,17 @@ public class StatementPatternProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements where some generates SP results and others do not.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
// Show the correct binding set results from the job.
final Set<VisibilityBindingSet> expected = new HashSet<>();
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("action", vf.createURI("urn:talksTo"));
- bs.addBinding("otherPerson", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("action", vf.createIRI("urn:talksTo"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
expected.add( new VisibilityBindingSet(bs, "a") );
// Run the test.
@@ -167,26 +167,26 @@ public class StatementPatternProcessorIT {
final TopologyBuilder builder = factory.build(query, statementsTopic, resultsTopic, new RandomUUIDFactory());
// Create some statements where some generates SP results and others do not.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Charlie")), "a|b") );
- statements.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:walksWith"), vf.createURI("urn:Bob")), "b") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Charlie")), "a|b") );
+ statements.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:walksWith"), vf.createIRI("urn:Bob")), "b") );
// Show the correct binding set results from the job.
final Set<VisibilityBindingSet> expected = new HashSet<>();
QueryBindingSet bs = new QueryBindingSet();
bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("action", vf.createURI("urn:talksTo"));
- bs.addBinding("otherPerson", vf.createURI("urn:Charlie"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("action", vf.createIRI("urn:talksTo"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Charlie"));
expected.add(new VisibilityBindingSet(bs, "a&(a|b)"));
bs = new QueryBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("action", vf.createURI("urn:talksTo"));
- bs.addBinding("otherPerson", vf.createURI("urn:Bob"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("action", vf.createIRI("urn:talksTo"));
+ bs.addBinding("otherPerson", vf.createIRI("urn:Bob"));
expected.add(new VisibilityBindingSet(bs, "a"));
// Run the test.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/pom.xml b/extras/rya.streams/kafka/pom.xml
index 3f3227d..a1b518b 100644
--- a/extras/rya.streams/kafka/pom.xml
+++ b/extras/rya.streams/kafka/pom.xml
@@ -68,6 +68,10 @@ under the License.
<groupId>org.apache.rya</groupId>
<artifactId>rya.api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.rya</groupId>
+ <artifactId>rya.sail</artifactId>
+ </dependency>
<!-- Kafka dependencies -->
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/SingleThreadKafkaStreamsFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/SingleThreadKafkaStreamsFactory.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/SingleThreadKafkaStreamsFactory.java
index 63d64b9..efcc21e 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/SingleThreadKafkaStreamsFactory.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/SingleThreadKafkaStreamsFactory.java
@@ -31,7 +31,7 @@ import org.apache.rya.streams.api.entity.StreamsQuery;
import org.apache.rya.streams.kafka.topology.TopologyBuilderFactory;
import org.apache.rya.streams.kafka.topology.TopologyBuilderFactory.TopologyBuilderException;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatements.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatements.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatements.java
index cf10f6a..ab026f3 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatements.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatements.java
@@ -28,15 +28,17 @@ import java.util.Collection;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.rya.api.model.VisibilityStatement;
+import org.apache.rya.rdftriplestore.utils.RdfFormatUtils;
import org.apache.rya.streams.api.exception.RyaStreamsException;
import org.apache.rya.streams.api.interactor.LoadStatements;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.rio.RDFHandlerException;
-import org.openrdf.rio.RDFParseException;
-import org.openrdf.rio.RDFParser;
-import org.openrdf.rio.Rio;
-import org.openrdf.rio.helpers.RDFHandlerBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.rio.RDFFormat;
+import org.eclipse.rdf4j.rio.RDFHandlerException;
+import org.eclipse.rdf4j.rio.RDFParseException;
+import org.eclipse.rdf4j.rio.RDFParser;
+import org.eclipse.rdf4j.rio.Rio;
+import org.eclipse.rdf4j.rio.UnsupportedRDFormatException;
+import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -75,11 +77,15 @@ public class KafkaLoadStatements implements LoadStatements {
}
// Create an RDF Parser whose format is derived from the statementPath's file extension.
- final RDFFormat format = RDFFormat.forFileName(statementsPath.getFileName().toString());
+ final String filename = statementsPath.getFileName().toString();
+ final RDFFormat format = RdfFormatUtils.forFileName(filename);
+ if (format == null) {
+ throw new UnsupportedRDFormatException("Unknown RDF format for the file: " + filename);
+ }
final RDFParser parser = Rio.createParser(format);
// Set a handler that writes the statements to the specified kafka topic.
- parser.setRDFHandler(new RDFHandlerBase() {
+ parser.setRDFHandler(new AbstractRDFHandler() {
@Override
public void startRDF() throws RDFHandlerException {
log.trace("Starting loading statements.");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/StatementPatternProcessorSupplier.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/StatementPatternProcessorSupplier.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/StatementPatternProcessorSupplier.java
index f7c2e5e..46415d0 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/StatementPatternProcessorSupplier.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/StatementPatternProcessorSupplier.java
@@ -28,8 +28,8 @@ import org.apache.kafka.streams.processor.ProcessorSupplier;
import org.apache.rya.api.function.sp.StatementPatternMatcher;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.VisibilityStatement;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorSupplier.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorSupplier.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorSupplier.java
index c101914..5af54d3 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorSupplier.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/AggregationProcessorSupplier.java
@@ -35,7 +35,7 @@ import org.apache.rya.streams.kafka.processors.ProcessorResult.ResultType;
import org.apache.rya.streams.kafka.processors.ProcessorResultFactory;
import org.apache.rya.streams.kafka.processors.RyaStreamsProcessor;
import org.apache.rya.streams.kafka.processors.RyaStreamsProcessorSupplier;
-import org.openrdf.query.algebra.Group;
+import org.eclipse.rdf4j.query.algebra.Group;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/KeyValueAggregationStateStore.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/KeyValueAggregationStateStore.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/KeyValueAggregationStateStore.java
index 3300590..4eb7474 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/KeyValueAggregationStateStore.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/aggregation/KeyValueAggregationStateStore.java
@@ -28,7 +28,7 @@ import org.apache.kafka.streams.state.KeyValueStore;
import org.apache.rya.api.function.aggregation.AggregationState;
import org.apache.rya.api.function.aggregation.AggregationStateStore;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Joiner;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java
index 61ca141..c2d6190 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/join/KeyValueJoinStateStore.java
@@ -31,7 +31,7 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult.Side;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterSupplier.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterSupplier.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterSupplier.java
index 74a6f96..6e68908 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterSupplier.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterSupplier.java
@@ -26,12 +26,12 @@ import org.apache.kafka.streams.processor.ProcessorSupplier;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.VisibilityStatement;
import org.apache.rya.streams.kafka.processors.ProcessorResult;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.collect.Sets;
@@ -56,7 +56,7 @@ public class StatementOutputFormatterSupplier implements ProcessorSupplier<Objec
@DefaultAnnotation(NonNull.class)
public static final class StatementOutputFormatter implements Processor<Object, ProcessorResult> {
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final Collection<String> REQURIED_BINDINGS = Sets.newHashSet("subject", "predicate", "object");
private ProcessorContext processorContext;
@@ -88,14 +88,14 @@ public class StatementOutputFormatterSupplier implements ProcessorSupplier<Objec
// Make sure the Predicate is the correct type.
final Value predVal = result.getValue("predicate");
- if(!(predVal instanceof URI)) {
+ if(!(predVal instanceof IRI)) {
return;
}
// Forward the visibility statement.
final Statement statement = VF.createStatement(
(Resource) subjVal,
- (URI) predVal,
+ (IRI) predVal,
result.getValue("object"));
processorContext.forward(key, new VisibilityStatement(statement, result.getVisibility()));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLog.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLog.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLog.java
index 2822272..e536efc 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLog.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/queries/KafkaQueryChangeLog.java
@@ -35,12 +35,12 @@ import org.apache.kafka.common.TopicPartition;
import org.apache.rya.streams.api.queries.ChangeLogEntry;
import org.apache.rya.streams.api.queries.QueryChange;
import org.apache.rya.streams.api.queries.QueryChangeLog;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* A Kafka implementation of a {@link QueryChangeLog}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyBuilderFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyBuilderFactory.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyBuilderFactory.java
index c533854..e57503b 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyBuilderFactory.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyBuilderFactory.java
@@ -20,7 +20,7 @@ package org.apache.rya.streams.kafka.topology;
import org.apache.kafka.streams.processor.TopologyBuilder;
import org.apache.rya.api.function.projection.BNodeIdFactory;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyFactory.java b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyFactory.java
index f330fa3..f2e721e 100644
--- a/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyFactory.java
+++ b/extras/rya.streams/kafka/src/main/java/org/apache/rya/streams/kafka/topology/TopologyFactory.java
@@ -62,22 +62,22 @@ import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetSerde;
import org.apache.rya.streams.kafka.serialization.VisibilityBindingSetSerializer;
import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserializer;
import org.apache.rya.streams.kafka.serialization.VisibilityStatementSerializer;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.BinaryTupleOperator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Group;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.Reduced;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Group;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.Reduced;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
@@ -334,7 +334,7 @@ public class TopologyFactory implements TopologyBuilderFactory {
* {@link ProcessorSupplier} and meta information needed for creating a
* {@link TopologyBuilder}.
*/
- final static class QueryVisitor extends QueryModelVisitorBase<TopologyBuilderException> {
+ final static class QueryVisitor extends AbstractQueryModelVisitor<TopologyBuilderException> {
// Each node needs a ProcessorEntry to be a processor node in the TopologyBuilder.
private final List<ProcessorEntry> entries = new ArrayList<>();
private final Map<TupleExpr, String> idMap = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaGetQueryResultStreamIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaGetQueryResultStreamIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaGetQueryResultStreamIT.java
index 59c08b7..3538ac6 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaGetQueryResultStreamIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaGetQueryResultStreamIT.java
@@ -39,11 +39,11 @@ import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserialize
import org.apache.rya.streams.kafka.serialization.VisibilityStatementSerializer;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the methods of {@link KafkaGetQueryResultStream}.
@@ -91,7 +91,7 @@ public class KafkaGetQueryResultStreamIT {
// Create a list of test VisibilityBindingSets.
final List<VisibilityBindingSet> original = new ArrayList<>();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
bs.addBinding("urn:name", vf.createLiteral("Alice"));
original.add(new VisibilityBindingSet(bs, "a|b|c"));
@@ -133,7 +133,7 @@ public class KafkaGetQueryResultStreamIT {
final String resultTopic = KafkaTopics.queryResultsTopic(ryaInstance, queryId);
// Write a single visibility binding set to the query's result topic. This will not appear in the expected results.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
bs.addBinding("urn:name", vf.createLiteral("Alice"));
producer.send(new ProducerRecord<>(resultTopic, new VisibilityBindingSet(bs, "a|b|c")));
@@ -201,10 +201,10 @@ public class KafkaGetQueryResultStreamIT {
// Create some statements that will be written to the result topic.
final List<VisibilityStatement> original = new ArrayList<>();
- final ValueFactory vf = new ValueFactoryImpl();
- original.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob")), "a") );
- original.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:age"), vf.createLiteral(63)), "b") );
- original.add( new VisibilityStatement(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:age"), vf.createLiteral("urn:34")), "") );
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ original.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob")), "a") );
+ original.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:age"), vf.createLiteral(63)), "b") );
+ original.add( new VisibilityStatement(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:age"), vf.createLiteral("urn:34")), "") );
// Write the entries to the query result topic in Kafka.
try(final Producer<?, VisibilityStatement> producer =
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatementsIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatementsIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatementsIT.java
index 7bfa560..4df2479 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatementsIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaLoadStatementsIT.java
@@ -35,11 +35,11 @@ import org.apache.rya.streams.kafka.serialization.VisibilityStatementDeserialize
import org.apache.rya.streams.kafka.serialization.VisibilityStatementSerializer;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.rio.UnsupportedRDFormatException;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.rio.UnsupportedRDFormatException;
/**
* Integration tests the {@link KafkaLoadStatements} command
@@ -81,16 +81,16 @@ public class KafkaLoadStatementsIT {
}
final List<VisibilityStatement> original = new ArrayList<>();
- final ValueFactory VF = ValueFactoryImpl.getInstance();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
original.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#alice"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#bob")),
+ vf.createStatement(vf.createIRI("http://example#alice"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#bob")),
visibilities));
original.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#bob"), VF.createURI("http://example#talksTo"), VF.createURI("http://example#charlie")),
+ vf.createStatement(vf.createIRI("http://example#bob"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#charlie")),
visibilities));
original.add(new VisibilityStatement(
- VF.createStatement(VF.createURI("http://example#charlie"), VF.createURI("http://example#likes"), VF.createURI("http://example#icecream")),
+ vf.createStatement(vf.createIRI("http://example#charlie"), vf.createIRI("http://example#likes"), vf.createIRI("http://example#icecream")),
visibilities));
// Show the written statement matches the read one.
assertEquals(original, read);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaRunQueryIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaRunQueryIT.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaRunQueryIT.java
index 4459057..b1a801e 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaRunQueryIT.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/interactor/KafkaRunQueryIT.java
@@ -44,13 +44,13 @@ import org.apache.rya.streams.kafka.serialization.VisibilityStatementSerializer;
import org.apache.rya.streams.kafka.topology.TopologyFactory;
import org.apache.rya.test.kafka.KafkaTestInstanceRule;
import org.apache.rya.test.kafka.KafkaTestUtil;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.AbstractScheduledService.Scheduler;
@@ -116,34 +116,34 @@ public class KafkaRunQueryIT {
kafka.createTopic(resultsTopic);
// Create the statements that will be loaded.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<VisibilityStatement> statements = new ArrayList<>();
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Alice"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:BurgerJoint")), "a"));
+ vf.createIRI("urn:Alice"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:BurgerJoint")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Bob"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Bob"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
statements.add(new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Charlie"),
- vf.createURI("urn:worksAt"),
- vf.createURI("urn:TacoShop")), "a"));
+ vf.createIRI("urn:Charlie"),
+ vf.createIRI("urn:worksAt"),
+ vf.createIRI("urn:TacoShop")), "a"));
// Create the expected results.
final List<VisibilityBindingSet> expected = new ArrayList<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Alice"));
- bs.addBinding("business", vf.createURI("urn:BurgerJoint"));
+ bs.addBinding("person", vf.createIRI("urn:Alice"));
+ bs.addBinding("business", vf.createIRI("urn:BurgerJoint"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Bob"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Bob"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
bs = new MapBindingSet();
- bs.addBinding("person", vf.createURI("urn:Charlie"));
- bs.addBinding("business", vf.createURI("urn:TacoShop"));
+ bs.addBinding("person", vf.createIRI("urn:Charlie"));
+ bs.addBinding("business", vf.createIRI("urn:TacoShop"));
expected.add(new VisibilityBindingSet(bs, "a"));
// Execute the test. This will result in a set of results that were read from the results topic.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/BindingSetOutputFormatterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/BindingSetOutputFormatterTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/BindingSetOutputFormatterTest.java
index 3c810b1..1560f50 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/BindingSetOutputFormatterTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/BindingSetOutputFormatterTest.java
@@ -30,10 +30,10 @@ import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult.Side;
import org.apache.rya.streams.kafka.processors.ProcessorResult.UnaryResult;
import org.apache.rya.streams.kafka.processors.output.BindingSetOutputFormatterSupplier.BindingSetOutputFormatter;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit tests the methods of {@link BindingSetOutputFormatter}.
@@ -43,9 +43,9 @@ public class BindingSetOutputFormatterTest {
@Test
public void unaryResult() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("person", vf.createURI("urn:Alice"));
+ bindingSet.addBinding("person", vf.createIRI("urn:Alice"));
bindingSet.addBinding("age", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -64,9 +64,9 @@ public class BindingSetOutputFormatterTest {
@Test
public void binaryResult() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("person", vf.createURI("urn:Alice"));
+ bindingSet.addBinding("person", vf.createIRI("urn:Alice"));
bindingSet.addBinding("age", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterTest.java
index 5f7e9a6..0f5c9fb 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/output/StatementOutputFormatterTest.java
@@ -32,10 +32,10 @@ import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.BinaryResult.Side;
import org.apache.rya.streams.kafka.processors.ProcessorResult.UnaryResult;
import org.apache.rya.streams.kafka.processors.output.StatementOutputFormatterSupplier.StatementOutputFormatter;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit tests the methods of {@link StatementOutputFormatter}.
@@ -45,10 +45,10 @@ public class StatementOutputFormatterTest {
@Test
public void unaryResult() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("subject", vf.createURI("urn:Alice"));
- bindingSet.addBinding("predicate", vf.createURI("urn:age"));
+ bindingSet.addBinding("subject", vf.createIRI("urn:Alice"));
+ bindingSet.addBinding("predicate", vf.createIRI("urn:age"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -62,8 +62,8 @@ public class StatementOutputFormatterTest {
// Verify the mock was invoked with the expected output.
final VisibilityStatement expectedStmt = new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Alice"),
- vf.createURI("urn:age"),
+ vf.createIRI("urn:Alice"),
+ vf.createIRI("urn:age"),
vf.createLiteral(34)), "a");
verify(context, times(1)).forward(eq("key"), eq(expectedStmt));
}
@@ -71,10 +71,10 @@ public class StatementOutputFormatterTest {
@Test
public void binaryResult() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("subject", vf.createURI("urn:Alice"));
- bindingSet.addBinding("predicate", vf.createURI("urn:age"));
+ bindingSet.addBinding("subject", vf.createIRI("urn:Alice"));
+ bindingSet.addBinding("predicate", vf.createIRI("urn:age"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -88,8 +88,8 @@ public class StatementOutputFormatterTest {
// Verify the mock was invoked with the expected output.
final VisibilityStatement expectedStmt = new VisibilityStatement(vf.createStatement(
- vf.createURI("urn:Alice"),
- vf.createURI("urn:age"),
+ vf.createIRI("urn:Alice"),
+ vf.createIRI("urn:age"),
vf.createLiteral(34)), "a");
verify(context, times(1)).forward(eq("key"), eq(expectedStmt));
}
@@ -97,9 +97,9 @@ public class StatementOutputFormatterTest {
@Test
public void missingSubject() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("predicate", vf.createURI("urn:age"));
+ bindingSet.addBinding("predicate", vf.createIRI("urn:age"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -118,10 +118,10 @@ public class StatementOutputFormatterTest {
@Test
public void subjectWrongType() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
bindingSet.addBinding("subject", vf.createLiteral("Alice"));
- bindingSet.addBinding("predicate", vf.createURI("urn:age"));
+ bindingSet.addBinding("predicate", vf.createIRI("urn:age"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -140,9 +140,9 @@ public class StatementOutputFormatterTest {
@Test
public void missingPredicate() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("subject", vf.createURI("urn:Alice"));
+ bindingSet.addBinding("subject", vf.createIRI("urn:Alice"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -161,9 +161,9 @@ public class StatementOutputFormatterTest {
@Test
public void predicateWrongType() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("subject", vf.createURI("urn:Alice"));
+ bindingSet.addBinding("subject", vf.createIRI("urn:Alice"));
bindingSet.addBinding("predicate", vf.createLiteral("age"));
bindingSet.addBinding("object", vf.createLiteral(34));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
@@ -183,10 +183,10 @@ public class StatementOutputFormatterTest {
@Test
public void missingObject() {
// Create the input binding set.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bindingSet = new MapBindingSet();
- bindingSet.addBinding("subject", vf.createURI("urn:Alice"));
- bindingSet.addBinding("predicate", vf.createURI("urn:age"));
+ bindingSet.addBinding("subject", vf.createIRI("urn:Alice"));
+ bindingSet.addBinding("predicate", vf.createIRI("urn:age"));
final VisibilityBindingSet visBs = new VisibilityBindingSet(bindingSet, "a");
// Mock the processor context that will be invoked.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorTest.java b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorTest.java
index d25db23..a52c73c 100644
--- a/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorTest.java
+++ b/extras/rya.streams/kafka/src/test/java/org/apache/rya/streams/kafka/processors/projection/MultiProjectionProcessorTest.java
@@ -37,14 +37,14 @@ import org.apache.rya.streams.kafka.processors.ProcessorResult;
import org.apache.rya.streams.kafka.processors.ProcessorResult.ResultType;
import org.apache.rya.streams.kafka.processors.ProcessorResult.UnaryResult;
import org.apache.rya.streams.kafka.processors.projection.MultiProjectionProcessorSupplier.MultiProjectionProcessor;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.openrdf.model.BNode;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Unit test the methods of {@link MultiProjectionProcessor}.
@@ -66,10 +66,10 @@ public class MultiProjectionProcessorTest {
"}");
// Create a Binding Set that contains the result of the WHERE clause.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet inputBs = new MapBindingSet();
- inputBs.addBinding("location", vf.createURI("urn:corner1"));
- inputBs.addBinding("direction", vf.createURI("urn:NW"));
+ inputBs.addBinding("location", vf.createIRI("urn:corner1"));
+ inputBs.addBinding("direction", vf.createIRI("urn:NW"));
final VisibilityBindingSet inputVisBs = new VisibilityBindingSet(inputBs, "a|b");
// Make the expected results.
@@ -80,19 +80,19 @@ public class MultiProjectionProcessorTest {
MapBindingSet expectedBs = new MapBindingSet();
expectedBs.addBinding("subject", blankNode);
expectedBs.addBinding("predicate", RDF.TYPE);
- expectedBs.addBinding("object", vf.createURI("urn:movementObservation"));
+ expectedBs.addBinding("object", vf.createIRI("urn:movementObservation"));
expected.add(new VisibilityBindingSet(expectedBs, "a|b"));
expectedBs = new MapBindingSet();
expectedBs.addBinding("subject", blankNode);
- expectedBs.addBinding("predicate", vf.createURI("urn:direction"));
- expectedBs.addBinding("object", vf.createURI("urn:NW"));
+ expectedBs.addBinding("predicate", vf.createIRI("urn:direction"));
+ expectedBs.addBinding("object", vf.createIRI("urn:NW"));
expected.add(new VisibilityBindingSet(expectedBs, "a|b"));
expectedBs = new MapBindingSet();
expectedBs.addBinding("subject", blankNode);
- expectedBs.addBinding("predicate", vf.createURI("urn:location"));
- expectedBs.addBinding("object", vf.createURI("urn:corner1"));
+ expectedBs.addBinding("predicate", vf.createIRI("urn:location"));
+ expectedBs.addBinding("object", vf.createIRI("urn:corner1"));
expected.add(new VisibilityBindingSet(expectedBs, "a|b"));
// Mock the processor context that will be invoked.
[30/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalIndexer.java
index 0eac949..51160d3 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalIndexer.java
@@ -1,8 +1,3 @@
-package org.apache.rya.indexing;
-
-import org.openrdf.model.Statement;
-import org.openrdf.query.QueryEvaluationException;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,10 +16,12 @@ import org.openrdf.query.QueryEvaluationException;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing;
-
-import info.aduna.iteration.CloseableIteration;
import org.apache.rya.api.persist.index.RyaSecondaryIndexer;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
/**
* A repository to store, index, and retrieve {@link Statement}s based on time.
@@ -90,35 +87,35 @@ public interface TemporalIndexer extends RyaSecondaryIndexer {
* and then the inverses, including after.
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantEqualsInstant(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantEqualsInstant(
TemporalInstant queryInstant, StatementConstraints contraints)
- throws QueryEvaluationException;;
+ throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantBeforeInstant(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantBeforeInstant(
TemporalInstant queryInstant, StatementConstraints contraints)
- throws QueryEvaluationException;;
+ throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantAfterInstant(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantAfterInstant(
TemporalInstant queryInstant, StatementConstraints contraints)
- throws QueryEvaluationException;;
+ throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantBeforeInterval(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantBeforeInterval(
TemporalInterval givenInterval, StatementConstraints contraints)
- throws QueryEvaluationException;;
+ throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantAfterInterval(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantAfterInterval(
TemporalInterval givenInterval, StatementConstraints contraints)
throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantInsideInterval(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantInsideInterval(
TemporalInterval givenInterval, StatementConstraints contraints)
throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantHasBeginningInterval(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantHasBeginningInterval(
TemporalInterval queryInterval, StatementConstraints contraints)
throws QueryEvaluationException;
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryInstantHasEndInterval(
+ public CloseableIteration<Statement, QueryEvaluationException> queryInstantHasEndInterval(
TemporalInterval queryInterval, StatementConstraints contraints)
throws QueryEvaluationException;
@@ -133,7 +130,7 @@ public interface TemporalIndexer extends RyaSecondaryIndexer {
* @return
* @throws QueryEvaluationException
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryIntervalEquals(
+ public CloseableIteration<Statement, QueryEvaluationException> queryIntervalEquals(
TemporalInterval query, StatementConstraints contraints)
throws QueryEvaluationException;
@@ -147,7 +144,7 @@ public interface TemporalIndexer extends RyaSecondaryIndexer {
* the {@link StatementConstraints}
* @return
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryIntervalBefore(
+ public CloseableIteration<Statement, QueryEvaluationException> queryIntervalBefore(
TemporalInterval query, StatementConstraints contraints)
throws QueryEvaluationException;
@@ -160,7 +157,7 @@ public interface TemporalIndexer extends RyaSecondaryIndexer {
* the {@link StatementConstraints}
* @return
*/
- public abstract CloseableIteration<Statement, QueryEvaluationException> queryIntervalAfter(
+ public CloseableIteration<Statement, QueryEvaluationException> queryIntervalAfter(
TemporalInterval query, StatementConstraints contraints)
throws QueryEvaluationException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalTupleSet.java
index 3f20191..bb34609 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/TemporalTupleSet.java
@@ -1,22 +1,3 @@
-package org.apache.rya.indexing;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-import org.joda.time.DateTime;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.QueryModelVisitor;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.Maps;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -35,12 +16,35 @@ import com.google.common.collect.Maps;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing;
+
+import java.util.Map;
+import java.util.Set;
-import info.aduna.iteration.CloseableIteration;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
+import org.joda.time.DateTime;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Maps;
-//Indexing Node for temporal expressions to be inserted into execution plan
-//to delegate temporal portion of query to temporal index
+/**
+ * Indexing Node for temporal expressions to be inserted into execution plan
+ * to delegate temporal portion of query to temporal index
+ */
public class TemporalTupleSet extends ExternalTupleSet {
+ private static final long serialVersionUID = 1L;
+
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final Configuration conf;
private final TemporalIndexer temporalIndexer;
@@ -111,7 +115,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(final BindingSet bindings)
throws QueryEvaluationException {
- final URI funcURI = filterInfo.getFunction();
+ final IRI funcURI = filterInfo.getFunction();
final SearchFunction searchFunction = new TemporalSearchFunctionFactory(conf, temporalIndexer).getSearchFunction(funcURI);
if(filterInfo.getArguments().length > 1) {
@@ -125,7 +129,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
//returns appropriate search function for a given URI
//search functions used by TemporalIndexer to query Temporal Index
public static class TemporalSearchFunctionFactory {
- private final Map<URI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
+ private final Map<IRI, SearchFunction> SEARCH_FUNCTION_MAP = Maps.newHashMap();
private final TemporalIndexer temporalIndexer;
public TemporalSearchFunctionFactory(final Configuration conf, final TemporalIndexer temporalIndexer) {
@@ -138,7 +142,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
* @param searchFunction
* @return
*/
- public SearchFunction getSearchFunction(final URI searchFunction) {
+ public SearchFunction getSearchFunction(final IRI searchFunction) {
SearchFunction geoFunc = null;
try {
geoFunc = getSearchFunctionInternal(searchFunction);
@@ -149,7 +153,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
return geoFunc;
}
- private SearchFunction getSearchFunctionInternal(final URI searchFunction) throws QueryEvaluationException {
+ private SearchFunction getSearchFunctionInternal(final IRI searchFunction) throws QueryEvaluationException {
final SearchFunction sf = SEARCH_FUNCTION_MAP.get(searchFunction);
if (sf != null) {
@@ -170,7 +174,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantAfterInstant";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantBeforeInstant = new SearchFunction() {
@Override
@@ -183,7 +187,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantBeforeInstant";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantEqualsInstant = new SearchFunction() {
@@ -197,7 +201,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantEqualsInstant";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantAfterInterval = new SearchFunction() {
@@ -211,7 +215,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantAfterInterval";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantBeforeInterval = new SearchFunction() {
@@ -225,7 +229,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantBeforeInterval";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantInsideInterval = new SearchFunction() {
@@ -239,7 +243,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantInsideInterval";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantHasBeginningInterval = new SearchFunction() {
@@ -253,7 +257,7 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantHasBeginningInterval";
- };
+ }
};
private final SearchFunction TEMPORAL_InstantHasEndInterval = new SearchFunction() {
@@ -267,22 +271,22 @@ public class TemporalTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEMPORAL_InstantHasEndInterval";
- };
+ }
};
{
final String TEMPORAL_NS = "tag:rya-rdf.org,2015:temporal#";
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"after"), TEMPORAL_InstantAfterInstant);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"before"), TEMPORAL_InstantBeforeInstant);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"equals"), TEMPORAL_InstantEqualsInstant);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"after"), TEMPORAL_InstantAfterInstant);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"before"), TEMPORAL_InstantBeforeInstant);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"equals"), TEMPORAL_InstantEqualsInstant);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"beforeInterval"), TEMPORAL_InstantBeforeInterval);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"afterInterval"), TEMPORAL_InstantAfterInterval);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"insideInterval"), TEMPORAL_InstantInsideInterval);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"hasBeginningInterval"),
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"beforeInterval"), TEMPORAL_InstantBeforeInterval);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"afterInterval"), TEMPORAL_InstantAfterInterval);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"insideInterval"), TEMPORAL_InstantInsideInterval);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"hasBeginningInterval"),
TEMPORAL_InstantHasBeginningInterval);
- SEARCH_FUNCTION_MAP.put(new URIImpl(TEMPORAL_NS+"hasEndInterval"), TEMPORAL_InstantHasEndInterval);
+ SEARCH_FUNCTION_MAP.put(VF.createIRI(TEMPORAL_NS+"hasEndInterval"), TEMPORAL_InstantHasEndInterval);
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
index 8379215..9e6e92b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
@@ -33,7 +33,7 @@ import org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
import org.apache.rya.indexing.external.PrecomputedJoinIndexer;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer;
-import org.openrdf.sail.Sail;
+import org.eclipse.rdf4j.sail.Sail;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java
index 561f6c6..d2fe58a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/ConfigUtils.java
@@ -60,8 +60,8 @@ import org.apache.rya.indexing.mongodb.freetext.MongoFreeTextIndexer;
import org.apache.rya.indexing.mongodb.temporal.MongoTemporalIndexer;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataOptimizer;
-import org.openrdf.model.URI;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
@@ -210,11 +210,11 @@ public class ConfigUtils {
return conf.getInt(FREE_TEXT_QUERY_TERM_LIMIT, 100);
}
- public static Set<URI> getFreeTextPredicates(final Configuration conf) {
+ public static Set<IRI> getFreeTextPredicates(final Configuration conf) {
return getPredicates(conf, FREETEXT_PREDICATES_LIST);
}
- public static Set<URI> getGeoPredicates(final Configuration conf) {
+ public static Set<IRI> getGeoPredicates(final Configuration conf) {
return getPredicates(conf, GEO_PREDICATES_LIST);
}
@@ -225,15 +225,15 @@ public class ConfigUtils {
* @return Set of predicate URI's whose objects should be date time
* literals.
*/
- public static Set<URI> getTemporalPredicates(final Configuration conf) {
+ public static Set<IRI> getTemporalPredicates(final Configuration conf) {
return getPredicates(conf, TEMPORAL_PREDICATES_LIST);
}
- protected static Set<URI> getPredicates(final Configuration conf, final String confName) {
+ protected static Set<IRI> getPredicates(final Configuration conf, final String confName) {
final String[] validPredicateStrings = conf.getStrings(confName, new String[] {});
- final Set<URI> predicates = new HashSet<>();
+ final Set<IRI> predicates = new HashSet<>();
for (final String prediateString : validPredicateStrings) {
- predicates.add(new URIImpl(prediateString));
+ predicates.add(SimpleValueFactory.getInstance().createIRI(prediateString));
}
return predicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
index c87b240..1b20514 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
@@ -54,25 +54,22 @@ import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.indexing.DocIdIndexer;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Sets;
import com.google.common.primitives.Bytes;
-import info.aduna.iteration.CloseableIteration;
-
-import info.aduna.iteration.CloseableIteration;
-
public class AccumuloDocIdIndexer implements DocIdIndexer {
@@ -192,10 +189,8 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -314,10 +309,8 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
isEmpty = true;
return false;
- } else if (isEmpty) {
- return false;
} else {
- return true;
+ return !isEmpty;
}
}
@@ -366,7 +359,7 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
if (tripleComponent.equals("object")) {
final byte[] object = Bytes.concat(cqContent, objType);
- org.openrdf.model.Value v = null;
+ org.eclipse.rdf4j.model.Value v = null;
try {
v = RyaToRdfConversions.convertValue(RyaContext.getInstance().deserialize(
object));
@@ -378,7 +371,7 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
} else if (tripleComponent.equals("subject")) {
if (!commonVarSet) {
final byte[] object = Bytes.concat(row.getBytes(), objType);
- org.openrdf.model.Value v = null;
+ org.eclipse.rdf4j.model.Value v = null;
try {
v = RyaToRdfConversions.convertValue(RyaContext.getInstance().deserialize(
object));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
index ab4bd55..300d8ba 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
@@ -58,7 +58,7 @@ import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
@@ -384,7 +384,7 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return null;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizer.java
index d06cfd7..59a260e 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizer.java
@@ -19,7 +19,6 @@ package org.apache.rya.indexing.accumulo.entity;
* under the License.
*/
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -31,21 +30,22 @@ import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.persist.joinselect.SelectivityEvalDAO;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -132,7 +132,7 @@ public class EntityOptimizer implements QueryOptimizer, Configurable {
tupleExpr.visit(new JoinVisitor());
}
- protected class JoinVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected class JoinVisitor extends AbstractQueryModelVisitor<RuntimeException> {
@Override
public void meet(Join node) {
@@ -332,7 +332,7 @@ public class EntityOptimizer implements QueryOptimizer, Configurable {
// weight starQuery where common Var is constant slightly more -- this factor is subject
// to change
- if(s.startsWith("-const-")) {
+ if (VarNameUtils.isConstant(s)) {
tempPriority *= 10;
}
if (tempPriority > priority) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityTupleSet.java
index c8675cd..3b7c19b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityTupleSet.java
@@ -23,6 +23,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
+import com.google.common.base.Joiner;
+import com.google.common.collect.Sets;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
@@ -37,21 +39,17 @@ import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RdfCloudTripleStoreConnection;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.sail.SailException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.sail.SailException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.collect.Sets;
-import com.google.common.base.Joiner;
-
-import info.aduna.iteration.CloseableIteration;
-
public class EntityTupleSet extends ExternalSet implements ExternalBatchingIterator {
private static final Logger LOG = LoggerFactory.getLogger(EntityTupleSet.class);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
index a37b14ad..fc1b15e 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
@@ -1,7 +1,3 @@
-package org.apache.rya.indexing.accumulo.entity;
-
-import java.nio.charset.StandardCharsets;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,8 +16,9 @@ import java.nio.charset.StandardCharsets;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.accumulo.entity;
-
+import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -32,14 +29,15 @@ import org.apache.hadoop.io.Text;
import org.apache.rya.accumulo.documentIndex.TextColumn;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -520,7 +518,7 @@ public class StarQuery {
for (final String s : bindings) {
- if (!s.startsWith("-const-")) {
+ if (!VarNameUtils.isConstant(s)) {
varCount++;
}
if (varCount > 1) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexer.java
index 9078015..0a44d09 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/AccumuloFreeTextIndexer.java
@@ -75,16 +75,15 @@ import org.apache.rya.indexing.accumulo.freetext.query.QueryParser;
import org.apache.rya.indexing.accumulo.freetext.query.QueryParserTreeConstants;
import org.apache.rya.indexing.accumulo.freetext.query.SimpleNode;
import org.apache.rya.indexing.accumulo.freetext.query.TokenMgrError;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
-import info.aduna.iteration.CloseableIteration;
-
/**
* The {@link AccumuloFreeTextIndexer} stores and queries "free text" data from statements into tables in Accumulo. Specifically, this class
* stores data into two different Accumulo Tables. This is the <b>document table</b> (default name: triplestore_text) and the <b>terms
@@ -208,7 +207,7 @@ public class AccumuloFreeTextIndexer extends AbstractAccumuloIndexer implements
private int docTableNumPartitions;
- private Set<URI> validPredicates;
+ private Set<IRI> validPredicates;
private Configuration conf;
@@ -393,7 +392,7 @@ public class AccumuloFreeTextIndexer extends AbstractAccumuloIndexer implements
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return validPredicates;
}
@@ -530,7 +529,7 @@ public class AccumuloFreeTextIndexer extends AbstractAccumuloIndexer implements
if (contraints.hasPredicates()) {
constrainedQuery.append(" AND (");
final List<String> predicates = new ArrayList<String>();
- for (final URI u : contraints.getPredicates()) {
+ for (final IRI u : contraints.getPredicates()) {
predicates.add(ColumnPrefixes.getPredColFam(u.stringValue()).toString());
}
constrainedQuery.append(StringUtils.join(predicates, " OR "));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/ColumnPrefixes.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/ColumnPrefixes.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/ColumnPrefixes.java
index e8825f4..a232c44 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/ColumnPrefixes.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/ColumnPrefixes.java
@@ -19,16 +19,13 @@ package org.apache.rya.indexing.accumulo.freetext;
* under the License.
*/
-
-
import java.nio.ByteBuffer;
import java.nio.charset.CharacterCodingException;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.io.Text;
-import org.openrdf.model.Statement;
-
import org.apache.rya.indexing.StatementSerializer;
+import org.eclipse.rdf4j.model.Statement;
/**
* Row ID: shardId
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
index 0e74f5e..e98cccb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
@@ -19,26 +19,23 @@ package org.apache.rya.indexing.accumulo.freetext;
* under the License.
*/
-
-import info.aduna.iteration.CloseableIteration;
-
import java.io.IOException;
import java.util.Set;
+import org.apache.hadoop.conf.Configuration;
import org.apache.rya.indexing.FreeTextIndexer;
import org.apache.rya.indexing.IndexingExpr;
import org.apache.rya.indexing.IteratorFactory;
import org.apache.rya.indexing.SearchFunction;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
-
-import org.apache.hadoop.conf.Configuration;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.QueryModelVisitor;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
import com.google.common.base.Joiner;
@@ -128,7 +125,7 @@ public class FreeTextTupleSet extends ExternalTupleSet {
throws QueryEvaluationException {
- URI funcURI = filterInfo.getFunction();
+ IRI funcURI = filterInfo.getFunction();
SearchFunction searchFunction = new SearchFunction() {
@@ -147,7 +144,7 @@ public class FreeTextTupleSet extends ExternalTupleSet {
@Override
public String toString() {
return "TEXT";
- };
+ }
};
if (filterInfo.getArguments().length > 1) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/LuceneTokenizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/LuceneTokenizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/LuceneTokenizer.java
index 3378fc0..3b945fd 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/LuceneTokenizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/LuceneTokenizer.java
@@ -19,8 +19,6 @@ package org.apache.rya.indexing.accumulo.freetext;
* under the License.
*/
-
-
import java.io.IOException;
import java.io.StringReader;
import java.util.SortedSet;
@@ -30,19 +28,17 @@ import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.lucene.util.Version;
/**
* A {@link Tokenizer} that delegates to Lucene functions
*/
public class LuceneTokenizer implements Tokenizer {
- private static final Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_36);
+ private static final Analyzer ANALYZER = new StandardAnalyzer();
@Override
public SortedSet<String> tokenize(String string) {
SortedSet<String> set = new TreeSet<String>();
- try {
- TokenStream stream = analyzer.tokenStream(null, new StringReader(string));
+ try (final TokenStream stream = ANALYZER.tokenStream(null, new StringReader(string))) {
stream.reset();
while (stream.incrementToken()) {
set.add(stream.getAttribute(CharTermAttribute.class).toString());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexer.java
index 48434ca..ce660f9 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/temporal/AccumuloTemporalIndexer.java
@@ -68,14 +68,13 @@ import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.TemporalInterval;
import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.joda.time.DateTime;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.query.QueryEvaluationException;
-
-import info.aduna.iteration.CloseableIteration;
public class AccumuloTemporalIndexer extends AbstractAccumuloIndexer implements TemporalIndexer {
@@ -98,7 +97,7 @@ public class AccumuloTemporalIndexer extends AbstractAccumuloIndexer implements
private BatchWriter temporalIndexBatchWriter;
- private Set<URI> validPredicates;
+ private Set<IRI> validPredicates;
private String temporalIndexTableName;
private boolean isInit = false;
@@ -873,7 +872,7 @@ public class AccumuloTemporalIndexer extends AbstractAccumuloIndexer implements
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return validPredicates;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexOptimizer.java
index cec776b..6d47060 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexOptimizer.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -37,9 +37,9 @@ import org.apache.rya.indexing.external.matching.QueryNodeListRater;
import org.apache.rya.indexing.external.matching.QuerySegment;
import org.apache.rya.indexing.external.matching.TopOfQueryFilterRelocator;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
index 1052b38..e52b92b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -36,11 +36,12 @@ import org.apache.rya.indexing.entity.storage.TypeStorage;
import org.apache.rya.indexing.entity.storage.TypeStorage.TypeStorageException;
import org.apache.rya.indexing.external.matching.ExternalSetProvider;
import org.apache.rya.indexing.external.matching.QuerySegment;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -49,6 +50,7 @@ import com.google.common.collect.Multimap;
* Provides {@link EntityQueryNodes}s.
*/
public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNode> {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private Multimap<Type, StatementPattern> typeMap;
private Map<String, Type> subjectTypeMap;
private final TypeStorage typeStorage;
@@ -102,7 +104,7 @@ public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNo
final String subjStr = subj.getName();
final RyaURI predURI = getPredURI(pattern);
//check to see if current node is type
- if(new URIImpl(predURI.getData()).equals(RDF.TYPE)) {
+ if(VF.createIRI(predURI.getData()).equals(RDF.TYPE)) {
final Var obj = pattern.getObjectVar();
final RyaURI objURI = new RyaURI(obj.getValue().stringValue());
try {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityToSegmentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityToSegmentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityToSegmentConverter.java
index c76a3ab..eb0e7d6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityToSegmentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityToSegmentConverter.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -28,9 +28,9 @@ import org.apache.rya.indexing.entity.query.EntityQueryNode;
import org.apache.rya.indexing.external.matching.ExternalSetConverter;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.external.matching.QuerySegment;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
import com.google.common.base.Preconditions;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
index 3804de4..fb64ccf 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -34,7 +34,7 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.indexing.entity.storage.EntityStorage;
import org.apache.rya.indexing.smarturi.SmartUriAdapter;
import org.apache.rya.indexing.smarturi.SmartUriException;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -89,7 +89,7 @@ public class Entity {
private final int version;
- private URI smartUri = null;
+ private IRI smartUri = null;
/**
* To construct an instance of this class, use {@link Builder}.
@@ -101,7 +101,7 @@ public class Entity {
* Entity, grouped by Type ID.
* @param version The version of this Entity. This value is used by the
* {@link EntityStorage} to prevent stale updates.
- * @param smartUri the Smart {@link URI} representation of this
+ * @param smartUri the Smart {@link IRI} representation of this
* {@link Entity}.
*/
private Entity(
@@ -109,7 +109,7 @@ public class Entity {
final ImmutableList<RyaURI> explicitTypeIds,
final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties,
final int version,
- final URI smartUri) {
+ final IRI smartUri) {
this.subject = requireNonNull(subject);
this.explicitTypeIds = requireNonNull(explicitTypeIds);
properties = requireNonNull(typeProperties);
@@ -175,9 +175,9 @@ public class Entity {
}
/**
- * @return the Smart {@link URI} representation of this {@link Entity}.
+ * @return the Smart {@link IRI} representation of this {@link Entity}.
*/
- public URI getSmartUri() {
+ public IRI getSmartUri() {
return smartUri;
}
@@ -292,7 +292,7 @@ public class Entity {
private RyaURI subject = null;
private final List<RyaURI> explicitTypes = new ArrayList<>();
private final Map<RyaURI, Map<RyaURI, Property>> properties = new HashMap<>();
- private URI smartUri = null;
+ private IRI smartUri = null;
private int version = 0;
@@ -392,11 +392,11 @@ public class Entity {
}
/**
- * @param smartUri - the Smart {@link URI} representation of this
+ * @param smartUri - the Smart {@link IRI} representation of this
* {@link Entity}.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setSmartUri(final URI smartUri) {
+ public Builder setSmartUri(final IRI smartUri) {
this.smartUri = smartUri;
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
index 793252e..70efc3a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -42,16 +42,17 @@ import org.apache.rya.indexing.entity.storage.EntityStorage.EntityStorageExcepti
import org.apache.rya.indexing.entity.storage.mongo.ConvertingCursor;
import org.apache.rya.indexing.entity.update.EntityIndexer;
import org.apache.rya.rdftriplestore.evaluation.ExternalBatchingIterator;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.evaluation.iterator.CollectionIteration;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.iterator.CollectionIteration;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -61,7 +62,6 @@ import com.google.common.collect.ImmutableMap.Builder;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* Indexing Node for {@link Entity} expressions to be inserted into execution plan
@@ -133,7 +133,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
}
// Any constant that appears in the Object portion of the SP will be used to make sure they match.
- final Builder<RyaURI, Var> builder = ImmutableMap.<RyaURI, Var>builder();
+ final Builder<RyaURI, Var> builder = ImmutableMap.builder();
for(final StatementPattern sp : patterns) {
final Var object = sp.getObjectVar();
final Var pred = sp.getPredicateVar();
@@ -297,7 +297,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
if(prop.isPresent()) {
final RyaType type = prop.get();
final String bindingName = objectVariables.get(key).getName();
- resultSet.addBinding(bindingName, ValueFactoryImpl.getInstance().createLiteral(type.getData()));
+ resultSet.addBinding(bindingName, SimpleValueFactory.getInstance().createLiteral(type.getData()));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
index f2647ef..7333de1 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -29,7 +29,7 @@ import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.storage.mongo.key.MongoDbSafeKey;
import org.bson.Document;
-import org.openrdf.model.impl.URIImpl;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -130,7 +130,7 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> {
builder.setVersion( document.getInteger(VERSION) );
- builder.setSmartUri( new URIImpl(document.getString(SMART_URI)) );
+ builder.setSmartUri( SimpleValueFactory.getInstance().createIRI(document.getString(SMART_URI)) );
return builder.build();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverter.java
index c0afd73..80c489e 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/RyaTypeDocumentConverter.java
@@ -22,8 +22,8 @@ import static java.util.Objects.requireNonNull;
import org.apache.rya.api.domain.RyaType;
import org.bson.Document;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -34,7 +34,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public class RyaTypeDocumentConverter implements DocumentConverter<RyaType> {
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
public static final String DATA_TYPE = "dataType";
public static final String VALUE = "value";
@@ -63,7 +63,7 @@ public class RyaTypeDocumentConverter implements DocumentConverter<RyaType> {
}
return new RyaType(
- VF.createURI( document.getString(DATA_TYPE) ),
+ VF.createIRI( document.getString(DATA_TYPE) ),
document.getString(VALUE));
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
index 7392318..52d6f4d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -49,8 +49,8 @@ import org.apache.rya.indexing.entity.storage.mongo.ConvertingCursor;
import org.apache.rya.indexing.mongodb.IndexingException;
import org.apache.rya.mongodb.MongoSecondaryIndex;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
import com.google.common.base.Objects;
@@ -260,7 +260,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
// This isn't used anywhere in Rya, so it will not be implemented.
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
index 6de8e3b..c2086d2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
@@ -43,7 +43,7 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageExce
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.update.PrecomputedJoinUpdater;
import org.apache.rya.indexing.pcj.update.PrecomputedJoinUpdater.PcjUpdateException;
-import org.openrdf.model.URI;
+import org.eclipse.rdf4j.model.IRI;
import com.google.common.base.Optional;
import com.google.common.base.Supplier;
@@ -274,7 +274,7 @@ public class PrecomputedJoinIndexer extends AbstractAccumuloIndexer {
}
@Override
- public Set<URI> getIndexablePredicates() {
+ public Set<IRI> getIndexablePredicates() {
return new HashSet<>();
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/accumulo/AccumuloPcjStorageConfig.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/accumulo/AccumuloPcjStorageConfig.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/accumulo/AccumuloPcjStorageConfig.java
index 6c82ee0..096dc13 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/accumulo/AccumuloPcjStorageConfig.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/accumulo/AccumuloPcjStorageConfig.java
@@ -21,9 +21,8 @@ package org.apache.rya.indexing.external.accumulo;
import static com.google.common.base.Preconditions.checkNotNull;
import org.apache.hadoop.conf.Configuration;
-import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
-
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
/**
* Configuration values required to initialize a {@link AccumuloPcjStorage}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/fluo/FluoPcjUpdaterConfig.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/fluo/FluoPcjUpdaterConfig.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/fluo/FluoPcjUpdaterConfig.java
index ee8c295..528cb15 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/fluo/FluoPcjUpdaterConfig.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/fluo/FluoPcjUpdaterConfig.java
@@ -20,11 +20,10 @@ package org.apache.rya.indexing.external.fluo;
import static com.google.common.base.Preconditions.checkNotNull;
+import org.apache.hadoop.conf.Configuration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.apache.hadoop.conf.Configuration;
-
import com.google.common.base.Optional;
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcher.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcher.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcher.java
index 0f34030..0cf1ebc 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcher.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcher.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,58 +17,20 @@
* under the License.
*/
package org.apache.rya.indexing.external.matching;
-/*
- * 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.
- */
import java.util.ArrayList;
-
-/*
- * 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.
- */
-
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes;
-import org.openrdf.query.algebra.BinaryTupleOperator;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
/**
* This class provides implementations of methods common to all implementations
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcherFactory.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcherFactory.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcherFactory.java
index ca7ede4..099b08c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcherFactory.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetMatcherFactory.java
@@ -36,9 +36,9 @@ package org.apache.rya.indexing.external.matching;
* under the License.
*/
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
/**
* This class takes in a given {@link Join}, {@Filter}, or {@link LeftJoin}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetOptimizer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetOptimizer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetOptimizer.java
index 9ba40fd..9c420e7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetOptimizer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractExternalSetOptimizer.java
@@ -24,18 +24,18 @@ import java.util.Set;
import org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes;
import org.apache.rya.indexing.pcj.matching.PCJOptimizerUtilities;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.Dataset;
-import org.openrdf.query.algebra.BinaryTupleOperator;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.UnaryTupleOperator;
-import org.openrdf.query.algebra.evaluation.QueryOptimizer;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.Dataset;
+import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.UnaryTupleOperator;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
import com.google.common.base.Optional;
@@ -67,7 +67,7 @@ public abstract class AbstractExternalSetOptimizer<T extends ExternalSet> implem
* the nodes returned by {@link ExternalSetMatcher#getUnmatchedArgs()}.
*
*/
- protected class QuerySegmentMatchVisitor extends QueryModelVisitorBase<RuntimeException> {
+ protected class QuerySegmentMatchVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private final QuerySegmentFactory<T> factory = new QuerySegmentFactory<T>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractQuerySegment.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractQuerySegment.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractQuerySegment.java
index 49f39f4..18a36fa 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractQuerySegment.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/AbstractQuerySegment.java
@@ -28,10 +28,10 @@ import java.util.Map;
import java.util.Set;
import org.apache.rya.indexing.external.matching.QueryNodesToTupleExpr.TupleExprAndNodes;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/BasicRater.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/BasicRater.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/BasicRater.java
index 6166d8a..f61fd3f 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/BasicRater.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/BasicRater.java
@@ -40,13 +40,14 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
+import org.apache.rya.api.domain.VarNameUtils;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+
/**
* This implementation of the QueryNodeListRater assigns a score to a specified
* list between and 0 and 1, where the lower the score, the better the list. It
@@ -84,7 +85,7 @@ public class BasicRater implements QueryNodeListRater {
TupleExpr tup = (TupleExpr) node;
Set<String> bindingNames = tup.getAssuredBindingNames();
for (String name : bindingNames) {
- if (!name.startsWith("-const-")) {
+ if (!VarNameUtils.isConstant(name)) {
commonVarBin.put(name, i);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetConverter.java
index 900e6a8..d3e0ff2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetConverter.java
@@ -36,7 +36,7 @@ package org.apache.rya.indexing.external.matching;
* under the License.
*/
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
public interface ExternalSetConverter<T extends ExternalSet> {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetMatcher.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetMatcher.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetMatcher.java
index 5456bed..c90d95c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetMatcher.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetMatcher.java
@@ -1,4 +1,3 @@
-package org.apache.rya.indexing.external.matching;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,7 +7,7 @@ package org.apache.rya.indexing.external.matching;
* "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
+ * 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
@@ -17,38 +16,19 @@ package org.apache.rya.indexing.external.matching;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.external.matching;
import java.util.Collection;
import java.util.Iterator;
-
-/*
- * 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.
- */
-
import java.util.List;
import java.util.Set;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetProvider.java
index e2d6b34..a9f31c6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/ExternalSetProvider.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -17,29 +17,11 @@
* under the License.
*/
package org.apache.rya.indexing.external.matching;
-/*
- * 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.
- */
import java.util.Iterator;
import java.util.List;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
/**
* Interface for extracting {@link ExternalSet}s from specified {@link QuerySegment}s.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/FlattenedOptional.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/FlattenedOptional.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/FlattenedOptional.java
index a0cbdb8..d975753 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/FlattenedOptional.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/FlattenedOptional.java
@@ -24,17 +24,17 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.LeftJoin;
-import org.openrdf.query.algebra.QueryModelNodeBase;
-import org.openrdf.query.algebra.QueryModelVisitor;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.LeftJoin;
+import org.eclipse.rdf4j.query.algebra.QueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
import com.google.common.collect.Sets;
@@ -51,7 +51,7 @@ import com.google.common.collect.Sets;
* bound and unbound variables do not change.
*
*/
-public class FlattenedOptional extends QueryModelNodeBase implements TupleExpr {
+public class FlattenedOptional extends AbstractQueryModelNode implements TupleExpr {
private Set<TupleExpr> rightArgs;
private Set<String> boundVars;
@@ -124,11 +124,7 @@ public class FlattenedOptional extends QueryModelNodeBase implements TupleExpr {
// unbound vars
if (te instanceof FlattenedOptional) {
FlattenedOptional lj = (FlattenedOptional) te;
- if (Sets.intersection(lj.rightArg.getBindingNames(), unboundVars).size() > 0) {
- return false;
- } else {
- return true;
- }
+ return Sets.intersection(lj.rightArg.getBindingNames(), unboundVars).size() <= 0;
}
return Sets.intersection(te.getBindingNames(), unboundVars).size() == 0;
@@ -246,11 +242,7 @@ public class FlattenedOptional extends QueryModelNodeBase implements TupleExpr {
// unbound vars
if (te instanceof FlattenedOptional) {
FlattenedOptional lj = (FlattenedOptional) te;
- if (Sets.intersection(lj.getRightArg().getBindingNames(), unboundVars).size() > 0) {
- return false;
- } else {
- return true;
- }
+ return Sets.intersection(lj.getRightArg().getBindingNames(), unboundVars).size() <= 0;
}
Set<String> vars = te.getBindingNames();
Set<String> intersection = Sets.intersection(vars, boundVars);
@@ -267,9 +259,9 @@ public class FlattenedOptional extends QueryModelNodeBase implements TupleExpr {
private void incrementVarCounts(Set<String> vars) {
for (String s : vars) {
- if (!s.startsWith("-const-") && leftArgVarCounts.containsKey(s)) {
+ if (!VarNameUtils.isConstant(s) && leftArgVarCounts.containsKey(s)) {
leftArgVarCounts.put(s, leftArgVarCounts.get(s) + 1);
- } else if (!s.startsWith("-const-")) {
+ } else if (!VarNameUtils.isConstant(s)) {
leftArgVarCounts.put(s, 1);
}
}
@@ -295,7 +287,7 @@ public class FlattenedOptional extends QueryModelNodeBase implements TupleExpr {
private Set<String> setWithOutConstants(Set<String> vars) {
Set<String> copy = new HashSet<>();
for (String s : vars) {
- if (!s.startsWith("-const-")) {
+ if (!VarNameUtils.isConstant(s)) {
copy.add(s);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegment.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegment.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegment.java
index 9d97b32..5a700a7 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegment.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/matching/JoinSegment.java
@@ -1,4 +1,3 @@
-package org.apache.rya.indexing.external.matching;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,7 +7,7 @@ package org.apache.rya.indexing.external.matching;
* "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
+ * 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
@@ -17,41 +16,22 @@ package org.apache.rya.indexing.external.matching;
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.rya.indexing.external.matching;
import java.util.ArrayList;
import java.util.HashMap;
-
-/*
- * 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.
- */
-
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.rya.rdftriplestore.inference.DoNotExpandSP;
import org.apache.rya.rdftriplestore.utils.FixedStatementPattern;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.Join;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.impl.ExternalSet;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.Join;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.ExternalSet;
import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
[45/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java
index f539e7c..a7c988b 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Type.java
@@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Objects;
import org.apache.http.annotation.Immutable;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.storage.TypeStorage;
import com.google.common.collect.ImmutableSet;
@@ -51,12 +51,12 @@ public class Type {
/**
* Uniquely identifies the Type within a {@link TypeStorage}.
*/
- private final RyaURI id;
+ private final RyaIRI id;
/**
* The names of {@link Property}s that may be part of an {@link TypedEntity} of this type.
*/
- private final ImmutableSet<RyaURI> propertyNames;
+ private final ImmutableSet<RyaIRI> propertyNames;
/**
* Constructs an instance of {@link Type}.
@@ -64,7 +64,7 @@ public class Type {
* @param id - Uniquely identifies the Type within a {@link TypeStorage}. (not null)
* @param propertyNames - The names of {@link Property}s that may be part of an {@link TypedEntity} of this type. (not null)
*/
- public Type(final RyaURI id, final ImmutableSet<RyaURI> propertyNames) {
+ public Type(final RyaIRI id, final ImmutableSet<RyaIRI> propertyNames) {
this.id = requireNonNull(id);
this.propertyNames = requireNonNull(propertyNames);
}
@@ -72,14 +72,14 @@ public class Type {
/**
* @return Uniquely identifies the Type within a {@link TypeStorage}.
*/
- public RyaURI getId() {
+ public RyaIRI getId() {
return id;
}
/**
* @return The names of {@link Property}s that may be part of an {@link TypedEntity} of this type.
*/
- public ImmutableSet<RyaURI> getPropertyNames() {
+ public ImmutableSet<RyaIRI> getPropertyNames() {
return propertyNames;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java
index 0d019c2..816e7fa 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/TypedEntity.java
@@ -27,7 +27,7 @@ import java.util.Optional;
import org.apache.http.annotation.Immutable;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap;
@@ -47,12 +47,12 @@ public class TypedEntity {
/**
* The Subject of the {@link Entity} this view was derived from.
*/
- private final RyaURI subject;
+ private final RyaIRI subject;
/**
* The ID of the {@link Type} that defines the structure of this TypedEntity.
*/
- private final RyaURI typeId;
+ private final RyaIRI typeId;
/**
* {@code true} if the Entity's Type has been explicitly set to the {@link #typeId}
@@ -66,7 +66,7 @@ public class TypedEntity {
* </p>
* They are mapped from property name to property object for quick lookup.
*/
- private final ImmutableMap<RyaURI, Property> optionalFields;
+ private final ImmutableMap<RyaIRI, Property> optionalFields;
/**
* Constructs an instance of {@link TypedEntity}.
@@ -78,10 +78,10 @@ public class TypedEntity {
* it has properties that happen to match that type's properties).
* @param properties - The optional {@link Property} values of this {@link TypedEntity}. (not null)
*/
- private TypedEntity(final RyaURI subject,
- final RyaURI dataTypeId,
+ private TypedEntity(final RyaIRI subject,
+ final RyaIRI dataTypeId,
final boolean explicitlyTyped,
- final ImmutableMap<RyaURI, Property> optionalFields) {
+ final ImmutableMap<RyaIRI, Property> optionalFields) {
this.subject = requireNonNull(subject);
typeId = requireNonNull(dataTypeId);
this.optionalFields = requireNonNull(optionalFields);
@@ -91,14 +91,14 @@ public class TypedEntity {
/**
* @return The Subject of the {@link Entity} this view was derived from.
*/
- public RyaURI getSubject() {
+ public RyaIRI getSubject() {
return subject;
}
/**
* @return The ID of the {@link Type} that defines the structure of this Entity.
*/
- public RyaURI getTypeId() {
+ public RyaIRI getTypeId() {
return typeId;
}
@@ -125,7 +125,7 @@ public class TypedEntity {
* @param propertyName - The name of {@link Property} that may be in this Entity. (not null)
* @return The value of the Property if it has been set.
*/
- public Optional<RyaType> getPropertyValue(final RyaURI propertyName) {
+ public Optional<RyaType> getPropertyValue(final RyaIRI propertyName) {
requireNonNull(propertyName);
final Property field = optionalFields.get(propertyName);
@@ -184,16 +184,16 @@ public class TypedEntity {
@DefaultAnnotation(NonNull.class)
public static class Builder {
- private RyaURI subject;
- private RyaURI typeId;
+ private RyaIRI subject;
+ private RyaIRI typeId;
private boolean explicitlyTyped = false;
- private final Map<RyaURI, Property> properties = new HashMap<>();
+ private final Map<RyaIRI, Property> properties = new HashMap<>();
/**
* @param subject - The Subject of the {@link Entity} this view was derived from.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setId(@Nullable final RyaURI subject) {
+ public Builder setId(@Nullable final RyaIRI subject) {
this.subject = subject;
return this;
}
@@ -202,7 +202,7 @@ public class TypedEntity {
* @param typeId - The ID of the {@link Type} that defines the structure of this Entity.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setTypeId(@Nullable final RyaURI typeId) {
+ public Builder setTypeId(@Nullable final RyaIRI typeId) {
this.typeId = typeId;
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
index 70efc3a..7102e63 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/query/EntityQueryNode.java
@@ -31,7 +31,7 @@ import java.util.Set;
import java.util.function.Consumer;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
@@ -73,9 +73,9 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
private static final Logger LOG = LoggerFactory.getLogger(EntityQueryNode.class);
/**
- * The RyaURI that when used as the Predicate of a Statement Pattern indicates the Type of the Entities.
+ * The {@link RyaIRI} that when used as the Predicate of a Statement Pattern indicates the Type of the Entities.
*/
- private static final RyaURI TYPE_ID_URI = new RyaURI(RDF.TYPE.toString());
+ private static final RyaIRI TYPE_ID_IRI = new RyaIRI(RDF.TYPE.toString());
// Provided at construction time.
private final Type type;
@@ -91,7 +91,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
private final Set<String> bindingNames;
// Information about the objects of the patterns.
- private final ImmutableMap<RyaURI, Var> objectVariables;
+ private final ImmutableMap<RyaIRI, Var> objectVariables;
// Properties of the Type found in the query
private final Set<Property> properties;
@@ -133,17 +133,17 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
}
// Any constant that appears in the Object portion of the SP will be used to make sure they match.
- final Builder<RyaURI, Var> builder = ImmutableMap.builder();
+ final Builder<RyaIRI, Var> builder = ImmutableMap.builder();
for(final StatementPattern sp : patterns) {
final Var object = sp.getObjectVar();
final Var pred = sp.getPredicateVar();
- final RyaURI predURI = new RyaURI(pred.getValue().stringValue());
+ final RyaIRI predIRI = new RyaIRI(pred.getValue().stringValue());
bindingNames.addAll(sp.getBindingNames());
if(object.isConstant() && !pred.getValue().equals(RDF.TYPE)) {
final RyaType propertyType = RdfToRyaConversions.convertValue(object.getValue());
- properties.add(new Property(predURI, propertyType));
+ properties.add(new Property(predIRI, propertyType));
}
- builder.put(predURI, object);
+ builder.put(predIRI, object);
}
objectVariables = builder.build();
}
@@ -209,10 +209,10 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
boolean typeFound = false;
for(final StatementPattern pattern : patterns) {
- final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString());
+ final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString());
- if(predicate.equals(TYPE_ID_URI)) {
- final RyaURI typeId = new RyaURI( pattern.getObjectVar().getValue().stringValue() );
+ if(predicate.equals(TYPE_ID_IRI)) {
+ final RyaIRI typeId = new RyaIRI( pattern.getObjectVar().getValue().stringValue() );
if(typeId.equals(type.getId())) {
typeFound = true;
} else {
@@ -241,8 +241,8 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
for(final StatementPattern pattern : patterns) {
// Skip TYPE patterns.
- final RyaURI predicate = new RyaURI( pattern.getPredicateVar().getValue().toString() );
- if(predicate.equals(TYPE_ID_URI)) {
+ final RyaIRI predicate = new RyaIRI( pattern.getPredicateVar().getValue().toString() );
+ if(predicate.equals(TYPE_ID_IRI)) {
continue;
}
@@ -283,7 +283,7 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
if(subjectIsConstant) {
// if it is, fetch that value and then fetch the entity for the subject.
subj = subjectConstant.get();
- entitiesCursor = entities.search(Optional.of(new RyaURI(subj)), type, properties);
+ entitiesCursor = entities.search(Optional.of(new RyaIRI(subj)), type, properties);
} else {
entitiesCursor = entities.search(Optional.empty(), type, properties);
}
@@ -292,8 +292,8 @@ public class EntityQueryNode extends ExternalSet implements ExternalBatchingIter
final TypedEntity typedEntity = entitiesCursor.next();
final ImmutableCollection<Property> properties = typedEntity.getProperties();
//ensure properties match and only add properties that are in the statement patterns to the binding set
- for(final RyaURI key : objectVariables.keySet()) {
- final Optional<RyaType> prop = typedEntity.getPropertyValue(new RyaURI(key.getData()));
+ for(final RyaIRI key : objectVariables.keySet()) {
+ final Optional<RyaType> prop = typedEntity.getPropertyValue(new RyaIRI(key.getData()));
if(prop.isPresent()) {
final RyaType type = prop.get();
final String bindingName = objectVariables.get(key).getName();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java
index 6f0b9ae..22dad92 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/EntityStorage.java
@@ -21,7 +21,7 @@ package org.apache.rya.indexing.entity.storage;
import java.util.Optional;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -42,13 +42,13 @@ public interface EntityStorage extends RyaObjectStorage<Entity> {
* Search the stored {@link Entity}s that have a specific {@link Type} as
* well as the provided {@link Property} values.
*
- * @param subject - The {@link RyaURI} subject of the Entity. (Optional)
+ * @param subject - The {@link RyaIRI} subject of the Entity. (Optional)
* @param type - The {@link Type} of the Entities. (not null)
* @param properties - The {@link Property} values that must be set on the Entity. (not null)
* @return A {@link CloseableIterator} over the {@link TypedEntity}s that match the search parameters.
* @throws EntityStorageException A problem occurred while searching the storage.
*/
- public ConvertingCursor<TypedEntity> search(final Optional<RyaURI> subject, Type type, Set<Property> properties) throws EntityStorageException;
+ public ConvertingCursor<TypedEntity> search(final Optional<RyaIRI> subject, Type type, Set<Property> properties) throws EntityStorageException;
/**
* Indicates a problem while interacting with an {@link EntityStorage}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java
index 31b1790..5a23044 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/TypeStorage.java
@@ -20,7 +20,7 @@ package org.apache.rya.indexing.entity.storage;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.EntityIndexException;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.storage.mongo.ConvertingCursor;
@@ -49,7 +49,7 @@ public interface TypeStorage {
* @return The {@link Type} if one exists for the ID.
* @throws TypeStorageException A problem occurred while fetching from the storage.
*/
- public Optional<Type> get(RyaURI typeId) throws TypeStorageException;
+ public Optional<Type> get(RyaIRI typeId) throws TypeStorageException;
/**
* Get all {@link Type}s that include a specific {@link Property} name.
@@ -59,7 +59,7 @@ public interface TypeStorage {
* @throws TypeStorageException A problem occurred while searching for the Types
* that have the Property name.
*/
- public ConvertingCursor<Type> search(RyaURI propertyName) throws TypeStorageException;
+ public ConvertingCursor<Type> search(RyaIRI propertyName) throws TypeStorageException;
/**
* Deletes a {@link Type} from the storage.
@@ -68,7 +68,7 @@ public interface TypeStorage {
* @return {@code true} if something was deleted; otherwise {@code false}.
* @throws TypeStorageException A problem occurred while deleting from the storage.
*/
- public boolean delete(RyaURI typeId) throws TypeStorageException;
+ public boolean delete(RyaIRI typeId) throws TypeStorageException;
/**
* A problem occurred while interacting with a {@link TypeStorage}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
index 7333de1..5d1a1a6 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/EntityDocumentConverter.java
@@ -24,7 +24,7 @@ import java.util.List;
import java.util.stream.Collectors;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.storage.mongo.key.MongoDbSafeKey;
@@ -60,7 +60,7 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> {
.collect(Collectors.toList()));
final Document propertiesDoc = new Document();
- for(final RyaURI typeId : entity.getProperties().keySet()) {
+ for(final RyaIRI typeId : entity.getProperties().keySet()) {
final Document typePropertiesDoc = new Document();
entity.getProperties().get(typeId)
.forEach((propertyNameUri, property) -> {
@@ -112,10 +112,10 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> {
// Perform the conversion.
final Entity.Builder builder = Entity.builder()
- .setSubject( new RyaURI(document.getString(SUBJECT)) );
+ .setSubject( new RyaIRI(document.getString(SUBJECT)) );
((List<String>)document.get(EXPLICIT_TYPE_IDS)).stream()
- .forEach(explicitTypeId -> builder.setExplicitType(new RyaURI(explicitTypeId)));
+ .forEach(explicitTypeId -> builder.setExplicitType(new RyaIRI(explicitTypeId)));
final Document propertiesDoc = (Document) document.get(PROPERTIES);
for(final String typeId : propertiesDoc.keySet()) {
@@ -124,7 +124,7 @@ public class EntityDocumentConverter implements DocumentConverter<Entity> {
final String decodedPropertyName = MongoDbSafeKey.decodeKey(propertyName);
final Document value = (Document) typePropertiesDoc.get(propertyName);
final RyaType propertyValue = ryaTypeConverter.fromDocument( value );
- builder.setProperty(new RyaURI(typeId), new Property(new RyaURI(decodedPropertyName), propertyValue));
+ builder.setProperty(new RyaIRI(typeId), new Property(new RyaIRI(decodedPropertyName), propertyValue));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java
index 87634d7..63a0046 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoEntityStorage.java
@@ -31,7 +31,7 @@ import java.util.stream.Stream;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.log4j.Logger;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -175,7 +175,7 @@ public class MongoEntityStorage implements EntityStorage {
}
@Override
- public Optional<Entity> get(final RyaURI subject) throws EntityStorageException {
+ public Optional<Entity> get(final RyaIRI subject) throws EntityStorageException {
requireNonNull(subject);
try {
@@ -194,7 +194,7 @@ public class MongoEntityStorage implements EntityStorage {
}
@Override
- public ConvertingCursor<TypedEntity> search(final Optional<RyaURI> subject, final Type type, final Set<Property> properties) throws EntityStorageException {
+ public ConvertingCursor<TypedEntity> search(final Optional<RyaIRI> subject, final Type type, final Set<Property> properties) throws EntityStorageException {
requireNonNull(type);
requireNonNull(properties);
@@ -238,7 +238,7 @@ public class MongoEntityStorage implements EntityStorage {
}
@Override
- public boolean delete(final RyaURI subject) throws EntityStorageException {
+ public boolean delete(final RyaIRI subject) throws EntityStorageException {
requireNonNull(subject);
try {
@@ -253,7 +253,7 @@ public class MongoEntityStorage implements EntityStorage {
}
}
- private static Bson makeSubjectFilter(final RyaURI subject) {
+ private static Bson makeSubjectFilter(final RyaIRI subject) {
return Filters.eq(EntityDocumentConverter.SUBJECT, subject.getData());
}
@@ -261,11 +261,11 @@ public class MongoEntityStorage implements EntityStorage {
return Filters.eq(EntityDocumentConverter.VERSION, version);
}
- private static Bson makeExplicitTypeFilter(final RyaURI typeId) {
+ private static Bson makeExplicitTypeFilter(final RyaIRI typeId) {
return Filters.eq(EntityDocumentConverter.EXPLICIT_TYPE_IDS, typeId.getData());
}
- private static Stream<Bson> makePropertyFilters(final RyaURI typeId, final Property property) {
+ private static Stream<Bson> makePropertyFilters(final RyaIRI typeId, final Property property) {
final String propertyName = property.getName().getData();
final String encodedPropertyName = MongoDbSafeKey.encodeKey(propertyName);
@@ -310,21 +310,21 @@ public class MongoEntityStorage implements EntityStorage {
/**
* Searches the Entity storage for all Entities that contain all the
* specified explicit type IDs.
- * @param explicitTypeIds the {@link ImmutableList} of {@link RyaURI}s that
+ * @param explicitTypeIds the {@link ImmutableList} of {@link RyaIRI}s that
* are being searched for.
* @return the {@link List} of {@link Entity}s that have all the specified
* explicit type IDs. If nothing was found an empty {@link List} is
* returned.
* @throws EntityStorageException
*/
- private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaURI> explicitTypeIds) throws EntityStorageException {
+ private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaIRI> explicitTypeIds) throws EntityStorageException {
final List<Entity> hasAllExplicitTypesEntities = new ArrayList<>();
if (!explicitTypeIds.isEmpty()) {
// Grab the first type from the explicit type IDs.
- final RyaURI firstType = explicitTypeIds.get(0);
+ final RyaIRI firstType = explicitTypeIds.get(0);
// Check if that type exists anywhere in storage.
- final List<RyaURI> subjects = new ArrayList<>();
+ final List<RyaIRI> subjects = new ArrayList<>();
Optional<Type> type;
try {
if (mongoTypeStorage == null) {
@@ -339,13 +339,13 @@ public class MongoEntityStorage implements EntityStorage {
final ConvertingCursor<TypedEntity> cursor = search(Optional.empty(), type.get(), Collections.emptySet());
while (cursor.hasNext()) {
final TypedEntity typedEntity = cursor.next();
- final RyaURI subject = typedEntity.getSubject();
+ final RyaIRI subject = typedEntity.getSubject();
subjects.add(subject);
}
}
// Now grab all the Entities that have the subjects we found.
- for (final RyaURI subject : subjects) {
+ for (final RyaIRI subject : subjects) {
final Optional<Entity> entityFromSubject = get(subject);
if (entityFromSubject.isPresent()) {
final Entity candidateEntity = entityFromSubject.get();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java
index 0083671..d0aa2fc 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/MongoTypeStorage.java
@@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.storage.TypeStorage;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
@@ -83,7 +83,7 @@ public class MongoTypeStorage implements TypeStorage {
}
@Override
- public Optional<Type> get(final RyaURI typeId) throws TypeStorageException {
+ public Optional<Type> get(final RyaIRI typeId) throws TypeStorageException {
requireNonNull(typeId);
try {
@@ -102,7 +102,7 @@ public class MongoTypeStorage implements TypeStorage {
}
@Override
- public ConvertingCursor<Type> search(final RyaURI propertyName) throws TypeStorageException {
+ public ConvertingCursor<Type> search(final RyaIRI propertyName) throws TypeStorageException {
requireNonNull(propertyName);
try {
@@ -128,7 +128,7 @@ public class MongoTypeStorage implements TypeStorage {
}
@Override
- public boolean delete(final RyaURI typeId) throws TypeStorageException {
+ public boolean delete(final RyaIRI typeId) throws TypeStorageException {
requireNonNull(typeId);
try {
@@ -143,7 +143,7 @@ public class MongoTypeStorage implements TypeStorage {
}
}
- private static Bson makeIdFilter(final RyaURI typeId) {
+ private static Bson makeIdFilter(final RyaIRI typeId) {
return Filters.eq(TypeDocumentConverter.ID, typeId.getData());
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java
index 37c65bb..1f072e2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/storage/mongo/TypeDocumentConverter.java
@@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull;
import java.util.ArrayList;
import java.util.List;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Type;
import org.bson.Document;
@@ -69,11 +69,11 @@ public class TypeDocumentConverter implements DocumentConverter<Type> {
"' because its '" + PROPERTY_NAMES + "' field is missing.");
}
- final RyaURI typeId = new RyaURI( document.getString(ID) );
+ final RyaIRI typeId = new RyaIRI( document.getString(ID) );
- final ImmutableSet.Builder<RyaURI> propertyNames = ImmutableSet.builder();
+ final ImmutableSet.Builder<RyaIRI> propertyNames = ImmutableSet.builder();
((List<String>) document.get(PROPERTY_NAMES))
- .forEach(propertyName -> propertyNames.add(new RyaURI(propertyName)));
+ .forEach(propertyName -> propertyNames.add(new RyaIRI(propertyName)));
return new Type(typeId, propertyNames.build());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
index 26247a6..c495e17 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/BaseEntityIndexer.java
@@ -37,7 +37,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -68,7 +68,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
/**
* When this IRI is the Predicate of a Statement, it indicates a {@link Type} for an {@link Entity}.
*/
- private static final RyaURI TYPE_URI = new RyaURI( RDF.TYPE.toString() );
+ private static final RyaIRI TYPE_IRI = new RyaIRI( RDF.TYPE.toString() );
protected final AtomicReference<StatefulMongoDBRdfConfiguration> configuration = new AtomicReference<>();
private final AtomicReference<EntityStorage> entities = new AtomicReference<>();
@@ -108,10 +108,10 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
public void storeStatements(final Collection<RyaStatement> statements) throws IOException {
requireNonNull(statements);
- final Map<RyaURI,List<RyaStatement>> groupedBySubject = statements.stream()
+ final Map<RyaIRI,List<RyaStatement>> groupedBySubject = statements.stream()
.collect(groupingBy(RyaStatement::getSubject));
- for(final Entry<RyaURI, List<RyaStatement>> entry : groupedBySubject.entrySet()) {
+ for(final Entry<RyaIRI, List<RyaStatement>> entry : groupedBySubject.entrySet()) {
try {
updateEntity(entry.getKey(), entry.getValue());
} catch (final IndexingException e) {
@@ -127,7 +127,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
* @param statements - Statements that the {@link Entity} will be updated with. (not null)
* @throws IndexingException
*/
- private void updateEntity(final RyaURI subject, final Collection<RyaStatement> statements) throws IndexingException {
+ private void updateEntity(final RyaIRI subject, final Collection<RyaStatement> statements) throws IndexingException {
requireNonNull(subject);
requireNonNull(statements);
@@ -153,20 +153,20 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
for(final RyaStatement statement : statements) {
// The Statement is setting an Explicit Type ID for the Entity.
- if(Objects.equal(TYPE_URI, statement.getPredicate())) {
- final RyaURI typeId = new RyaURI(statement.getObject().getData());
+ if(Objects.equal(TYPE_IRI, statement.getPredicate())) {
+ final RyaIRI typeId = new RyaIRI(statement.getObject().getData());
updated.setExplicitType(typeId);
}
// The Statement is adding a Property to the Entity.
else {
- final RyaURI propertyName = statement.getPredicate();
+ final RyaIRI propertyName = statement.getPredicate();
final RyaType propertyValue = statement.getObject();
try(final ConvertingCursor<Type> typesIt = types.search(propertyName)) {
// Set the Property for each type that includes the Statement's predicate.
while(typesIt.hasNext()) {
- final RyaURI typeId = typesIt.next().getId();
+ final RyaIRI typeId = typesIt.next().getId();
updated.setProperty(typeId, new Property(propertyName, propertyValue));
}
} catch (final TypeStorageException | IOException e) {
@@ -202,9 +202,9 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
final Entity.Builder updated = Entity.builder(oldEntity);
updated.setVersion(oldEntity.getVersion() + 1);
- if(TYPE_URI.equals(statement.getPredicate())) {
+ if(TYPE_IRI.equals(statement.getPredicate())) {
// If the Type ID already isn't in the list of explicit types, then do nothing.
- final RyaURI typeId = new RyaURI( statement.getObject().getData() );
+ final RyaIRI typeId = new RyaIRI( statement.getObject().getData() );
if(!oldEntity.getExplicitTypeIds().contains(typeId)) {
return Optional.empty();
}
@@ -213,11 +213,11 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
updated.unsetExplicitType(typeId);
} else {
// If the deleted property appears within the old entity's properties, then remove it.
- final RyaURI deletedPropertyName = statement.getPredicate();
+ final RyaIRI deletedPropertyName = statement.getPredicate();
boolean propertyWasPresent = false;
- for(final RyaURI typeId : oldEntity.getProperties().keySet()) {
- for(final RyaURI propertyName : oldEntity.getProperties().get(typeId).keySet()) {
+ for(final RyaIRI typeId : oldEntity.getProperties().keySet()) {
+ for(final RyaIRI propertyName : oldEntity.getProperties().get(typeId).keySet()) {
if(deletedPropertyName.equals(propertyName)) {
propertyWasPresent = true;
updated.unsetProperty(typeId, deletedPropertyName);
@@ -255,7 +255,7 @@ public abstract class BaseEntityIndexer implements EntityIndexer, MongoSecondary
}
@Override
- public void dropGraph(final RyaURI... graphs) {
+ public void dropGraph(final RyaIRI... graphs) {
// We do not support graphs when performing entity centric indexing.
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java
index 91f1146..6bc3680 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/update/EntityUpdater.java
@@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.storage.EntityStorage;
import org.apache.rya.indexing.entity.storage.EntityStorage.EntityStorageException;
@@ -36,7 +36,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
* Performs update operations over an {@link EntityStorage}.
*/
@DefaultAnnotation(NonNull.class)
-public class EntityUpdater implements MongoDocumentUpdater<RyaURI, Entity>{
+public class EntityUpdater implements MongoDocumentUpdater<RyaIRI, Entity>{
private final EntityStorage storage;
@@ -68,7 +68,7 @@ public class EntityUpdater implements MongoDocumentUpdater<RyaURI, Entity>{
}
@Override
- public Optional<Entity> getOld(final RyaURI key) throws EntityStorageException {
+ public Optional<Entity> getOld(final RyaIRI key) throws EntityStorageException {
try {
return storage.get(key);
} catch (final ObjectStorageException e) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
index c2086d2..97c5ec2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/external/PrecomputedJoinIndexer.java
@@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
import org.apache.rya.accumulo.experimental.AbstractAccumuloIndexer;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.log.LogUtils;
import org.apache.rya.api.persist.RyaDAO;
import org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier;
@@ -260,7 +260,7 @@ public class PrecomputedJoinIndexer extends AbstractAccumuloIndexer {
}
@Override
- public void dropGraph(final RyaURI... graphs) {
+ public void dropGraph(final RyaIRI... graphs) {
log.warn("PCJ indices do not store Graph metadata, so graph results can not be dropped.");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
index 36839b3..7f4a0bd 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java
@@ -27,7 +27,7 @@ import java.util.Set;
import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.StatementConstraints;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
@@ -182,7 +182,7 @@ public abstract class AbstractMongoIndexer<T extends IndexingMongoDBStorageStrat
}
@Override
- public void dropGraph(final RyaURI... graphs) {
+ public void dropGraph(final RyaIRI... graphs) {
throw new UnsupportedOperationException();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
index f392b5e..17e32c3 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/MongoDbSmartUri.java
@@ -26,7 +26,7 @@ import java.util.Optional;
import java.util.Set;
import org.apache.hadoop.conf.Configuration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -64,7 +64,7 @@ public class MongoDbSmartUri implements SmartUriStorage {
}
@Override
- public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException {
+ public void storeEntity(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException {
checkInit();
final IRI uri = SmartUriAdapter.serializeUri(subject, map);
@@ -103,7 +103,7 @@ public class MongoDbSmartUri implements SmartUriStorage {
}
@Override
- public Entity queryEntity(final RyaURI subject) throws SmartUriException {
+ public Entity queryEntity(final RyaIRI subject) throws SmartUriException {
checkInit();
// Query it.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java
index bd04368..c420fba 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/update/RyaObjectStorage.java
@@ -20,12 +20,12 @@ package org.apache.rya.indexing.mongodb.update;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.mongodb.IndexingException;
/**
* Stores and provides access to objects of type T.
- * The RyaURI subject is the primary storage key used.
+ * The {@link RyaIRI} subject is the primary storage key used.
* @param <T> - The type of object to store/access.
*/
public interface RyaObjectStorage<T> {
@@ -46,7 +46,7 @@ public interface RyaObjectStorage<T> {
* @return The Object if one exists for the subject.
* @throws ObjectStorageException A problem occurred while fetching the Object from the storage.
*/
- public Optional<T> get(RyaURI subject) throws ObjectStorageException;
+ public Optional<T> get(RyaIRI subject) throws ObjectStorageException;
/**
* Update the state of an {@link RyaObjectStorage#T}.
@@ -65,7 +65,7 @@ public interface RyaObjectStorage<T> {
* @return {@code true} if something was deleted; otherwise {@code false}.
* @throws ObjectStorageException A problem occurred while deleting from the storage.
*/
- public boolean delete(RyaURI subject) throws ObjectStorageException;
+ public boolean delete(RyaIRI subject) throws ObjectStorageException;
/**
* Indicates a problem while interacting with an {@link RyaObjectStorage}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
index d46d310..21d5ea5 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriAdapter.java
@@ -36,7 +36,7 @@ import org.apache.http.client.utils.URIBuilder;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.entity.model.Entity;
@@ -71,11 +71,11 @@ public class SmartUriAdapter {
private SmartUriAdapter() {
}
- private static IRI createTypePropertiesUri(final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties) throws SmartUriException {
+ private static IRI createTypePropertiesUri(final ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperties) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
- for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> typeProperty : typeProperties.entrySet()) {
- final RyaURI type = typeProperty.getKey();
- final Map<RyaURI, Property> propertyMap = typeProperty.getValue();
+ for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperty : typeProperties.entrySet()) {
+ final RyaIRI type = typeProperty.getKey();
+ final Map<RyaIRI, Property> propertyMap = typeProperty.getValue();
final IRI typeUri = createIndividualTypeWithPropertiesUri(type, propertyMap);
final String keyString = type.getDataType().getLocalName();
final String valueString = typeUri.getLocalName();
@@ -97,7 +97,7 @@ public class SmartUriAdapter {
return VF.createIRI(uriString);
}
- private static String getShortNameForType(final RyaURI type) throws SmartUriException {
+ private static String getShortNameForType(final RyaIRI type) throws SmartUriException {
final String shortName = VF.createIRI(type.getData()).getLocalName();
return shortName;
}
@@ -118,18 +118,18 @@ public class SmartUriAdapter {
return formattedUriString;
}
- private static Map<RyaURI, String> createTypeMap(final List<RyaURI> types) throws SmartUriException {
- final Map<RyaURI, String> map = new LinkedHashMap<>();
- for (final RyaURI type : types) {
+ private static Map<RyaIRI, String> createTypeMap(final List<RyaIRI> types) throws SmartUriException {
+ final Map<RyaIRI, String> map = new LinkedHashMap<>();
+ for (final RyaIRI type : types) {
final String shortName = getShortNameForType(type);
map.put(type, shortName);
}
return map;
}
- private static IRI createTypeMapUri(final List<RyaURI> types) throws SmartUriException {
+ private static IRI createTypeMapUri(final List<RyaIRI> types) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
- for (final RyaURI type : types) {
+ for (final RyaIRI type : types) {
final String shortName = getShortNameForType(type);
nameValuePairs.add(new BasicNameValuePair(type.getData(), shortName));
}
@@ -149,11 +149,11 @@ public class SmartUriAdapter {
return VF.createIRI(uriString);
}
- private static Map<RyaURI, String> convertUriToTypeMap(final IRI typeMapUri) throws SmartUriException {
- final Map<RyaURI, String> map = new HashMap<>();
+ private static Map<RyaIRI, String> convertIriToTypeMap(final IRI typeMapIri) throws SmartUriException {
+ final Map<RyaIRI, String> map = new HashMap<>();
java.net.URI uri;
try {
- final URIBuilder uriBuilder = new URIBuilder(typeMapUri.stringValue());
+ final URIBuilder uriBuilder = new URIBuilder(typeMapIri.stringValue());
uri = uriBuilder.build();
} catch (final URISyntaxException e) {
throw new SmartUriException("Unable to parse Rya type map in Smart URI", e);
@@ -164,16 +164,16 @@ public class SmartUriAdapter {
for (final NameValuePair param : params) {
final String name = param.getName();
final String value = param.getValue();
- final RyaURI type = new RyaURI(name);
+ final RyaIRI type = new RyaIRI(name);
map.put(type, value);
}
return map;
}
- private static IRI createIndividualTypeWithPropertiesUri(final RyaURI type, final Map<RyaURI, Property> map) throws SmartUriException {
+ private static IRI createIndividualTypeWithPropertiesUri(final RyaIRI type, final Map<RyaIRI, Property> map) throws SmartUriException {
final List<NameValuePair> nameValuePairs = new ArrayList<>();
- for (final Entry<RyaURI, Property> entry : map.entrySet()) {
- final RyaURI key = entry.getKey();
+ for (final Entry<RyaIRI, Property> entry : map.entrySet()) {
+ final RyaIRI key = entry.getKey();
final Property property = entry.getValue();
final RyaType ryaType = property.getValue();
@@ -198,41 +198,41 @@ public class SmartUriAdapter {
return VF.createIRI(uriString);
}
- private static Entity convertMapToEntity(final RyaURI subject, final Map<RyaURI, Map<IRI, Value>> map) {
+ private static Entity convertMapToEntity(final RyaIRI subject, final Map<RyaIRI, Map<IRI, Value>> map) {
final Entity.Builder entityBuilder = Entity.builder();
entityBuilder.setSubject(subject);
- for (final Entry<RyaURI, Map<IRI, Value>> typeEntry : map.entrySet()) {
- final RyaURI type = typeEntry.getKey();
+ for (final Entry<RyaIRI, Map<IRI, Value>> typeEntry : map.entrySet()) {
+ final RyaIRI type = typeEntry.getKey();
final Map<IRI, Value> subMap = typeEntry.getValue();
entityBuilder.setExplicitType(type);
for (final Entry<IRI, Value> entry : subMap.entrySet()) {
final IRI uri = entry.getKey();
final Value value = entry.getValue();
- final RyaURI ryaUri = new RyaURI(uri.stringValue());
- final RyaURI ryaName = new RyaURI(uri.stringValue());
+ final RyaIRI ryaIri = new RyaIRI(uri.stringValue());
+ final RyaIRI ryaName = new RyaIRI(uri.stringValue());
final RyaType ryaType = new RyaType(value.stringValue());
final Property property = new Property(ryaName, ryaType);
- entityBuilder.setProperty(ryaUri, property);
+ entityBuilder.setProperty(ryaIri, property);
}
}
final Entity entity = entityBuilder.build();
return entity;
}
- public static RyaURI findSubject(final IRI uri) throws SmartUriException {
+ public static RyaIRI findSubject(final IRI uri) throws SmartUriException {
final String uriString = uri.stringValue();
return findSubject(uriString);
}
- public static RyaURI findSubject(final String uriString) throws SmartUriException {
+ public static RyaIRI findSubject(final String uriString) throws SmartUriException {
java.net.URI uri;
try {
uri = new java.net.URI(uriString);
} catch (final URISyntaxException e) {
throw new SmartUriException("Could not find subject in Smart URI", e);
}
- final RyaURI subject;
+ final RyaIRI subject;
final String fullFragment = uri.getFragment();
if (fullFragment != null) {
final int queryPosition = fullFragment.indexOf("?");
@@ -241,7 +241,7 @@ public class SmartUriAdapter {
partialFragment = fullFragment.substring(0, queryPosition);
}
final String subjectString = uri.getScheme() + ":" + uri.getSchemeSpecificPart() + "#" + partialFragment;
- subject = new RyaURI(subjectString);
+ subject = new RyaIRI(subjectString);
} else {
final int queryPosition = uriString.indexOf("?");
String subjectString = null;
@@ -250,7 +250,7 @@ public class SmartUriAdapter {
} else {
subjectString = uriString;
}
- subject = new RyaURI(subjectString);
+ subject = new RyaIRI(subjectString);
}
return subject;
@@ -267,22 +267,22 @@ public class SmartUriAdapter {
final Map<IRI, Value> objectMap = new LinkedHashMap<>();
// Adds the entity's types to the Smart URI
- final List<RyaURI> typeIds = entity.getExplicitTypeIds();
- final Map<RyaURI, String> ryaTypeMap = createTypeMap(typeIds);
+ final List<RyaIRI> typeIds = entity.getExplicitTypeIds();
+ final Map<RyaIRI, String> ryaTypeMap = createTypeMap(typeIds);
final IRI ryaTypeMapUri = createTypeMapUri(typeIds);
final RyaType valueRyaType = new RyaType(XMLSchema.ANYURI, ryaTypeMapUri.stringValue());
final Value typeValue = RyaToRdfConversions.convertValue(valueRyaType);
objectMap.put(RYA_TYPES_URI, typeValue);
- final RyaURI subject = entity.getSubject();
- final Map<RyaURI, ImmutableMap<RyaURI, Property>> typeMap = entity.getProperties();
- for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> typeEntry : typeMap.entrySet()) {
- final RyaURI type = typeEntry.getKey();
+ final RyaIRI subject = entity.getSubject();
+ final Map<RyaIRI, ImmutableMap<RyaIRI, Property>> typeMap = entity.getProperties();
+ for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> typeEntry : typeMap.entrySet()) {
+ final RyaIRI type = typeEntry.getKey();
String typeShortName = ryaTypeMap.get(type);
typeShortName = typeShortName != null ? typeShortName + "." : "";
- final ImmutableMap<RyaURI, Property> typeProperties = typeEntry.getValue();
- for (final Entry<RyaURI, Property> properties : typeProperties.entrySet()) {
- final RyaURI key = properties.getKey();
+ final ImmutableMap<RyaIRI, Property> typeProperties = typeEntry.getValue();
+ for (final Entry<RyaIRI, Property> properties : typeProperties.entrySet()) {
+ final RyaIRI key = properties.getKey();
final Property property = properties.getValue();
final String valueString = property.getValue().getData();
final RyaType ryaType = property.getValue();
@@ -305,13 +305,13 @@ public class SmartUriAdapter {
/**
* Serializes a map into a URI.
- * @param subject the {@link RyaURI} subject of the Entity. Identifies the
+ * @param subject the {@link RyaIRI} subject of the Entity. Identifies the
* thing that is being represented as an Entity.
* @param map the {@link Map} of {@link IRI}s to {@link Value}s.
* @return the Smart {@link IRI}.
* @throws SmartUriException
*/
- public static IRI serializeUri(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException {
+ public static IRI serializeUri(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException {
final String subjectData = subject.getData();
final int fragmentPosition = subjectData.indexOf("#");
String prefix = subjectData;
@@ -389,12 +389,12 @@ public class SmartUriAdapter {
throw new SmartUriException("Unable to deserialize Smart URI", e);
}
final Map<IRI, Value> map = new HashMap<>();
- final RyaURI subject = findSubject(iri.stringValue());
+ final RyaIRI subject = findSubject(iri.stringValue());
final List<NameValuePair> parameters = uriBuilder.getQueryParams();
- Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>();
- Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>();
- final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
+ Map<RyaIRI, String> entityTypeMap = new LinkedHashMap<>();
+ Map<String, RyaIRI> invertedEntityTypeMap = new LinkedHashMap<>();
+ final Map<RyaIRI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
for (final NameValuePair pair : parameters) {
final String keyString = pair.getName();
final String valueString = pair.getValue();
@@ -409,13 +409,13 @@ public class SmartUriAdapter {
final IRI type = TypeDeterminer.determineType(decoded);
if (type == XMLSchema.ANYURI) {
if (keyString.equals(RYA_TYPES_URI.getLocalName())) {
- entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded));
+ entityTypeMap = convertIriToTypeMap(VF.createIRI(decoded));
invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse();
}
} else {
final int keyPrefixLocation = keyString.indexOf(".");
final String keyPrefix = keyString.substring(0, keyPrefixLocation);
- final RyaURI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix);
+ final RyaIRI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix);
final String keyName = keyString.substring(keyPrefixLocation + 1, keyString.length());
final RyaType ryaType = new RyaType(type, valueString);
@@ -452,12 +452,12 @@ public class SmartUriAdapter {
throw new SmartUriException("Unable to deserialize Smart URI", e);
}
- final RyaURI subject = findSubject(uri.stringValue());
+ final RyaIRI subject = findSubject(uri.stringValue());
final List<NameValuePair> parameters = uriBuilder.getQueryParams();
- Map<RyaURI, String> entityTypeMap = new LinkedHashMap<>();
- Map<String, RyaURI> invertedEntityTypeMap = new LinkedHashMap<>();
- final Map<RyaURI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
+ Map<RyaIRI, String> entityTypeMap = new LinkedHashMap<>();
+ Map<String, RyaIRI> invertedEntityTypeMap = new LinkedHashMap<>();
+ final Map<RyaIRI, Map<IRI, Value>> fullMap = new LinkedHashMap<>();
for (final NameValuePair pair : parameters) {
final String keyString = pair.getName();
final String valueString = pair.getValue();
@@ -472,13 +472,13 @@ public class SmartUriAdapter {
final IRI type = TypeDeterminer.determineType(decoded);
if (type == XMLSchema.ANYURI) {
if (keyString.equals(RYA_TYPES_URI.getLocalName())) {
- entityTypeMap = convertUriToTypeMap(VF.createIRI(decoded));
+ entityTypeMap = convertIriToTypeMap(VF.createIRI(decoded));
invertedEntityTypeMap = HashBiMap.create(entityTypeMap).inverse();
}
} else {
final int keyPrefixLocation = keyString.indexOf(".");
final String keyPrefix = keyString.substring(0, keyPrefixLocation);
- final RyaURI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix);
+ final RyaIRI keyCorrespondingType = invertedEntityTypeMap.get(keyPrefix);
final String keyName = keyString.substring(keyPrefixLocation + 1, keyString.length());
final RyaType ryaType = new RyaType(type, valueString);
@@ -577,9 +577,9 @@ public class SmartUriAdapter {
public static Map<IRI, Value> entityToValueMap(final Entity entity) {
final Map<IRI, Value> map = new LinkedHashMap<>();
- for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity.getProperties().entrySet()) {
- for (final Entry<RyaURI, Property> property : entry.getValue().entrySet()) {
- final RyaURI propertyKey = property.getKey();
+ for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> entry : entity.getProperties().entrySet()) {
+ for (final Entry<RyaIRI, Property> property : entry.getValue().entrySet()) {
+ final RyaIRI propertyKey = property.getKey();
final IRI iri = VF.createIRI(propertyKey.getData());
final Property propertyValue = property.getValue();
final Value value = RyaToRdfConversions.convertValue(propertyValue.getValue());
@@ -601,10 +601,10 @@ public class SmartUriAdapter {
final IRI iri = entry.getKey();
final Value value = entry.getValue();
- final RyaURI ryaUri = new RyaURI(iri.stringValue());
+ final RyaIRI ryaIri = new RyaIRI(iri.stringValue());
final RyaType ryaType = RdfToRyaConversions.convertValue(value);
- final Property property = new Property(ryaUri, ryaType);
+ final Property property = new Property(ryaIri, ryaType);
properties.add(property);
}
return properties;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
index 03c2dbb..0c1650c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/SmartUriStorage.java
@@ -20,7 +20,7 @@ package org.apache.rya.indexing.smarturi;
import java.util.Map;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.model.TypedEntity;
@@ -35,12 +35,12 @@ import org.eclipse.rdf4j.model.Value;
public interface SmartUriStorage {
/**
* Stores the map into the datastore.
- * @param subject the {@link RyaURI} subject of the Entity. Identifies the
+ * @param subject the {@link RyaIRI} subject of the Entity. Identifies the
* thing that is being represented as an Entity.
* @param map the {@link Map} of {@link IRI}s to {@link Value}s.
* @throws SmartUriException
*/
- public void storeEntity(final RyaURI subject, final Map<IRI, Value> map) throws SmartUriException;
+ public void storeEntity(final RyaIRI subject, final Map<IRI, Value> map) throws SmartUriException;
/**
* Stores the entity into the datastore.
@@ -59,12 +59,12 @@ public interface SmartUriStorage {
/**
* Queries for the entity based on the subject
- * @param subject the {@link RyaURI} subject of the Entity. Identifies the
+ * @param subject the {@link RyaIRI} subject of the Entity. Identifies the
* thing that is being represented as an Entity.
* @return the {@link Entity} matching the subject.
* @throws SmartUriException
*/
- public Entity queryEntity(final RyaURI subject) throws SmartUriException;
+ public Entity queryEntity(final RyaIRI subject) throws SmartUriException;
/**
* Queries the datastore for the map.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
index 1d17097..6ac6ab2 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetector.java
@@ -36,7 +36,7 @@ import java.util.TreeSet;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.lang.StringUtils;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.impl.DateTimeRyaTypeResolver;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
@@ -251,16 +251,16 @@ public class DuplicateDataDetector {
requireNonNull(entity2);
boolean allValuesNearlyEqual = true;
- final List<RyaURI> types1 = entity1.getExplicitTypeIds();
- final List<RyaURI> types2 = entity2.getExplicitTypeIds();
+ final List<RyaIRI> types1 = entity1.getExplicitTypeIds();
+ final List<RyaIRI> types2 = entity2.getExplicitTypeIds();
final boolean doBothHaveSameTypes = types1.containsAll(types2);
if (!doBothHaveSameTypes) {
return false;
}
- for (final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity1.getProperties().entrySet()) {
- final RyaURI typeIdUri = entry.getKey();
- for (final Entry<RyaURI, Property> typeProperty : entry.getValue().entrySet()) {
- final RyaURI propertyNameUri = typeProperty.getKey();
+ for (final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> entry : entity1.getProperties().entrySet()) {
+ final RyaIRI typeIdUri = entry.getKey();
+ for (final Entry<RyaIRI, Property> typeProperty : entry.getValue().entrySet()) {
+ final RyaIRI propertyNameUri = typeProperty.getKey();
final Property property1 = typeProperty.getValue();
final Optional<Property> p2 = entity2.lookupTypeProperty(typeIdUri, propertyNameUri);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
index 6571c83..8470a5d 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataExternalSetProvider.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Set;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.external.matching.ExternalSetProvider;
import org.apache.rya.indexing.external.matching.QuerySegment;
@@ -46,11 +46,11 @@ import com.google.common.collect.Multimap;
*/
public class StatementMetadataExternalSetProvider implements ExternalSetProvider<StatementMetadataNode<?>> {
- private List<RyaURI> expectedURI = Arrays.asList(RdfToRyaConversions.convertURI(OWLReify.SOURCE),
- RdfToRyaConversions.convertURI(OWLReify.PROPERTY), RdfToRyaConversions.convertURI(OWLReify.TARGET),
- RdfToRyaConversions.convertURI(RDF.TYPE));
+ private List<RyaIRI> expectedURI = Arrays.asList(RdfToRyaConversions.convertIRI(OWLReify.SOURCE),
+ RdfToRyaConversions.convertIRI(OWLReify.PROPERTY), RdfToRyaConversions.convertIRI(OWLReify.TARGET),
+ RdfToRyaConversions.convertIRI(RDF.TYPE));
private Multimap<Var, StatementPattern> reifiedQueries;
- private Set<RyaURI> metadataProperties;
+ private Set<RyaIRI> metadataProperties;
private RdfCloudTripleStoreConfiguration conf;
public StatementMetadataExternalSetProvider(RdfCloudTripleStoreConfiguration conf) {
@@ -102,7 +102,7 @@ public class StatementMetadataExternalSetProvider implements ExternalSetProvider
for (StatementPattern pattern : patterns) {
Var var = pattern.getPredicateVar();
if (var.getValue() != null && var.getValue() instanceof IRI) {
- RyaURI uri = RdfToRyaConversions.convertURI((IRI) var.getValue());
+ RyaIRI uri = RdfToRyaConversions.convertIRI((IRI) var.getValue());
if(expectedURI.contains(uri) || metadataProperties.contains(uri)) {
finalPatterns.add(pattern);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
index 3d3b7ba..a5f8b3a 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/statement/metadata/matching/StatementMetadataNode.java
@@ -39,7 +39,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
@@ -104,16 +104,16 @@ import com.google.common.base.Preconditions;
public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> extends ExternalSet
implements ExternalBatchingIterator {
- private static final RyaURI TYPE_ID_URI = new RyaURI(RDF.TYPE.toString());
- private static final RyaURI SUBJ_ID_URI = new RyaURI(OWLReify.SOURCE.toString());
- private static final RyaURI PRED_ID_URI = new RyaURI(OWLReify.PROPERTY.toString());
- private static final RyaURI OBJ_ID_URI = new RyaURI(OWLReify.TARGET.toString());
- private static final RyaURI STATEMENT_ID_URI = new RyaURI(OWLReify.ANNOTATION.toString());
+ private static final RyaIRI TYPE_ID_URI = new RyaIRI(RDF.TYPE.toString());
+ private static final RyaIRI SUBJ_ID_URI = new RyaIRI(OWLReify.SOURCE.toString());
+ private static final RyaIRI PRED_ID_URI = new RyaIRI(OWLReify.PROPERTY.toString());
+ private static final RyaIRI OBJ_ID_URI = new RyaIRI(OWLReify.TARGET.toString());
+ private static final RyaIRI STATEMENT_ID_URI = new RyaIRI(OWLReify.ANNOTATION.toString());
private StatementPattern statement;
- private Map<RyaURI, Var> properties;
+ private Map<RyaIRI, Var> properties;
private Collection<StatementPattern> patterns;
- private List<RyaURI> uriList = Arrays.asList(TYPE_ID_URI, SUBJ_ID_URI, PRED_ID_URI, OBJ_ID_URI);
+ private List<RyaIRI> uriList = Arrays.asList(TYPE_ID_URI, SUBJ_ID_URI, PRED_ID_URI, OBJ_ID_URI);
private C conf;
private Set<String> bindingNames;
private RyaQueryEngine<C> queryEngine;
@@ -206,7 +206,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
Var context = null;
for (final StatementPattern pattern : patterns) {
- final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString());
+ final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString());
if (!contextSet) {
context = pattern.getContextVar();
@@ -218,7 +218,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
}
if (predicate.equals(TYPE_ID_URI)) {
- final RyaURI statementID = new RyaURI(pattern.getObjectVar().getValue().stringValue());
+ final RyaIRI statementID = new RyaIRI(pattern.getObjectVar().getValue().stringValue());
if (statementID.equals(STATEMENT_ID_URI)) {
statementFound = true;
} else {
@@ -281,10 +281,10 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
private void setStatementPatternAndProperties(Collection<StatementPattern> patterns) {
StatementPattern sp = new StatementPattern();
- Map<RyaURI, Var> properties = new HashMap<>();
+ Map<RyaIRI, Var> properties = new HashMap<>();
for (final StatementPattern pattern : patterns) {
- final RyaURI predicate = new RyaURI(pattern.getPredicateVar().getValue().toString());
+ final RyaIRI predicate = new RyaIRI(pattern.getPredicateVar().getValue().toString());
if (!uriList.contains(predicate)) {
Var objVar = pattern.getObjectVar();
@@ -355,19 +355,19 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
Value predValue = getVarValue(statement.getPredicateVar(), bs);
Value objValue = getVarValue(statement.getObjectVar(), bs);
Value contextValue = getVarValue(statement.getContextVar(), bs);
- RyaURI subj = null;
- RyaURI pred = null;
+ RyaIRI subj = null;
+ RyaIRI pred = null;
RyaType obj = null;
- RyaURI context = null;
+ RyaIRI context = null;
if (subjValue != null) {
Preconditions.checkArgument(subjValue instanceof IRI);
- subj = RdfToRyaConversions.convertURI((IRI) subjValue);
+ subj = RdfToRyaConversions.convertIRI((IRI) subjValue);
}
if (predValue != null) {
Preconditions.checkArgument(predValue instanceof IRI);
- pred = RdfToRyaConversions.convertURI((IRI) predValue);
+ pred = RdfToRyaConversions.convertIRI((IRI) predValue);
}
if (objValue != null) {
@@ -375,7 +375,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
}
if(contextValue != null) {
- context = RdfToRyaConversions.convertURI((IRI) contextValue);
+ context = RdfToRyaConversions.convertIRI((IRI) contextValue);
}
return new RyaStatement(subj, pred, obj, context);
}
@@ -480,7 +480,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
* This is an {@link CloseableIteration} class that serves a number of
* purposes. It's primary purpose is to filter a CloseableIteration over
* {@link Map.Entry<RyaStatement,BindingSet>} using a specified property Map
- * from {@link RyaURI} to {@link org.eclipse.rdf4j.query.algebra.Var}. This
+ * from {@link RyaIRI} to {@link org.eclipse.rdf4j.query.algebra.Var}. This
* Iteration iterates over the Entries in the user specified Iteration,
* comparing properties in the {@link StatementMetadata} Map contained in
* the RyaStatements with the property Map for this class. If the properties
@@ -496,7 +496,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
class PropertyFilterAndBindingSetJoinIteration implements CloseableIteration<BindingSet, QueryEvaluationException> {
private CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> statements;
- private Map<RyaURI, Var> properties;
+ private Map<RyaIRI, Var> properties;
private StatementPattern sp;
private BindingSet next;
private boolean hasNextCalled = false;
@@ -504,7 +504,7 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
public PropertyFilterAndBindingSetJoinIteration(
CloseableIteration<? extends Entry<RyaStatement, BindingSet>, RyaDAOException> statements,
- Map<RyaURI, Var> properties, StatementPattern sp) {
+ Map<RyaIRI, Var> properties, StatementPattern sp) {
this.statements = statements;
this.properties = properties;
this.sp = sp;
@@ -631,13 +631,13 @@ public class StatementMetadataNode<C extends RdfCloudTripleStoreConfiguration> e
*/
private Optional<BindingSet> buildPropertyBindingSet(RyaStatement statement) {
StatementMetadata metadata = statement.getMetadata();
- Map<RyaURI, RyaType> statementProps = metadata.getMetadata();
+ Map<RyaIRI, RyaType> statementProps = metadata.getMetadata();
if (statementProps.size() < properties.size()) {
return Optional.empty();
}
QueryBindingSet bs = new QueryBindingSet();
- for (Map.Entry<RyaURI, Var> entry : properties.entrySet()) {
- RyaURI key = entry.getKey();
+ for (Map.Entry<RyaIRI, Var> entry : properties.entrySet()) {
+ RyaIRI key = entry.getKey();
Var var = entry.getValue();
if (!statementProps.containsKey(key)) {
return Optional.empty();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
index 7108ae6..02ed887 100644
--- a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
@@ -41,7 +41,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.RyaTableMutationsFactory;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaToRdfConversions;
@@ -1705,14 +1705,14 @@ public class DocumentIndexIntersectingIteratorTest {
for (int i = 0; i < 20; i++) {
- RyaStatement rs1 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
- RyaStatement rs2 = new RyaStatement(new RyaURI("uri:" + i ), new RyaURI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
+ RyaStatement rs1 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf1"), new RyaType(XMLSchema.STRING, "cq1"));
+ RyaStatement rs2 = new RyaStatement(new RyaIRI("uri:" + i ), new RyaIRI("uri:cf2"), new RyaType(XMLSchema.STRING, "cq2"));
RyaStatement rs3 = null;
RyaStatement rs4 = null;
if(i == 5 || i == 15) {
- rs3 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
- rs4 = new RyaStatement(new RyaURI("uri:" +i ), new RyaURI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i)));
+ rs3 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.INTEGER,Integer.toString(i)));
+ rs4 = new RyaStatement(new RyaIRI("uri:" +i ), new RyaIRI("uri:cf3"), new RyaType(XMLSchema.STRING,Integer.toString(i)));
}
@@ -1780,9 +1780,9 @@ public class DocumentIndexIntersectingIteratorTest {
RyaType rt1 = RdfToRyaConversions.convertValue(spList1.get(2).getObjectVar().getValue());
RyaType rt2 = RdfToRyaConversions.convertValue(spList2.get(2).getObjectVar().getValue());
- RyaURI predURI1 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(0).getPredicateVar().getValue());
- RyaURI predURI2 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(1).getPredicateVar().getValue());
- RyaURI predURI3 = (RyaURI) RdfToRyaConversions.convertValue(spList1.get(2).getPredicateVar().getValue());
+ RyaIRI predURI1 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(0).getPredicateVar().getValue());
+ RyaIRI predURI2 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(1).getPredicateVar().getValue());
+ RyaIRI predURI3 = (RyaIRI) RdfToRyaConversions.convertValue(spList1.get(2).getPredicateVar().getValue());
// System.out.println("to string" + spList1.get(2).getObjectVar().getValue().stringValue());
// System.out.println("converted obj" + rt1.getData());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java
index fcef816..d605fcd 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfigurationTest.java
@@ -30,7 +30,7 @@ import java.util.Properties;
import java.util.Set;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.junit.Test;
public class AccumuloIndexingConfigurationTest {
@@ -114,7 +114,7 @@ public class AccumuloIndexingConfigurationTest {
boolean useInference = true;
boolean displayPlan = false;
boolean useMetadata = true;
- Set<RyaURI> metaProperties = new HashSet<>(Arrays.asList(new RyaURI("urn:123"), new RyaURI("urn:456")));
+ Set<RyaIRI> metaProperties = new HashSet<>(Arrays.asList(new RyaIRI("urn:123"), new RyaIRI("urn:456")));
Properties props = new Properties();
[17/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
index 125a2e4..f18b1da 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
@@ -23,6 +23,7 @@ import static org.apache.rya.indexing.geotemporal.GeoTemporalTestUtils.getFilter
import static org.apache.rya.indexing.geotemporal.GeoTemporalTestUtils.getSps;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.rya.api.resolver.RdfToRyaConversions;
@@ -32,21 +33,19 @@ import org.apache.rya.indexing.IndexingFunctionRegistry;
import org.apache.rya.indexing.IndexingFunctionRegistry.FUNCTION_TYPE;
import org.apache.rya.indexing.geotemporal.GeoTemporalIndexer.GeoPolicy;
import org.apache.rya.indexing.geotemporal.GeoTemporalIndexer.TemporalPolicy;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.FunctionCall;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.Var;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.FunctionCall;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.Var;
import com.mongodb.DBObject;
import com.mongodb.util.JSON;
@@ -60,6 +59,8 @@ import com.mongodb.util.JSON;
* @see GeoPolicy Geo Filter Functions
*/
public class GeoTemporalMongoDBStorageStrategyTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
private GeoTemporalMongoDBStorageStrategy adapter;
@Before
public void setup() {
@@ -92,8 +93,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
//should only be one.
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(new URIImpl(filter.getURI()), filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(new URIImpl(filter.getURI()), sps.get(0), extractArguments(objVar.getName(), filter));
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(VF.createIRI(filter.getURI()), filter.getArgs());
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(VF.createIRI(filter.getURI()), sps.get(0), Arrays.stream(arguments).toArray());
geoFilters.add(expr);
}
final List<IndexingExpr> temporalFilters = new ArrayList<>();
@@ -134,8 +136,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(new URIImpl(filter.getURI()), filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(new URIImpl(filter.getURI()), sps.get(0), extractArguments(objVar.getName(), filter));
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(VF.createIRI(filter.getURI()), filter.getArgs());
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(VF.createIRI(filter.getURI()), sps.get(0), Arrays.stream(arguments).toArray());
geoFilters.add(expr);
}
final List<IndexingExpr> temporalFilters = new ArrayList<>();
@@ -178,8 +181,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
//should only be one.
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(new URIImpl(filter.getURI()), filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(new URIImpl(filter.getURI()), sps.get(0), extractArguments(objVar.getName(), filter));
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(VF.createIRI(filter.getURI()), filter.getArgs());
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(VF.createIRI(filter.getURI()), sps.get(0), Arrays.stream(arguments).toArray());
temporalFilters.add(expr);
}
final DBObject actual = adapter.getFilterQuery(geoFilters, temporalFilters);
@@ -209,8 +213,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(new URIImpl(filter.getURI()), filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(new URIImpl(filter.getURI()), sps.get(0), extractArguments(objVar.getName(), filter));
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(VF.createIRI(filter.getURI()), filter.getArgs());
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(VF.createIRI(filter.getURI()), sps.get(0), Arrays.stream(arguments).toArray());
temporalFilters.add(expr);
}
final DBObject actual = adapter.getFilterQuery(geoFilters, temporalFilters);
@@ -255,9 +260,10 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final URI filterURI = new URIImpl(filter.getURI());
+ final IRI filterURI = VF.createIRI(filter.getURI());
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), extractArguments(objVar.getName(), filter));
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
@@ -309,9 +315,10 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final URI filterURI = new URIImpl(filter.getURI());
+ final IRI filterURI = VF.createIRI(filter.getURI());
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), extractArguments(objVar.getName(), filter));
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
@@ -375,9 +382,10 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final URI filterURI = new URIImpl(filter.getURI());
+ final IRI filterURI = VF.createIRI(filter.getURI());
final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), extractArguments(objVar.getName(), filter));
+ final Value[] arguments = extractArguments(objVar.getName(), filter);
+ final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
@@ -412,15 +420,14 @@ public class GeoTemporalMongoDBStorageStrategyTest {
@Test
public void serializeTest() {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final Resource context = vf.createURI("foo:context");
+ final Resource subject = VF.createIRI("foo:subj");
+ final Resource context = VF.createIRI("foo:context");
//GEO
- URI predicate = GeoConstants.GEO_AS_WKT;
- Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
+ IRI predicate = GeoConstants.GEO_AS_WKT;
+ Value object = VF.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ Statement statement = VF.createStatement(subject, predicate, object, context);
DBObject actual = adapter.serialize(RdfToRyaConversions.convertStatement(statement));
String expectedString =
"{ "
@@ -434,9 +441,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
assertEqualMongo(expected, actual);
//TIME INSTANT
- predicate = new URIImpl("Property:event:time");
- object = vf.createLiteral("2015-12-30T12:00:00Z");
- statement = new ContextStatementImpl(subject, predicate, object, context);
+ predicate = VF.createIRI("Property:event:time");
+ object = VF.createLiteral("2015-12-30T12:00:00Z");
+ statement = VF.createStatement(subject, predicate, object, context);
actual = adapter.serialize(RdfToRyaConversions.convertStatement(statement));
expectedString =
"{"
@@ -451,9 +458,9 @@ public class GeoTemporalMongoDBStorageStrategyTest {
assertEqualMongo(expected, actual);
//TIME INTERVAL
- predicate = new URIImpl("Property:circa");
- object = vf.createLiteral("[1969-12-31T19:00:00-05:00,1969-12-31T19:00:01-05:00]");
- statement = new ContextStatementImpl(subject, predicate, object, context);
+ predicate = VF.createIRI("Property:circa");
+ object = VF.createLiteral("[1969-12-31T19:00:00-05:00,1969-12-31T19:00:01-05:00]");
+ statement = VF.createStatement(subject, predicate, object, context);
actual = adapter.serialize(RdfToRyaConversions.convertStatement(statement));
expectedString =
"{"
@@ -471,7 +478,7 @@ public class GeoTemporalMongoDBStorageStrategyTest {
assertEqualMongo(expected, actual);
}
- private Value[] extractArguments(final String matchName, final FunctionCall call) {
+ private static Value[] extractArguments(final String matchName, final FunctionCall call) {
final Value args[] = new Value[call.getArgs().size() - 1];
int argI = 0;
for (int i = 0; i != call.getArgs().size(); ++i) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexerIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexerIT.java
index 881289a..5136a32 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexerIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexerIT.java
@@ -34,12 +34,11 @@ import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.apache.rya.mongodb.MongoITBase;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import com.vividsolutions.jts.geom.Geometry;
@@ -101,18 +100,18 @@ public class MongoGeoTemporalIndexerIT extends MongoITBase {
}
private static RyaStatement statement(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:test");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("uri:test");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
- return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
+ return RdfToRyaConversions.convertStatement(vf.createStatement(subject, predicate, object));
}
private static RyaStatement statement(final TemporalInstant instant) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:test");
- final URI predicate = vf.createURI("Property:atTime");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("uri:test");
+ final IRI predicate = vf.createIRI("Property:atTime");
final Value object = vf.createLiteral(instant.toString());
- return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
+ return RdfToRyaConversions.convertStatement(vf.createStatement(subject, predicate, object));
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java
index f38fc06..81e0682 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java
@@ -32,22 +32,21 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
@@ -286,12 +285,12 @@ public class MongoGeoIndexerFilterIT extends MongoITBase {
}
private static RyaStatement statement(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("urn:geo");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("urn:geo");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final WKTWriter w = new WKTWriter();
final Value object = vf.createLiteral(w.write(geo), GeoConstants.XMLSCHEMA_OGC_WKT);
- return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
+ return RdfToRyaConversions.convertStatement(vf.createStatement(subject, predicate, object));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerIT.java
index 40751ae..ff723f8 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerIT.java
@@ -33,15 +33,13 @@ import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.mongodb.geo.MongoGeoIndexer;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.Sets;
import com.vividsolutions.jts.geom.Coordinate;
@@ -69,30 +67,30 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Point point = gf.createPoint(new Coordinate(10, 10));
final Value pointValue = vf.createLiteral("Point(10 10)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final URI invalidPredicate = GeoConstants.GEO_AS_WKT;
+ final IRI invalidPredicate = GeoConstants.GEO_AS_WKT;
// These should not be stored because they are not in the predicate list
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj1"), invalidPredicate, pointValue)));
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj2"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj1"), invalidPredicate, pointValue)));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj2"), invalidPredicate, pointValue)));
- final URI pred1 = vf.createURI("pred:1");
- final URI pred2 = vf.createURI("pred:2");
+ final IRI pred1 = vf.createIRI("pred:1");
+ final IRI pred2 = vf.createIRI("pred:2");
// These should be stored because they are in the predicate list
- final Statement s3 = new StatementImpl(vf.createURI("foo:subj3"), pred1, pointValue);
- final Statement s4 = new StatementImpl(vf.createURI("foo:subj4"), pred2, pointValue);
+ final Statement s3 = vf.createStatement(vf.createIRI("foo:subj3"), pred1, pointValue);
+ final Statement s4 = vf.createStatement(vf.createIRI("foo:subj4"), pred2, pointValue);
f.storeStatement(convertStatement(s3));
f.storeStatement(convertStatement(s4));
// This should not be stored because the object is not valid wkt
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj5"), pred1, vf.createLiteral("soint(10 10)"))));
// This should not be stored because the object is not a literal
- f.storeStatement(convertStatement(new StatementImpl(vf.createURI("foo:subj6"), pred1, vf.createURI("p:Point(10 10)"))));
+ f.storeStatement(convertStatement(vf.createStatement(vf.createIRI("foo:subj6"), pred1, vf.createIRI("p:Point(10 10)"))));
f.flush();
@@ -109,13 +107,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(0 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -154,13 +152,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -184,13 +182,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -224,13 +222,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -243,7 +241,7 @@ public class MongoGeoIndexerIT extends MongoITBase {
// query with wrong context
assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
}
}
@@ -254,13 +252,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -272,7 +270,7 @@ public class MongoGeoIndexerIT extends MongoITBase {
assertEquals(Sets.newHashSet(statement), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(subject))));
// query with wrong subject
- assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -283,13 +281,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -303,10 +301,10 @@ public class MongoGeoIndexerIT extends MongoITBase {
// query with wrong context
assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createURI("foo:context2")))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setContext(vf.createIRI("foo:context2")))));
// query with wrong subject
- assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createURI("foo:subj2")))));
+ assertEquals(Sets.newHashSet(), getSet(f.queryWithin(p1, new StatementConstraints().setSubject(vf.createIRI("foo:subj2")))));
}
}
@@ -317,13 +315,13 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("foo:subj");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("foo:subj");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral("Point(-77.03524 38.889468)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Resource context = vf.createURI("foo:context");
+ final Resource context = vf.createIRI("foo:context");
- final Statement statement = new ContextStatementImpl(subject, predicate, object, context);
+ final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(convertStatement(statement));
f.flush();
@@ -337,7 +335,7 @@ public class MongoGeoIndexerIT extends MongoITBase {
// query with wrong predicate
assertEquals(Sets.newHashSet(),
- getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createURI("other:pred"))))));
+ getSet(f.queryWithin(p1, new StatementConstraints().setPredicates(Collections.singleton(vf.createIRI("other:pred"))))));
}
}
@@ -348,19 +346,19 @@ public class MongoGeoIndexerIT extends MongoITBase {
f.setConf(conf);
f.init();
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource context = vf.createURI("foo:context");
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource context = vf.createIRI("foo:context");
- final Resource subjectEast = vf.createURI("foo:subj:east");
- final URI predicateEast = GeoConstants.GEO_AS_WKT;
+ final Resource subjectEast = vf.createIRI("foo:subj:east");
+ final IRI predicateEast = GeoConstants.GEO_AS_WKT;
final Value objectEast = vf.createLiteral("Point(179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementEast = new ContextStatementImpl(subjectEast, predicateEast, objectEast, context);
+ final Statement statementEast = vf.createStatement(subjectEast, predicateEast, objectEast, context);
f.storeStatement(convertStatement(statementEast));
- final Resource subjectWest = vf.createURI("foo:subj:west");
- final URI predicateWest = GeoConstants.GEO_AS_WKT;
+ final Resource subjectWest = vf.createIRI("foo:subj:west");
+ final IRI predicateWest = GeoConstants.GEO_AS_WKT;
final Value objectWest = vf.createLiteral("Point(-179 0)", GeoConstants.XMLSCHEMA_OGC_WKT);
- final Statement statementWest = new ContextStatementImpl(subjectWest, predicateWest, objectWest, context);
+ final Statement statementWest = vf.createStatement(subjectWest, predicateWest, objectWest, context);
f.storeStatement(convertStatement(statementWest));
f.flush();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerSfIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerSfIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerSfIT.java
index a544a78..c6efc69 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerSfIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerSfIT.java
@@ -37,15 +37,15 @@ import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.indexing.mongodb.geo.MongoGeoIndexer;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -54,8 +54,6 @@ import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
-import info.aduna.iteration.CloseableIteration;
-
/**
* Tests all of the "simple functions" of the geoindexer.
*/
@@ -105,11 +103,11 @@ public class MongoGeoIndexerSfIT extends MongoITBase {
}
private static RyaStatement statement(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("uri:" + names.get(geo));
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("uri:" + names.get(geo));
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final Value object = vf.createLiteral(geo.toString(), GeoConstants.XMLSCHEMA_OGC_WKT);
- return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
+ return RdfToRyaConversions.convertStatement(vf.createStatement(subject, predicate, object));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoIndexerDeleteIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoIndexerDeleteIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoIndexerDeleteIT.java
index 6acc998..7f998b1 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoIndexerDeleteIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/mongo/MongoIndexerDeleteIT.java
@@ -31,21 +31,20 @@ import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.accumulo.geo.OptionalConfigUtils;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.RDF;
+import org.eclipse.rdf4j.model.vocabulary.RDFS;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.Update;
+import org.eclipse.rdf4j.repository.sail.SailRepository;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
+import org.eclipse.rdf4j.sail.Sail;
import org.junit.Test;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.model.vocabulary.RDFS;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.Update;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.repository.sail.SailRepositoryConnection;
-import org.openrdf.sail.Sail;
import com.mongodb.MongoClient;
import com.vividsolutions.jts.geom.Coordinate;
@@ -122,7 +121,7 @@ public class MongoIndexerDeleteIT extends MongoITBase {
}
private void populateRya(final SailRepositoryConnection conn) throws Exception {
- final ValueFactory VF = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
// geo 2x2 points
final GeometryFactory GF = new GeometryFactory();
for (int x = 0; x <= 1; x++) {
@@ -135,26 +134,27 @@ public class MongoIndexerDeleteIT extends MongoITBase {
}
// freetext
- final URI person = VF.createURI("http://example.org/ontology/Person");
+ final IRI person = vf.createIRI("http://example.org/ontology/Person");
String uuid;
uuid = "urn:people";
- conn.add(VF.createURI(uuid), RDF.TYPE, person);
- conn.add(VF.createURI(uuid), RDFS.LABEL, VF.createLiteral("Alice Palace Hose", VF.createURI("http://www.w3.org/2001/XMLSchema#string")));
- conn.add(VF.createURI(uuid), RDFS.LABEL, VF.createLiteral("Bob Snob Hose", "en"));
+ conn.add(vf.createIRI(uuid), RDF.TYPE, person);
+ conn.add(vf.createIRI(uuid), RDFS.LABEL, vf.createLiteral("Alice Palace Hose", vf.createIRI("http://www.w3.org/2001/XMLSchema#string")));
+ conn.add(vf.createIRI(uuid), RDFS.LABEL, vf.createLiteral("Bob Snob Hose"));
// temporal
final TemporalInstant instant = new TemporalInstantRfc3339(1, 2, 3, 4, 5, 6);
- conn.add(VF.createURI("foo:time"), VF.createURI("Property:atTime"), VF.createLiteral(instant.toString()));
+ conn.add(vf.createIRI("foo:time"), vf.createIRI("Property:atTime"), vf.createLiteral(instant.toString()));
+ conn.commit();
}
private static RyaStatement statement(final Geometry geo) {
- final ValueFactory vf = new ValueFactoryImpl();
- final Resource subject = vf.createURI("urn:geo");
- final URI predicate = GeoConstants.GEO_AS_WKT;
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+ final Resource subject = vf.createIRI("urn:geo");
+ final IRI predicate = GeoConstants.GEO_AS_WKT;
final WKTWriter w = new WKTWriter();
final Value object = vf.createLiteral(w.write(geo), GeoConstants.XMLSCHEMA_OGC_WKT);
- return RdfToRyaConversions.convertStatement(new StatementImpl(subject, predicate, object));
+ return RdfToRyaConversions.convertStatement(vf.createStatement(subject, predicate, object));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PeriodicQueryResultStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PeriodicQueryResultStorage.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PeriodicQueryResultStorage.java
index 2936738..c770e45 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PeriodicQueryResultStorage.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PeriodicQueryResultStorage.java
@@ -25,7 +25,7 @@ import java.util.Optional;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Interface for storing and retrieving Periodic Query Results.
@@ -72,7 +72,7 @@ public interface PeriodicQueryResultStorage {
* @return PeriodicQueryStorageMetadata
* @throws PeriodicQueryStorageException
*/
- public PeriodicQueryStorageMetadata getPeriodicQueryMetadata(String queryID) throws PeriodicQueryStorageException;;
+ public PeriodicQueryStorageMetadata getPeriodicQueryMetadata(String queryID) throws PeriodicQueryStorageException;
/**
* Add periodic query results to the storage layer indicated by the given query id
@@ -80,7 +80,7 @@ public interface PeriodicQueryResultStorage {
* @param results - query results to be added to storage
* @throws PeriodicQueryStorageException
*/
- public void addPeriodicQueryResults(String queryId, Collection<VisibilityBindingSet> results) throws PeriodicQueryStorageException;;
+ public void addPeriodicQueryResults(String queryId, Collection<VisibilityBindingSet> results) throws PeriodicQueryStorageException;
/**
* Deletes periodic query results from the storage layer
@@ -88,14 +88,14 @@ public interface PeriodicQueryResultStorage {
* @param binID - bin id indicating the periodic id of results to be deleted
* @throws PeriodicQueryStorageException
*/
- public void deletePeriodicQueryResults(String queryId, long binID) throws PeriodicQueryStorageException;;
+ public void deletePeriodicQueryResults(String queryId, long binID) throws PeriodicQueryStorageException;
/**
* Deletes all results for the storage layer indicated by the given query id
* @param queryID - id indicating the storage layer whose results will be deleted
* @throws PeriodicQueryStorageException
*/
- public void deletePeriodicQuery(String queryID) throws PeriodicQueryStorageException;;
+ public void deletePeriodicQuery(String queryID) throws PeriodicQueryStorageException;
/**
* List results in the given storage layer indicated by the query id
@@ -104,7 +104,7 @@ public interface PeriodicQueryResultStorage {
* @return
* @throws PeriodicQueryStorageException
*/
- public CloseableIterator<BindingSet> listResults(String queryId, Optional<Long> binID) throws PeriodicQueryStorageException;;
+ public CloseableIterator<BindingSet> listResults(String queryId, Optional<Long> binID) throws PeriodicQueryStorageException;
/**
* List all storage tables containing periodic results.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PrecomputedJoinStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PrecomputedJoinStorage.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PrecomputedJoinStorage.java
index 70c8b0e..ebb8e8d 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PrecomputedJoinStorage.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/PrecomputedJoinStorage.java
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.utils.CloseableIterator;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializer.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializer.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializer.java
index 999b26f..599a48a 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializer.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializer.java
@@ -28,22 +28,20 @@ import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
-
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-
-import com.google.common.primitives.Bytes;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTypeResolverException;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+
+import com.google.common.primitives.Bytes;
+
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
/**
* Converts {@link BindingSet}s to byte[]s and back again. The bytes do not
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java
index f3d078d..03d3e4f 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjStorage.java
@@ -43,8 +43,8 @@ import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.PCJIdFactory;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPeriodicQueryResultStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPeriodicQueryResultStorage.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPeriodicQueryResultStorage.java
index 8124aff..889c8ca 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPeriodicQueryResultStorage.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPeriodicQueryResultStorage.java
@@ -44,16 +44,17 @@ import org.apache.rya.indexing.pcj.storage.PeriodicQueryResultStorage;
import org.apache.rya.indexing.pcj.storage.PeriodicQueryStorageException;
import org.apache.rya.indexing.pcj.storage.PeriodicQueryStorageMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.AggregateOperatorBase;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.AbstractAggregateOperator;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.base.Preconditions;
@@ -215,8 +216,9 @@ public class AccumuloPeriodicQueryResultStorage implements PeriodicQueryResultSt
}
private Text getRowPrefix(final long binId) throws BindingSetConversionException {
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding(PeriodicQueryResultStorage.PeriodicBinId, new LiteralImpl(Long.toString(binId), XMLSchema.LONG));
+ bs.addBinding(PeriodicQueryResultStorage.PeriodicBinId, vf.createLiteral(Long.toString(binId), XMLSchema.LONG));
return new Text(converter.convert(bs, new VariableOrder(PeriodicQueryResultStorage.PeriodicBinId)));
}
@@ -257,7 +259,7 @@ public class AccumuloPeriodicQueryResultStorage implements PeriodicQueryResultSt
* written to the table.
*
*/
- static class AggregateVariableRemover extends QueryModelVisitorBase<RuntimeException> {
+ static class AggregateVariableRemover extends AbstractQueryModelVisitor<RuntimeException> {
private Set<String> bindingNames;
@@ -270,7 +272,7 @@ public class AccumuloPeriodicQueryResultStorage implements PeriodicQueryResultSt
@Override
public void meet(final ExtensionElem node) {
- if(node.getExpr() instanceof AggregateOperatorBase) {
+ if(node.getExpr() instanceof AbstractAggregateOperator) {
bindingNames.remove(node.getName());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloValueBindingSetIterator.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloValueBindingSetIterator.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloValueBindingSetIterator.java
index c488d36..b539196 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloValueBindingSetIterator.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloValueBindingSetIterator.java
@@ -27,7 +27,7 @@ import org.apache.accumulo.core.data.Value;
import org.apache.fluo.api.data.Bytes;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.PeriodicQueryResultStorage;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
/**
* Implementation of CloseableIterator for retrieving results from a {@link PeriodicQueryResultStorage}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetConverter.java
index c920824..9130a75 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetConverter.java
@@ -18,8 +18,8 @@
*/
package org.apache.rya.indexing.pcj.storage.accumulo;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
index 4120fd9..45a1f61 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
@@ -26,15 +26,14 @@ import java.util.List;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import com.google.common.base.Joiner;
@@ -52,7 +51,7 @@ public class BindingSetStringConverter implements BindingSetConverter<String> {
public static final String TYPE_DELIM = "<<~>>";
public static final String NULL_VALUE_STRING = Character.toString( '\0' );
- private static final ValueFactory valueFactory = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
public String convert(final BindingSet bindingSet, final VariableOrder varOrder) {
@@ -124,12 +123,12 @@ public class BindingSetStringConverter implements BindingSetConverter<String> {
final String typeString = valueAndType[1];
// Convert the String Type into a URI that describes the type.
- final URI typeURI = valueFactory.createURI(typeString);
+ final IRI typeURI = VF.createIRI(typeString);
// Convert the String Value into a Value.
final Value value = typeURI.equals(XMLSchema.ANYURI) ?
- valueFactory.createURI(dataString) :
- valueFactory.createLiteral(dataString, new URIImpl(typeString));
+ VF.createIRI(dataString) :
+ VF.createLiteral(dataString, VF.createIRI(typeString));
return value;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTables.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTables.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTables.java
index 9346c00..2380ebb 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTables.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTables.java
@@ -59,14 +59,14 @@ import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageException;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
import com.google.common.base.Optional;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjVarOrderFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjVarOrderFactory.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjVarOrderFactory.java
index b699ab4..863895f 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjVarOrderFactory.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjVarOrderFactory.java
@@ -20,11 +20,11 @@ package org.apache.rya.indexing.pcj.storage.accumulo;
import java.util.Set;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import org.openrdf.query.MalformedQueryException;
-
/**
* Create alternative variable orders for a SPARQL query based on
* the original ordering of its results.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ScannerBindingSetIterator.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ScannerBindingSetIterator.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ScannerBindingSetIterator.java
index b457dfd..75446fd 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ScannerBindingSetIterator.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ScannerBindingSetIterator.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -29,7 +29,7 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactory.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactory.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactory.java
index e297ec9..b1a3e89 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactory.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactory.java
@@ -24,14 +24,14 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
+import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
+import edu.umd.cs.findbugs.annotations.NonNull;
+
/**
* Shifts the variables to the left so that each variable will appear at
* the head of the varOrder once.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VariableOrder.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VariableOrder.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VariableOrder.java
index 151db50..8a7d15b 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VariableOrder.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VariableOrder.java
@@ -23,7 +23,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import java.util.Iterator;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
index 5ddde85..3ba5e06 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDe.java
@@ -28,6 +28,7 @@ import org.apache.commons.io.serialization.ValidatingObjectInputStream;
import org.apache.fluo.api.data.Bytes;
import org.apache.rya.api.model.BindingSetDecorator;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.query.AbstractBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -67,20 +68,30 @@ public class VisibilityBindingSetSerDe {
requireNonNull(bytes);
try (final ValidatingObjectInputStream vois = new ValidatingObjectInputStream(new ByteArrayInputStream(bytes.toArray()))) {
// Perform input validation. Only the following classes are allowed to be deserialized.
- vois.accept(VisibilityBindingSet.class,
- BindingSetDecorator.class,
- org.openrdf.query.impl.MapBindingSet.class,
+ vois.accept(
+ VisibilityBindingSet.class,
+ java.lang.Byte.class,
+ java.lang.Double.class,
+ java.lang.Float.class,
+ java.lang.Integer.class,
+ java.lang.Long.class,
+ java.lang.Number.class,
+ java.lang.Short.class,
+ java.math.BigDecimal.class,
+ java.math.BigInteger.class,
java.util.LinkedHashMap.class,
java.util.HashMap.class,
- java.math.BigInteger.class,
- java.math.BigDecimal.class,
- java.lang.Number.class,
- org.openrdf.query.impl.BindingImpl.class,
- org.openrdf.model.impl.LiteralImpl.class,
- org.openrdf.model.impl.IntegerLiteralImpl.class,
- org.openrdf.model.impl.DecimalLiteralImpl.class,
- org.openrdf.model.impl.URIImpl.class,
- org.openrdf.query.algebra.evaluation.QueryBindingSet.class);
+ org.apache.rya.api.model.BindingSetDecorator.class,
+ org.eclipse.rdf4j.query.impl.SimpleBinding.class,
+ org.eclipse.rdf4j.model.impl.SimpleIRI.class,
+ org.eclipse.rdf4j.model.impl.SimpleLiteral.class,
+ org.eclipse.rdf4j.model.impl.IntegerLiteral.class,
+ org.eclipse.rdf4j.model.impl.DecimalLiteral.class,
+ org.eclipse.rdf4j.model.impl.NumericLiteral.class,
+ org.eclipse.rdf4j.query.AbstractBindingSet.class,
+ org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet.class,
+ org.eclipse.rdf4j.query.impl.MapBindingSet.class
+ );
vois.accept("[B");
final Object o = vois.readObject();
if(o instanceof VisibilityBindingSet) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverter.java
index becf1d5..3a4028f 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverter.java
@@ -18,12 +18,12 @@
*/
package org.apache.rya.indexing.pcj.storage.accumulo;
+import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
+
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.query.BindingSet;
-
/**
* Converts {@link BindingSet}s to Strings and back again. The Strings do not
* include the binding names and are ordered with a {@link VariableOrder}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoBindingSetConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoBindingSetConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoBindingSetConverter.java
index 010f8bc..92731ac 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoBindingSetConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoBindingSetConverter.java
@@ -20,7 +20,7 @@ package org.apache.rya.indexing.pcj.storage.mongo;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter;
import org.bson.Document;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocuments.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocuments.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocuments.java
index ecfbc1c..e81d49b 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocuments.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocuments.java
@@ -40,18 +40,19 @@ import org.apache.rya.indexing.pcj.storage.accumulo.ShiftVarOrderFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.bson.Document;
import org.bson.conversions.Bson;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.query.TupleQuery;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.QueryLanguage;
+import org.eclipse.rdf4j.query.TupleQuery;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
@@ -107,6 +108,7 @@ public class MongoPcjDocuments {
private final MongoCollection<Document> pcjCollection;
private static final PcjVarOrderFactory pcjVarOrderFactory = new ShiftVarOrderFactory();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* Creates a new {@link MongoPcjDocuments}.
@@ -418,7 +420,7 @@ public class MongoPcjDocuments {
} else if (!key.equals("_id") && !key.equals(PCJ_ID)) {
// is the binding value.
final Document typeDoc = (Document) bs.get(key);
- final URI dataType = new URIImpl(typeDoc.getString(BINDING_TYPE));
+ final IRI dataType = VF.createIRI(typeDoc.getString(BINDING_TYPE));
final RyaType type = new RyaType(dataType, typeDoc.getString(BINDING_VALUE));
final Value value = RyaToRdfConversions.convertValue(type);
binding.addBinding(key, value);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorage.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorage.java
index f4e4e9e..b484949 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorage.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorage.java
@@ -36,7 +36,7 @@ import org.apache.rya.indexing.pcj.storage.PCJIdFactory;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import com.mongodb.MongoClient;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializerTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializerTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializerTest.java
index d904d83..c1b85cf 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializerTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/AccumuloPcjSerializerTest.java
@@ -20,23 +20,20 @@ package org.apache.rya.indexing.pcj.storage.accumulo;
import static org.junit.Assert.assertEquals;
-import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer;
-import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter;
+import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
-import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-
-import org.apache.rya.api.resolver.RyaTypeResolverException;
/**
* Tests the methods of {@link AccumuloPcjSerialzer}.
*/
public class AccumuloPcjSerializerTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* The BindingSet has fewer Bindings than there are variables in the variable
@@ -47,8 +44,8 @@ public class AccumuloPcjSerializerTest {
public void serialize_bindingsSubsetOfVarOrder() throws BindingSetConversionException {
// Setup the Binding Set.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
// Setup the variable order.
final VariableOrder varOrder = new VariableOrder("x", "a", "y", "b");
@@ -73,9 +70,9 @@ public class AccumuloPcjSerializerTest {
public void serialize_bindingNotInVariableOrder() throws RyaTypeResolverException, BindingSetConversionException {
// Setup the Binding Set.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
- originalBindingSet.addBinding("z", new URIImpl("http://d"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
+ originalBindingSet.addBinding("z", VF.createIRI("http://d"));
// Setup the variable order.
final VariableOrder varOrder = new VariableOrder("x", "y");
@@ -89,8 +86,8 @@ public class AccumuloPcjSerializerTest {
// Show that it only contains the bindings that were part of the Variable Order.
MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new URIImpl("http://a"));
- expected.addBinding("y", new URIImpl("http://b"));
+ expected.addBinding("x", VF.createIRI("http://a"));
+ expected.addBinding("y", VF.createIRI("http://b"));
assertEquals(expected, deserialized);
}
@@ -98,8 +95,8 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicShortUriBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new URIImpl("http://uri1"));
- bs.addBinding("Y",new URIImpl("http://uri2"));
+ bs.addBinding("X", VF.createIRI("http://uri1"));
+ bs.addBinding("Y", VF.createIRI("http://uri2"));
final VariableOrder varOrder = new VariableOrder("X","Y");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
@@ -111,11 +108,11 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicLongUriBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new URIImpl("http://uri1"));
- bs.addBinding("Y",new URIImpl("http://uri2"));
- bs.addBinding("Z",new URIImpl("http://uri3"));
- bs.addBinding("A",new URIImpl("http://uri4"));
- bs.addBinding("B",new URIImpl("http://uri5"));
+ bs.addBinding("X", VF.createIRI("http://uri1"));
+ bs.addBinding("Y", VF.createIRI("http://uri2"));
+ bs.addBinding("Z",VF.createIRI("http://uri3"));
+ bs.addBinding("A", VF.createIRI("http://uri4"));
+ bs.addBinding("B", VF.createIRI("http://uri5"));
final VariableOrder varOrder = new VariableOrder("X","Y","Z","A","B");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
@@ -127,8 +124,8 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicShortStringLiteralBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new LiteralImpl("literal1"));
- bs.addBinding("Y",new LiteralImpl("literal2"));
+ bs.addBinding("X", VF.createLiteral("literal1"));
+ bs.addBinding("Y", VF.createLiteral("literal2"));
final VariableOrder varOrder = new VariableOrder("X","Y");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
@@ -140,8 +137,8 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicShortMixLiteralBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new LiteralImpl("literal1"));
- bs.addBinding("Y",new LiteralImpl("5", new URIImpl("http://www.w3.org/2001/XMLSchema#integer")));
+ bs.addBinding("X",VF.createLiteral("literal1"));
+ bs.addBinding("Y",VF.createLiteral("5", VF.createIRI("http://www.w3.org/2001/XMLSchema#integer")));
final VariableOrder varOrder = new VariableOrder("X","Y");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
@@ -153,10 +150,10 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicLongMixLiteralBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new LiteralImpl("literal1"));
- bs.addBinding("Y",new LiteralImpl("5", new URIImpl("http://www.w3.org/2001/XMLSchema#integer")));
- bs.addBinding("Z",new LiteralImpl("5.0", new URIImpl("http://www.w3.org/2001/XMLSchema#double")));
- bs.addBinding("W",new LiteralImpl("1000", new URIImpl("http://www.w3.org/2001/XMLSchema#long")));
+ bs.addBinding("X", VF.createLiteral("literal1"));
+ bs.addBinding("Y", VF.createLiteral("5", VF.createIRI("http://www.w3.org/2001/XMLSchema#integer")));
+ bs.addBinding("Z", VF.createLiteral("5.0", VF.createIRI("http://www.w3.org/2001/XMLSchema#double")));
+ bs.addBinding("W", VF.createLiteral("1000", VF.createIRI("http://www.w3.org/2001/XMLSchema#long")));
final VariableOrder varOrder = new VariableOrder("W","X","Y","Z");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
@@ -168,13 +165,13 @@ public class AccumuloPcjSerializerTest {
@Test
public void basicMixUriLiteralBsTest() throws BindingSetConversionException {
final QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("X",new LiteralImpl("literal1"));
- bs.addBinding("Y",new LiteralImpl("5", new URIImpl("http://www.w3.org/2001/XMLSchema#integer")));
- bs.addBinding("Z",new LiteralImpl("5.0", new URIImpl("http://www.w3.org/2001/XMLSchema#double")));
- bs.addBinding("W",new LiteralImpl("1000", new URIImpl("http://www.w3.org/2001/XMLSchema#long")));
- bs.addBinding("A",new URIImpl("http://uri1"));
- bs.addBinding("B",new URIImpl("http://uri2"));
- bs.addBinding("C",new URIImpl("http://uri3"));
+ bs.addBinding("X", VF.createLiteral("literal1"));
+ bs.addBinding("Y", VF.createLiteral("5", VF.createIRI("http://www.w3.org/2001/XMLSchema#integer")));
+ bs.addBinding("Z", VF.createLiteral("5.0", VF.createIRI("http://www.w3.org/2001/XMLSchema#double")));
+ bs.addBinding("W", VF.createLiteral("1000", VF.createIRI("http://www.w3.org/2001/XMLSchema#long")));
+ bs.addBinding("A", VF.createIRI("http://uri1"));
+ bs.addBinding("B", VF.createIRI("http://uri2"));
+ bs.addBinding("C", VF.createIRI("http://uri3"));
final VariableOrder varOrder = new VariableOrder("A","W","X","Y","Z","B","C");
BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
[16/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverterTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverterTest.java
index b263038..3ec2766 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverterTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverterTest.java
@@ -24,18 +24,17 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.BooleanLiteralImpl;
-import org.openrdf.model.impl.DecimalLiteralImpl;
-import org.openrdf.model.impl.IntegerLiteralImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Tests the methods of {@link BindingSetStringConverter}.
*/
public class BindingSetStringConverterTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void noBindings() throws BindingSetConversionException {
@@ -58,9 +57,9 @@ public class BindingSetStringConverterTest {
public void toString_URIs() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
- originalBindingSet.addBinding("z", new URIImpl("http://c"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
+ originalBindingSet.addBinding("z", VF.createIRI("http://c"));
// Convert it to a String.
final VariableOrder varOrder = new VariableOrder("y", "z", "x");
@@ -80,7 +79,7 @@ public class BindingSetStringConverterTest {
public void toString_Decimal() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new DecimalLiteralImpl(new BigDecimal(2.5)));
+ originalBindingSet.addBinding("x", VF.createLiteral(new BigDecimal(2.5)));
// Convert it to a String.
final VariableOrder varOrder = new VariableOrder("x");
@@ -96,7 +95,7 @@ public class BindingSetStringConverterTest {
public void toString_Boolean() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new BooleanLiteralImpl(true));
+ originalBindingSet.addBinding("x", VF.createLiteral((true)));
// Convert it to a String.
final VariableOrder varOrder = new VariableOrder("x");
@@ -112,7 +111,7 @@ public class BindingSetStringConverterTest {
public void toString_Integer() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new IntegerLiteralImpl(BigInteger.valueOf(5)));
+ originalBindingSet.addBinding("x", VF.createLiteral((BigInteger.valueOf(5))));
// Convert it to a String.
final VariableOrder varOrder = new VariableOrder("x");
@@ -132,8 +131,8 @@ public class BindingSetStringConverterTest {
public void toString_bindingsMatchVarOrder() throws BindingSetConversionException {
// Setup the Binding Set.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
// Setup the variable order.
final VariableOrder varOrder = new VariableOrder("x", "y");
@@ -158,8 +157,8 @@ public class BindingSetStringConverterTest {
public void toString_bindingsSubsetOfVarOrder() throws BindingSetConversionException {
// Setup the Binding Set.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
// Setup the variable order.
final VariableOrder varOrder = new VariableOrder("x", "a", "y", "b");
@@ -192,9 +191,9 @@ public class BindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new URIImpl("http://a"));
- expected.addBinding("y", new URIImpl("http://b"));
- expected.addBinding("z", new URIImpl("http://c"));
+ expected.addBinding("x", VF.createIRI("http://a"));
+ expected.addBinding("y", VF.createIRI("http://b"));
+ expected.addBinding("z", VF.createIRI("http://c"));
assertEquals(expected, bindingSet);
}
@@ -219,8 +218,8 @@ public class BindingSetStringConverterTest {
// Ensure it converted to the expected reuslt.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new URIImpl("http://value 1"));
- expected.addBinding("y", new URIImpl("http://value 2"));
+ expected.addBinding("x", VF.createIRI("http://value 1"));
+ expected.addBinding("y", VF.createIRI("http://value 2"));
assertEquals(expected, bindingSet);
}
@@ -236,7 +235,7 @@ public class BindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new DecimalLiteralImpl(new BigDecimal(2.5)));
+ expected.addBinding("x", VF.createLiteral((new BigDecimal(2.5))));
assertEquals(expected, bindingSet);
}
@@ -252,7 +251,7 @@ public class BindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new BooleanLiteralImpl(true));
+ expected.addBinding("x", VF.createLiteral((true)));
assertEquals(expected, bindingSet);
}
@@ -268,7 +267,7 @@ public class BindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("x", new IntegerLiteralImpl(BigInteger.valueOf(5)));
+ expected.addBinding("x", VF.createLiteral((BigInteger.valueOf(5))));
assertEquals(expected, bindingSet);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
index b95c812..f142b77 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesIT.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
+import java.math.BigInteger;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Set;
@@ -53,21 +54,18 @@ import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingS
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.zookeeper.ClientCnxn;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
import com.google.common.base.Optional;
import com.google.common.collect.HashMultimap;
@@ -84,6 +82,7 @@ public class PcjTablesIT {
private static final String CLOUDBASE_INSTANCE = "sc.cloudbase.instancename";
private static final String CLOUDBASE_USER = "sc.cloudbase.username";
private static final String CLOUDBASE_PASSWORD = "sc.cloudbase.password";
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private static final AccumuloPcjSerializer converter = new AccumuloPcjSerializer();
@@ -209,19 +208,19 @@ public class PcjTablesIT {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- final Set<BindingSet> results = Sets.<BindingSet>newHashSet(alice, bob, charlie);
- pcjs.addResults(accumuloConn, pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
+ final Set<BindingSet> results = Sets.newHashSet(alice, bob, charlie);
+ pcjs.addResults(accumuloConn, pcjTableName, Sets.newHashSet(
new VisibilityBindingSet(alice),
new VisibilityBindingSet(bob),
new VisibilityBindingSet(charlie)));
@@ -260,18 +259,18 @@ public class PcjTablesIT {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- pcjs.addResults(accumuloConn, pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
+ pcjs.addResults(accumuloConn, pcjTableName, Sets.newHashSet(
new VisibilityBindingSet(alice),
new VisibilityBindingSet(bob),
new VisibilityBindingSet(charlie)));
@@ -289,7 +288,7 @@ public class PcjTablesIT {
}
// Verify the fetched results match the expected ones.
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(alice, bob, charlie);
+ final Set<BindingSet> expected = Sets.newHashSet(alice, bob, charlie);
assertEquals(expected, results);
}
@@ -297,20 +296,20 @@ public class PcjTablesIT {
* Ensure when results are already stored in Rya, that we are able to populate
* the PCJ table for a new SPARQL query using those results.
* <p>
- * The method being tested is: {@link PcjTables#populatePcj(Connector, String, RepositoryConnection, String)}
+ * The method being tested is: {@link PcjTables#populatePcj(Connector, String, RepositoryConnection)}
*/
@Test
public void populatePcj() throws RepositoryException, PcjException, TableNotFoundException, BindingSetConversionException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(43))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -344,18 +343,18 @@ public class PcjTablesIT {
// Ensure the expected results match those that were stored.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- final Set<BindingSet> results = Sets.<BindingSet>newHashSet(alice, bob, charlie);
+ final Set<BindingSet> results = Sets.newHashSet(alice, bob, charlie);
final Multimap<String, BindingSet> expectedResults = HashMultimap.create();
expectedResults.putAll("name;age", results);
@@ -373,14 +372,14 @@ public class PcjTablesIT {
public void createAndPopulatePcj() throws RepositoryException, PcjException, TableNotFoundException, BindingSetConversionException, AccumuloException, AccumuloSecurityException {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(14)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(16)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(12)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(43)) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -401,7 +400,7 @@ public class PcjTablesIT {
// Create and populate the PCJ table.
final PcjTables pcjs = new PcjTables();
- pcjs.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.<PcjVarOrderFactory>absent());
+ pcjs.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"name", "age"}, Optional.absent());
// Make sure the cardinality was updated.
final PcjMetadata metadata = pcjs.getPcjMetadata(accumuloConn, pcjTableName);
@@ -412,18 +411,18 @@ public class PcjTablesIT {
// Ensure the expected results match those that were stored.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- final Set<BindingSet> results = Sets.<BindingSet>newHashSet(alice, bob, charlie);
+ final Set<BindingSet> results = Sets.newHashSet(alice, bob, charlie);
final Multimap<String, BindingSet> expectedResults = HashMultimap.create();
expectedResults.putAll("name;age", results);
@@ -487,18 +486,18 @@ public class PcjTablesIT {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
- pcjs.addResults(accumuloConn, pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
+ pcjs.addResults(accumuloConn, pcjTableName, Sets.newHashSet(
new VisibilityBindingSet(alice),
new VisibilityBindingSet(bob),
new VisibilityBindingSet(charlie)));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesWithMockTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesWithMockTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesWithMockTest.java
index bbd0f11..cec64fe 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesWithMockTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/PcjTablesWithMockTest.java
@@ -16,21 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-
package org.apache.rya.indexing.pcj.storage.accumulo;
import static org.junit.Assert.assertEquals;
+import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.AccumuloRyaDAO;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
-import org.apache.rya.rdftriplestore.RyaSailRepository;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
@@ -39,20 +32,22 @@ import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.mock.MockInstance;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.log4j.Logger;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.AccumuloRyaDAO;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.indexing.pcj.storage.PcjException;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
+import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
+import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.base.Optional;
@@ -69,6 +64,7 @@ public class PcjTablesWithMockTest {
private Connector accumuloConn;
private RyaSailRepository ryaRepo;
private SailRepositoryConnection ryaConn;
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Before
public void init() throws AccumuloException, AccumuloSecurityException, RepositoryException {
@@ -79,39 +75,39 @@ public class PcjTablesWithMockTest {
}
- @Test
- public void populatePcj() throws RepositoryException, PcjException, TableNotFoundException, BindingSetConversionException {
- // Load some Triples into Rya.
- final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
-
- for(final Statement triple : triples) {
- ryaConn.add(triple);
- }
-
- // Create a PCJ table that will include those triples in its results.
- final String sparql =
- "SELECT ?name ?age " +
- "{" +
- "?name <http://hasAge> ?age." +
- "?name <http://playsSport> \"Soccer\" " +
- "}";
-
- final String pcjTableName = new PcjTableNameFactory().makeTableName(RYA_TABLE_PREFIX, "testPcj");
- final PcjTables pcjs = new PcjTables();
- pcjs.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"age","name"}, Optional.<PcjVarOrderFactory>absent());
-
- // Make sure the cardinality was updated.
- final PcjMetadata metadata = pcjs.getPcjMetadata(accumuloConn, pcjTableName);
- assertEquals(4, metadata.getCardinality());
- }
+ @Test
+ public void populatePcj() throws RepositoryException, PcjException, TableNotFoundException, BindingSetConversionException {
+ // Load some Triples into Rya.
+ final Set<Statement> triples = new HashSet<>();
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral((43))));
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+
+ for(final Statement triple : triples) {
+ ryaConn.add(triple);
+ }
+
+ // Create a PCJ table that will include those triples in its results.
+ final String sparql =
+ "SELECT ?name ?age " +
+ "{" +
+ "?name <http://hasAge> ?age." +
+ "?name <http://playsSport> \"Soccer\" " +
+ "}";
+
+ final String pcjTableName = new PcjTableNameFactory().makeTableName(RYA_TABLE_PREFIX, "testPcj");
+ final PcjTables pcjs = new PcjTables();
+ pcjs.createAndPopulatePcj(ryaConn, accumuloConn, pcjTableName, sparql, new String[]{"age","name"}, Optional.absent());
+
+ // Make sure the cardinality was updated.
+ final PcjMetadata metadata = pcjs.getPcjMetadata(accumuloConn, pcjTableName);
+ assertEquals(4, metadata.getCardinality());
+ }
@After
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactoryTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactoryTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactoryTest.java
index 68515f6..b41aba3 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactoryTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/ShiftVarOrderFactoryTest.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -22,8 +22,8 @@ import static org.junit.Assert.assertEquals;
import java.util.Set;
+import org.eclipse.rdf4j.query.MalformedQueryException;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDeTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDeTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDeTest.java
index b32331c..758965e 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDeTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetSerDeTest.java
@@ -28,12 +28,12 @@ import java.util.ArrayList;
import org.apache.fluo.api.data.Bytes;
import org.apache.rya.api.model.VisibilityBindingSet;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Tests the methods of {@link VisibilityBindingSetSerDe}.
@@ -42,7 +42,7 @@ public class VisibilityBindingSetSerDeTest {
@Test
public void rountTrip() throws Exception {
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final MapBindingSet bs = new MapBindingSet();
bs.addBinding("name", vf.createLiteral("Alice"));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverterTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverterTest.java
index 40e3322..c9252b0 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverterTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/VisibilityBindingSetStringConverterTest.java
@@ -23,23 +23,25 @@ import static org.junit.Assert.assertEquals;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.storage.accumulo.BindingSetConverter.BindingSetConversionException;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Tests the methods of {@link BindingSetStringConverter}.
*/
public class VisibilityBindingSetStringConverterTest {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void toString_URIs() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
- originalBindingSet.addBinding("z", new URIImpl("http://c"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
+ originalBindingSet.addBinding("z", VF.createIRI("http://c"));
final VisibilityBindingSet visiSet = new VisibilityBindingSet(originalBindingSet, "A&B&C");
@@ -74,9 +76,9 @@ public class VisibilityBindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("z", new URIImpl("http://c"));
- expected.addBinding("y", new URIImpl("http://b"));
- expected.addBinding("x", new URIImpl("http://a"));
+ expected.addBinding("z", VF.createIRI("http://c"));
+ expected.addBinding("y", VF.createIRI("http://b"));
+ expected.addBinding("x", VF.createIRI("http://a"));
final VisibilityBindingSet visiSet = new VisibilityBindingSet(expected, "A&B");
assertEquals(visiSet, bindingSet);
@@ -86,9 +88,9 @@ public class VisibilityBindingSetStringConverterTest {
public void toString_URIs_noVisi() throws BindingSetConversionException {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet = new MapBindingSet();
- originalBindingSet.addBinding("x", new URIImpl("http://a"));
- originalBindingSet.addBinding("y", new URIImpl("http://b"));
- originalBindingSet.addBinding("z", new URIImpl("http://c"));
+ originalBindingSet.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet.addBinding("y", VF.createIRI("http://b"));
+ originalBindingSet.addBinding("z", VF.createIRI("http://c"));
final VisibilityBindingSet visiSet = new VisibilityBindingSet(originalBindingSet);
@@ -121,9 +123,9 @@ public class VisibilityBindingSetStringConverterTest {
// Ensure it converted to the expected result.
final MapBindingSet expected = new MapBindingSet();
- expected.addBinding("z", new URIImpl("http://c"));
- expected.addBinding("y", new URIImpl("http://b"));
- expected.addBinding("x", new URIImpl("http://a"));
+ expected.addBinding("z", VF.createIRI("http://c"));
+ expected.addBinding("y", VF.createIRI("http://b"));
+ expected.addBinding("x", VF.createIRI("http://a"));
final VisibilityBindingSet visiSet = new VisibilityBindingSet(expected);
assertEquals(visiSet, bindingSet);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPcjStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPcjStorageIT.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPcjStorageIT.java
index 33571f7..8968898 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPcjStorageIT.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPcjStorageIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -46,11 +46,12 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageExce
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.ShiftVarOrderFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.ImmutableMap;
@@ -61,13 +62,14 @@ import com.google.common.collect.ImmutableMap;
* also update the Rya instance's details.
*/
public class AccumuloPcjStorageIT extends AccumuloRyaITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void createPCJ() throws AccumuloException, AccumuloSecurityException, PCJStorageException, NotInitializedException, RyaDetailsRepositoryException {
// Setup the PCJ storage that will be tested against.
final Connector connector = super.getClusterInstance().getConnector();
final String ryaInstanceName = super.getRyaInstanceName();
- try(final PrecomputedJoinStorage pcjStorage = new AccumuloPcjStorage(connector, ryaInstanceName)) {
+ try(final PrecomputedJoinStorage pcjStorage = new AccumuloPcjStorage(connector, ryaInstanceName)) {
// Create a PCJ.
final String pcjId = pcjStorage.createPcj("SELECT * WHERE { ?a <http://isA> ?b } ");
@@ -171,13 +173,13 @@ public class AccumuloPcjStorageIT extends AccumuloRyaITBase {
final Set<VisibilityBindingSet> results = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
results.add( new VisibilityBindingSet(aliceBS, "") );
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
results.add( new VisibilityBindingSet(charlieBS, "") );
pcjStorage.addResults(pcjId, results);
@@ -205,13 +207,13 @@ public class AccumuloPcjStorageIT extends AccumuloRyaITBase {
final Set<VisibilityBindingSet> storedResults = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
storedResults.add( new VisibilityBindingSet(aliceBS, "") );
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
storedResults.add( new VisibilityBindingSet(charlieBS, "") );
pcjStorage.addResults(pcjId, storedResults);
@@ -247,13 +249,13 @@ public class AccumuloPcjStorageIT extends AccumuloRyaITBase {
final Set<VisibilityBindingSet> expectedResults = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
expectedResults.add( new VisibilityBindingSet(aliceBS, "") );
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
expectedResults.add( new VisibilityBindingSet(charlieBS, "") );
pcjStorage.addResults(pcjId, expectedResults);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPeriodicQueryResultStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPeriodicQueryResultStorageIT.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPeriodicQueryResultStorageIT.java
index 2d9da4d..723c700 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPeriodicQueryResultStorageIT.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/accumulo/integration/AccumuloPeriodicQueryResultStorageIT.java
@@ -37,22 +37,22 @@ import org.apache.rya.indexing.pcj.storage.PeriodicQueryStorageMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPeriodicQueryResultStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.PeriodicQueryTableNameFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.impl.MapBindingSet;
public class AccumuloPeriodicQueryResultStorageIT extends AccumuloITBase {
private PeriodicQueryResultStorage periodicStorage;
private static final String RYA = "rya_";
private static final PeriodicQueryTableNameFactory nameFactory = new PeriodicQueryTableNameFactory();
- private static final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Before
public void init() throws AccumuloException, AccumuloSecurityException {
@@ -86,15 +86,15 @@ public class AccumuloPeriodicQueryResultStorageIT extends AccumuloITBase {
//add result matching user's visibility
QueryBindingSet bs = new QueryBindingSet();
- bs.addBinding("periodicBinId", vf.createLiteral(1L));
- bs.addBinding("x",vf.createURI("uri:uri123"));
+ bs.addBinding("periodicBinId", VF.createLiteral(1L));
+ bs.addBinding("x", VF.createIRI("uri:uri123"));
expected.add(bs);
storageSet.add(new VisibilityBindingSet(bs,"U"));
//add result with different visibility that is not expected
bs = new QueryBindingSet();
- bs.addBinding("periodicBinId", vf.createLiteral(1L));
- bs.addBinding("x",vf.createURI("uri:uri456"));
+ bs.addBinding("periodicBinId", VF.createLiteral(1L));
+ bs.addBinding("x", VF.createIRI("uri:uri456"));
storageSet.add(new VisibilityBindingSet(bs,"V"));
periodicStorage.addPeriodicQueryResults(id, storageSet);
@@ -129,7 +129,6 @@ public class AccumuloPeriodicQueryResultStorageIT extends AccumuloITBase {
+ "?obs <uri:hasId> ?id } group by ?id"; //n
- final ValueFactory vf = new ValueFactoryImpl();
long currentTime = System.currentTimeMillis();
String queryId = UUID.randomUUID().toString().replace("-", "");
@@ -144,72 +143,72 @@ public class AccumuloPeriodicQueryResultStorageIT extends AccumuloITBase {
long binId = (currentTime/period)*period;
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_1", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId));
+ bs.addBinding("total", VF.createLiteral("2", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_1", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId));
expected1.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_2", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId));
+ bs.addBinding("total", VF.createLiteral("2", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_2", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId));
expected1.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_3", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_3", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId));
expected1.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_4", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_4", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId));
expected1.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_1", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + period));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_1", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + period));
expected2.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("2", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_2", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + period));
+ bs.addBinding("total", VF.createLiteral("2", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_2", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + period));
expected2.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_3", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + period));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_3", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + period));
expected2.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_1", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + 2*period));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_1", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + 2*period));
expected3.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_2", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + 2*period));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_2", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + 2*period));
expected3.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
bs = new MapBindingSet();
- bs.addBinding("total", vf.createLiteral("1", XMLSchema.INTEGER));
- bs.addBinding("id", vf.createLiteral("id_1", XMLSchema.STRING));
- bs.addBinding("periodicBinId", vf.createLiteral(binId + 3*period));
+ bs.addBinding("total", VF.createLiteral("1", XMLSchema.INTEGER));
+ bs.addBinding("id", VF.createLiteral("id_1", XMLSchema.STRING));
+ bs.addBinding("periodicBinId", VF.createLiteral(binId + 3*period));
expected4.add(bs);
storageResults.add(new VisibilityBindingSet(bs));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocumentsTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocumentsTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocumentsTest.java
index f522fac..0596daf 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocumentsTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjDocumentsTest.java
@@ -28,14 +28,17 @@ import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.mongodb.MongoITBase;
import org.bson.Document;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
public class MongoPcjDocumentsTest extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
@Test
public void pcjToMetadata() throws Exception {
final MongoPcjDocuments docConverter = new MongoPcjDocuments(getMongoClient(), conf.getRyaInstanceName());
@@ -62,16 +65,16 @@ public class MongoPcjDocumentsTest extends MongoITBase {
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet1 = new MapBindingSet();
- originalBindingSet1.addBinding("x", new URIImpl("http://a"));
- originalBindingSet1.addBinding("y", new URIImpl("http://b"));
- originalBindingSet1.addBinding("z", new URIImpl("http://c"));
+ originalBindingSet1.addBinding("x", VF.createIRI("http://a"));
+ originalBindingSet1.addBinding("y", VF.createIRI("http://b"));
+ originalBindingSet1.addBinding("z", VF.createIRI("http://c"));
final VisibilityBindingSet results1 = new VisibilityBindingSet(originalBindingSet1, "A&B&C");
// Setup the binding set that will be converted.
final MapBindingSet originalBindingSet2 = new MapBindingSet();
- originalBindingSet2.addBinding("x", new URIImpl("http://1"));
- originalBindingSet2.addBinding("y", new URIImpl("http://2"));
- originalBindingSet2.addBinding("z", new URIImpl("http://3"));
+ originalBindingSet2.addBinding("x", VF.createIRI("http://1"));
+ originalBindingSet2.addBinding("y", VF.createIRI("http://2"));
+ originalBindingSet2.addBinding("z", VF.createIRI("http://3"));
final VisibilityBindingSet results2 = new VisibilityBindingSet(originalBindingSet2, "A&B&C");
final List<VisibilityBindingSet> bindingSets = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorageIT.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorageIT.java
index 6747558..d87f597 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorageIT.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/MongoPcjStorageIT.java
@@ -45,10 +45,11 @@ import org.apache.rya.indexing.pcj.storage.accumulo.ShiftVarOrderFactory;
import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder;
import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.mongodb.instance.MongoRyaInstanceDetailsRepository;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
@@ -60,6 +61,7 @@ import com.google.common.collect.ImmutableMap;
* also update the Rya instance's details.
*/
public class MongoPcjStorageIT extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test
public void createPCJ() throws Exception {
@@ -219,13 +221,13 @@ public class MongoPcjStorageIT extends MongoITBase {
final Set<VisibilityBindingSet> results = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
results.add( new VisibilityBindingSet(aliceBS, "") );
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
results.add( new VisibilityBindingSet(charlieBS, "") );
pcjStorage.addResults(pcjId, results);
@@ -264,14 +266,14 @@ public class MongoPcjStorageIT extends MongoITBase {
final Set<BindingSet> expectedResults = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
visiSets.add( new VisibilityBindingSet(aliceBS, "") );
expectedResults.add(aliceBS);
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
visiSets.add( new VisibilityBindingSet(charlieBS, "") );
expectedResults.add(charlieBS);
@@ -313,13 +315,13 @@ public class MongoPcjStorageIT extends MongoITBase {
final Set<VisibilityBindingSet> expectedResults = new HashSet<>();
final MapBindingSet aliceBS = new MapBindingSet();
- aliceBS.addBinding("a", new URIImpl("http://Alice"));
- aliceBS.addBinding("b", new URIImpl("http://Person"));
+ aliceBS.addBinding("a", VF.createIRI("http://Alice"));
+ aliceBS.addBinding("b", VF.createIRI("http://Person"));
expectedResults.add( new VisibilityBindingSet(aliceBS, "") );
final MapBindingSet charlieBS = new MapBindingSet();
- charlieBS.addBinding("a", new URIImpl("http://Charlie"));
- charlieBS.addBinding("b", new URIImpl("http://Comedian"));
+ charlieBS.addBinding("a", VF.createIRI("http://Charlie"));
+ charlieBS.addBinding("b", VF.createIRI("http://Comedian"));
expectedResults.add( new VisibilityBindingSet(charlieBS, "") );
pcjStorage.addResults(pcjId, expectedResults);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsIntegrationTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsIntegrationTest.java
index 0c71c9f..e326339 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsIntegrationTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsIntegrationTest.java
@@ -20,6 +20,7 @@ package org.apache.rya.indexing.pcj.storage.mongo;
import static org.junit.Assert.assertEquals;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -45,17 +46,14 @@ import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepositoryConnection;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -65,6 +63,8 @@ import com.google.common.collect.Sets;
* functions of {@link PcjTables} work within a cluster setting.
*/
public class PcjDocumentsIntegrationTest extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
@Override
protected void updateConfiguration(final MongoDBRdfConfiguration conf) {
conf.setDisplayQueryPlan(true);
@@ -119,16 +119,16 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(alice, bob, charlie);
pcjs.addResults(pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
@@ -161,16 +161,16 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
pcjs.addResults(pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
new VisibilityBindingSet(alice),
@@ -214,14 +214,14 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
try {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(43))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -251,16 +251,16 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
// Ensure the expected results match those that were stored.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(alice, bob, charlie);
@@ -291,14 +291,14 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
try {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(43))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
@@ -328,16 +328,16 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
// Ensure the expected results match those that were stored.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(alice, bob, charlie);
@@ -397,16 +397,16 @@ public class PcjDocumentsIntegrationTest extends MongoITBase {
// Add a few results to the PCJ table.
final MapBindingSet alice = new MapBindingSet();
- alice.addBinding("name", new URIImpl("http://Alice"));
- alice.addBinding("age", new NumericLiteralImpl(14, XMLSchema.INTEGER));
+ alice.addBinding("name", VF.createIRI("http://Alice"));
+ alice.addBinding("age", VF.createLiteral(BigInteger.valueOf(14)));
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("name", new URIImpl("http://Bob"));
- bob.addBinding("age", new NumericLiteralImpl(16, XMLSchema.INTEGER));
+ bob.addBinding("name", VF.createIRI("http://Bob"));
+ bob.addBinding("age", VF.createLiteral(BigInteger.valueOf(16)));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("name", new URIImpl("http://Charlie"));
- charlie.addBinding("age", new NumericLiteralImpl(12, XMLSchema.INTEGER));
+ charlie.addBinding("name", VF.createIRI("http://Charlie"));
+ charlie.addBinding("age", VF.createLiteral(BigInteger.valueOf(12)));
pcjs.addResults(pcjTableName, Sets.<VisibilityBindingSet>newHashSet(
new VisibilityBindingSet(alice),
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsWithMockTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsWithMockTest.java b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsWithMockTest.java
index a3ba747..2666b85 100644
--- a/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsWithMockTest.java
+++ b/extras/rya.indexing.pcj/src/test/java/org/apache/rya/indexing/pcj/storage/mongo/PcjDocumentsWithMockTest.java
@@ -22,6 +22,7 @@ package org.apache.rya.indexing.pcj.storage.mongo;
import static org.junit.Assert.assertEquals;
+import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
@@ -33,16 +34,15 @@ import org.apache.rya.mongodb.MongoITBase;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
import org.apache.rya.rdftriplestore.RdfCloudTripleStore;
import org.apache.rya.rdftriplestore.RyaSailRepository;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.impl.LiteralImpl;
-import org.openrdf.model.impl.NumericLiteralImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.URIImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.repository.sail.SailRepositoryConnection;
public class PcjDocumentsWithMockTest extends MongoITBase {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
@Override
protected void updateConfiguration(final MongoDBRdfConfiguration conf) {
conf.setDisplayQueryPlan(false);
@@ -61,14 +61,14 @@ public class PcjDocumentsWithMockTest extends MongoITBase {
try {
// Load some Triples into Rya.
final Set<Statement> triples = new HashSet<>();
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://hasAge"), new NumericLiteralImpl(14, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Alice"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://hasAge"), new NumericLiteralImpl(16, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Bob"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://hasAge"), new NumericLiteralImpl(12, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Charlie"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://hasAge"), new NumericLiteralImpl(43, XMLSchema.INTEGER)) );
- triples.add( new StatementImpl(new URIImpl("http://Eve"), new URIImpl("http://playsSport"), new LiteralImpl("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(14))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Alice"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(16))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Bob"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(12))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Charlie"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://hasAge"), VF.createLiteral(BigInteger.valueOf(43))) );
+ triples.add( VF.createStatement(VF.createIRI("http://Eve"), VF.createIRI("http://playsSport"), VF.createLiteral("Soccer")) );
for(final Statement triple : triples) {
ryaConn.add(triple);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/alx.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/alx.md b/extras/rya.manual/src/site/markdown/alx.md
index ca28501..a6486f4 100644
--- a/extras/rya.manual/src/site/markdown/alx.md
+++ b/extras/rya.manual/src/site/markdown/alx.md
@@ -57,8 +57,8 @@ The bundle registers a Sail Repository, so you can interact with it directly as
``` JAVA
import org.springframework.osgi.extensions.annotation.*;
-import org.openrdf.repository.*;
-import org.openrdf.model.ValueFactory;
+import org.eclipse.rdf4j.repository.*;
+import org.eclipse.rdf4j.model.ValueFactory;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.*;
class TstRepo {
@@ -68,7 +68,7 @@ class TstRepo {
println repo
RepositoryConnection conn = repo.getConnection();
ValueFactory vf = VALUE_FACTORY;
- def statements = conn.getStatements(vf.createURI("http://www.Department0.University0.edu"), null, null, true);
+ def statements = conn.getStatements(vf.createIRI("http://www.Department0.University0.edu"), null, null, true);
while(statements.hasNext()) {
System.out.println(statements.next());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/loaddata.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/loaddata.md b/extras/rya.manual/src/site/markdown/loaddata.md
index 5d3f298..e5c7bd2 100644
--- a/extras/rya.manual/src/site/markdown/loaddata.md
+++ b/extras/rya.manual/src/site/markdown/loaddata.md
@@ -106,7 +106,7 @@ Options:
- rdf.tablePrefix : The tables (spo, po, osp) are prefixed with this qualifier. The tables become: (rdf.tablePrefix)spo,(rdf.tablePrefix)po,(rdf.tablePrefix)osp
- ac.* : Accumulo connection parameters
-- rdf.format : See RDFFormat from openrdf, samples include (Trig, N-Triples, RDF/XML)
+- rdf.format : See RDFFormat from RDF4J, samples include (Trig, N-Triples, RDF/XML)
- sc.use_freetext, sc.use_geo, sc.use_temporal, sc.use_entity : If any of these are set to true, statements will also be
added to the enabled secondary indices.
- sc.freetext.predicates, sc.geo.predicates, sc.temporal.predicates: If the associated indexer is enabled, these options specify
@@ -116,9 +116,9 @@ Options:
The argument is the directory/file to load. This file needs to be loaded into HDFS before running. If loading a directory, all files should have the same RDF
format.
-## Direct OpenRDF API
+## Direct RDF4J API
-Here is some sample code to load data directly through the OpenRDF API. (Loading N-Triples data)
+Here is some sample code to load data directly through the RDF4J API. (Loading N-Triples data)
You will need at least `accumulo.rya-<version>`, `rya.api`, `rya.sail.impl` on the classpath and transitive dependencies. I find that Maven is the easiest way to get a project dependency tree set up.
``` JAVA
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/mapreduce.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/mapreduce.md b/extras/rya.manual/src/site/markdown/mapreduce.md
index f99a78f..ec2bdc8 100644
--- a/extras/rya.manual/src/site/markdown/mapreduce.md
+++ b/extras/rya.manual/src/site/markdown/mapreduce.md
@@ -37,7 +37,7 @@ Input formats are provided for reading triple data from Rya or from RDF files:
- *RdfFileInputFormat* will read and parse RDF files of any format. Format must
be explicitly specified. Reading and parsing is done asynchronously, enabling
- large input files depending on how much information the openrdf parser itself
+ large input files depending on how much information the RDF4J parser itself
needs to hold in memory in order to parse the file. (For example, large
N-Triples files can be handled easily, but large XML files might require you
to allocate more memory for the Map task.) Handles multiple files if given a
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/overview.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/overview.md b/extras/rya.manual/src/site/markdown/overview.md
index 46da734..2ce3dc8 100644
--- a/extras/rya.manual/src/site/markdown/overview.md
+++ b/extras/rya.manual/src/site/markdown/overview.md
@@ -21,6 +21,6 @@
-->
# Overview
-Apache Rya is a scalable RDF Store that is built on top of a Columnar Index Store (such as Accumulo). It is implemented as an extension to OpenRdf to provide easy query mechanisms (SPARQL, SERQL, etc) and Rdf data storage (RDF/XML, NTriples, etc).
+Apache Rya is a scalable RDF Store that is built on top of a Columnar Index Store (such as Accumulo). It is implemented as an extension to RDF4J to provide easy query mechanisms (SPARQL, SERQL, etc) and Rdf data storage (RDF/XML, NTriples, etc).
Rya stands for RDF y(and) Accumulo.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/rya.manual/src/site/markdown/sm-addauth.md
----------------------------------------------------------------------
diff --git a/extras/rya.manual/src/site/markdown/sm-addauth.md b/extras/rya.manual/src/site/markdown/sm-addauth.md
index 2f32422..eec0949 100644
--- a/extras/rya.manual/src/site/markdown/sm-addauth.md
+++ b/extras/rya.manual/src/site/markdown/sm-addauth.md
@@ -89,9 +89,9 @@ RepositoryConnection conn = myRepository.getConnection();
//define and add statement
String litdupsNS = "urn:test:litdups#";
-URI cpu = vf.createURI(litdupsNS, "cpu");
-URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
-URI uri1 = vf.createURI(litdupsNS, "uri1");
+URI cpu = vf.createIRI(litdupsNS, "cpu");
+URI loadPerc = vf.createIRI(litdupsNS, "loadPerc");
+URI uri1 = vf.createIRI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
[42/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
index 0797033..611a141 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataIT.java
@@ -28,7 +28,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
@@ -61,8 +61,8 @@ public class MongoStatementMetadataIT extends MongoITBase {
@Override
protected void updateConfiguration(final MongoDBRdfConfiguration conf) {
- final Set<RyaURI> propertySet = new HashSet<>(
- Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn")));
+ final Set<RyaIRI> propertySet = new HashSet<>(
+ Arrays.asList(new RyaIRI("http://createdBy"), new RyaIRI("http://createdOn")));
conf.setUseStatementMetadata(true);
conf.setStatementMetadataProperties(propertySet);
}
@@ -76,11 +76,11 @@ public class MongoStatementMetadataIT extends MongoITBase {
dao.init();
final StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- final RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ final RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SailRepositoryConnection conn = new SailRepository(sail).getConnection();
@@ -121,11 +121,11 @@ public class MongoStatementMetadataIT extends MongoITBase {
dao.setConf(conf);
dao.init();
final StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Doug"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Doug"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
- final RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ final RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SailRepositoryConnection conn = new SailRepository(sail).getConnection();
@@ -151,13 +151,13 @@ public class MongoStatementMetadataIT extends MongoITBase {
dao.setConf(conf);
dao.init();
final StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- final RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- final RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ final RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ final RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -210,20 +210,20 @@ public class MongoStatementMetadataIT extends MongoITBase {
dao.setConf(conf);
dao.init();
final StatementMetadata metadata1 = new StatementMetadata();
- metadata1.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Doug"));
- metadata1.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata1.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Doug"));
+ metadata1.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
final StatementMetadata metadata2 = new StatementMetadata();
- metadata2.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Bob"));
- metadata2.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
+ metadata2.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Bob"));
+ metadata2.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
- final RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaURI("http://BurgerShack"), new RyaURI("http://context"), "", metadata1);
- final RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://talksTo"),
- new RyaURI("http://Betty"), new RyaURI("http://context"), "", metadata1);
- final RyaStatement statement3 = new RyaStatement(new RyaURI("http://Fred"), new RyaURI("http://talksTo"),
- new RyaURI("http://Amanda"), new RyaURI("http://context"), "", metadata1);
- final RyaStatement statement4 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://talksTo"),
- new RyaURI("http://Wanda"), new RyaURI("http://context"), "", metadata2);
+ final RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaIRI("http://BurgerShack"), new RyaIRI("http://context"), "", metadata1);
+ final RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://talksTo"),
+ new RyaIRI("http://Betty"), new RyaIRI("http://context"), "", metadata1);
+ final RyaStatement statement3 = new RyaStatement(new RyaIRI("http://Fred"), new RyaIRI("http://talksTo"),
+ new RyaIRI("http://Amanda"), new RyaIRI("http://context"), "", metadata1);
+ final RyaStatement statement4 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://talksTo"),
+ new RyaIRI("http://Wanda"), new RyaIRI("http://context"), "", metadata2);
dao.add(statement1);
dao.add(statement2);
dao.add(statement3);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
index 20fa32d..4f06ace 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/MongoStatementMetadataNodeIT.java
@@ -25,7 +25,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
@@ -56,7 +56,7 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
@Before
public void init() throws Exception {
- final Set<RyaURI> propertySet = new HashSet<RyaURI>(Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn")));
+ final Set<RyaIRI> propertySet = new HashSet<RyaIRI>(Arrays.asList(new RyaIRI("http://createdBy"), new RyaIRI("http://createdOn")));
conf.setUseStatementMetadata(true);
conf.setStatementMetadataProperties(propertySet);
}
@@ -68,11 +68,11 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.setConf(conf);
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SPARQLParser parser = new SPARQLParser();
@@ -112,11 +112,11 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Doug"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Doug"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SPARQLParser parser = new SPARQLParser();
@@ -143,13 +143,13 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.setConf(conf);
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -200,13 +200,13 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.setConf(conf);
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -263,11 +263,11 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.setConf(conf);
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
SPARQLParser parser = new SPARQLParser();
@@ -307,13 +307,13 @@ public class MongoStatementMetadataNodeIT extends MongoITBase {
dao.setConf(conf);
dao.init();
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
index c4318fb..b8b9eba 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataExternalSetProviderTest.java
@@ -28,7 +28,7 @@ import java.util.Set;
import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.external.matching.JoinSegment;
@@ -61,8 +61,8 @@ public class StatementMetadataExternalSetProviderTest {
public void createSingleAccumuloMetadataNode() throws MalformedQueryException {
AccumuloRdfConfiguration conf = (AccumuloRdfConfiguration) getConf(false);
- Set<RyaURI> propertySet = new HashSet<>();
- propertySet.add(new RyaURI("http://createdBy"));
+ Set<RyaIRI> propertySet = new HashSet<>();
+ propertySet.add(new RyaIRI("http://createdBy"));
conf.setStatementMetadataProperties(propertySet);
StatementMetadataExternalSetProvider metaProvider = new StatementMetadataExternalSetProvider(
conf);
@@ -88,8 +88,8 @@ public class StatementMetadataExternalSetProviderTest {
public void createSingleMongoMetadataNode() throws MalformedQueryException {
MongoDBRdfConfiguration conf = (MongoDBRdfConfiguration) getConf(true);
- Set<RyaURI> propertySet = new HashSet<>();
- propertySet.add(new RyaURI("http://createdBy"));
+ Set<RyaIRI> propertySet = new HashSet<>();
+ propertySet.add(new RyaIRI("http://createdBy"));
conf.setStatementMetadataProperties(propertySet);
StatementMetadataExternalSetProvider metaProvider = new StatementMetadataExternalSetProvider(conf);
SPARQLParser parser = new SPARQLParser();
@@ -115,9 +115,9 @@ public class StatementMetadataExternalSetProviderTest {
public void createMultipleMetadataNode() throws MalformedQueryException {
MongoDBRdfConfiguration conf = (MongoDBRdfConfiguration) getConf(true);
- Set<RyaURI> propertySet = new HashSet<>();
- propertySet.add(new RyaURI("http://createdBy"));
- propertySet.add(new RyaURI("http://createdOn"));
+ Set<RyaIRI> propertySet = new HashSet<>();
+ propertySet.add(new RyaIRI("http://createdBy"));
+ propertySet.add(new RyaIRI("http://createdOn"));
conf.setStatementMetadataProperties(propertySet);
StatementMetadataExternalSetProvider metaProvider = new StatementMetadataExternalSetProvider(conf);
SPARQLParser parser = new SPARQLParser();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
index fba9652..5b6945f 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataOptimizerTest.java
@@ -30,7 +30,7 @@ import java.util.Set;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.external.matching.JoinSegment;
import org.apache.rya.indexing.statement.metadata.matching.StatementMetadataExternalSetProvider;
@@ -128,8 +128,8 @@ public class StatementMetadataOptimizerTest {
private static RdfCloudTripleStoreConfiguration getConf(boolean useMongo) {
RdfCloudTripleStoreConfiguration conf;
- Set<RyaURI> propertySet = new HashSet<>(
- Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn")));
+ Set<RyaIRI> propertySet = new HashSet<>(
+ Arrays.asList(new RyaIRI("http://createdBy"), new RyaIRI("http://createdOn")));
if (useMongo) {
MongoDBRdfConfiguration mConf = new MongoDBRdfConfiguration();
mConf.setBoolean("sc.useMongo", true);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
index 51ea682..9c4cf6d 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/StatementMetadataTestUtils.java
@@ -23,7 +23,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.statement.metadata.matching.OWLReify;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Value;
@@ -37,9 +37,9 @@ import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
public class StatementMetadataTestUtils {
- private static final List<RyaURI> uriList = Arrays.asList(new RyaURI(RDF.TYPE.toString()),
- new RyaURI(OWLReify.SOURCE.toString()), new RyaURI(OWLReify.PROPERTY.toString()),
- new RyaURI(OWLReify.TARGET.toString()));
+ private static final List<RyaIRI> uriList = Arrays.asList(new RyaIRI(RDF.TYPE.toString()),
+ new RyaIRI(OWLReify.SOURCE.toString()), new RyaIRI(OWLReify.PROPERTY.toString()),
+ new RyaIRI(OWLReify.TARGET.toString()));
public static Set<QueryModelNode> getMetadataNodes(TupleExpr query) {
MetadataNodeCollector collector = new MetadataNodeCollector();
@@ -64,7 +64,7 @@ public class StatementMetadataTestUtils {
}
}
- public static Set<StatementPattern> getMetadataStatementPatterns(TupleExpr te, Set<RyaURI> properties) {
+ public static Set<StatementPattern> getMetadataStatementPatterns(TupleExpr te, Set<RyaIRI> properties) {
MetadataStatementPatternCollector collector = new MetadataStatementPatternCollector(properties);
te.visit(collector);
return collector.getNodes();
@@ -74,9 +74,9 @@ public class StatementMetadataTestUtils {
public static class MetadataStatementPatternCollector extends AbstractQueryModelVisitor<RuntimeException> {
private Set<StatementPattern> nodes;
- private Set<RyaURI> properties;
+ private Set<RyaIRI> properties;
- public MetadataStatementPatternCollector(Set<RyaURI> properties) {
+ public MetadataStatementPatternCollector(Set<RyaIRI> properties) {
this.properties = properties;
nodes = new HashSet<>();
}
@@ -86,7 +86,7 @@ public class StatementMetadataTestUtils {
Var predicate = node.getPredicateVar();
Value val = predicate.getValue();
if (val != null && val instanceof IRI) {
- RyaURI ryaVal = new RyaURI(val.stringValue());
+ RyaIRI ryaVal = new RyaIRI(val.stringValue());
if (uriList.contains(ryaVal) || properties.contains(ryaVal)) {
nodes.add(node);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexingExample/src/main/java/StatementMetadataExample.java
----------------------------------------------------------------------
diff --git a/extras/indexingExample/src/main/java/StatementMetadataExample.java b/extras/indexingExample/src/main/java/StatementMetadataExample.java
index 9f0afc9..56e8581 100644
--- a/extras/indexingExample/src/main/java/StatementMetadataExample.java
+++ b/extras/indexingExample/src/main/java/StatementMetadataExample.java
@@ -34,7 +34,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -111,25 +111,25 @@ public class StatementMetadataExample {
+ "_:blankNode <http://createdOn> ?z }\n";
StatementMetadata metadata1 = new StatementMetadata();
- metadata1.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata1.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
+ metadata1.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata1.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata1);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata1);
StatementMetadata metadata2 = new StatementMetadata();
- metadata2.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata2.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
+ metadata2.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata2.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata2);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata2);
StatementMetadata metadata3 = new StatementMetadata();
- metadata3.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Fred"));
- metadata3.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
+ metadata3.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Fred"));
+ metadata3.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("Library"), new RyaURI("http://context"), "", metadata3);
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("Library"), new RyaIRI("http://context"), "", metadata3);
// add statements for querying
dao.add(statement1);
@@ -176,12 +176,12 @@ public class StatementMetadataExample {
+ "_:blankNode <http://hasTimeStamp> ?y }\n";
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://hasTimeStamp"), new RyaType(XMLSchema.TIME, "09:30:10.5"));
+ metadata.addMetadata(new RyaIRI("http://hasTimeStamp"), new RyaType(XMLSchema.TIME, "09:30:10.5"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Doug"), new RyaURI("http://travelsTo"),
- new RyaURI("http://NewMexico"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://NewMexico"), new RyaURI("http://locatedWithin"),
- new RyaType("http://UnitedStates"), new RyaURI("http://context"), "", new StatementMetadata());
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Doug"), new RyaIRI("http://travelsTo"),
+ new RyaIRI("http://NewMexico"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://NewMexico"), new RyaIRI("http://locatedWithin"),
+ new RyaType("http://UnitedStates"), new RyaIRI("http://context"), "", new StatementMetadata());
// add statements for querying
dao.add(statement1);
@@ -223,25 +223,25 @@ public class StatementMetadataExample {
+ "_:blankNode <http://createdOn> '2017-02-04'^^xsd:date }\n";
StatementMetadata metadata1 = new StatementMetadata();
- metadata1.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata1.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
+ metadata1.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata1.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata1);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata1);
StatementMetadata metadata2 = new StatementMetadata();
- metadata2.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata2.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
+ metadata2.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata2.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata2);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata2);
StatementMetadata metadata3 = new StatementMetadata();
- metadata3.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Fred"));
- metadata3.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
+ metadata3.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Fred"));
+ metadata3.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("Library"), new RyaURI("http://context"), "", metadata3);
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("Library"), new RyaIRI("http://context"), "", metadata3);
// add statements for querying
dao.add(statement1);
@@ -293,32 +293,32 @@ public class StatementMetadataExample {
+ "_:blankNode2 <http://createdOn> ?a }\n";
StatementMetadata metadata1 = new StatementMetadata();
- metadata1.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata1.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
+ metadata1.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata1.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-02"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata1);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata1);
StatementMetadata metadata2 = new StatementMetadata();
- metadata2.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata2.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
+ metadata2.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata2.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata2);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata2);
StatementMetadata metadata3 = new StatementMetadata();
- metadata3.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Fred"));
- metadata3.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
+ metadata3.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Fred"));
+ metadata3.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-03-08"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("Library"), new RyaURI("http://context"), "", metadata3);
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("Library"), new RyaIRI("http://context"), "", metadata3);
StatementMetadata metadata4 = new StatementMetadata();
- metadata4.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Dave"));
- metadata4.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-04-16"));
+ metadata4.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Dave"));
+ metadata4.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-04-16"));
- RyaStatement statement4 = new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata4);
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata4);
// add statements for querying
dao.add(statement1);
@@ -351,8 +351,8 @@ public class StatementMetadataExample {
private static AccumuloRdfConfiguration getConf() {
AccumuloRdfConfiguration conf;
- Set<RyaURI> propertySet = new HashSet<RyaURI>(Arrays.asList(new RyaURI("http://createdBy"),
- new RyaURI("http://createdOn"), new RyaURI("http://hasTimeStamp")));
+ Set<RyaIRI> propertySet = new HashSet<RyaIRI>(Arrays.asList(new RyaIRI("http://createdBy"),
+ new RyaIRI("http://createdOn"), new RyaIRI("http://hasTimeStamp")));
conf = new AccumuloRdfConfiguration();
conf.setDisplayQueryPlan(false);
conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
index 090d22f..7e8125c 100644
--- a/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
+++ b/extras/rya.export/export.accumulo/src/main/java/org/apache/rya/export/accumulo/util/AccumuloRyaUtils.java
@@ -54,7 +54,7 @@ import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
@@ -89,41 +89,41 @@ public final class AccumuloRyaUtils {
}
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyaURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String localName) {
- return createRyaUri(NAMESPACE, localName);
+ public static RyaIRI createRyaIri(final String localName) {
+ return createRyaIri(NAMESPACE, localName);
}
/**
- * Creates a {@link RyaURI} for the specified local name.
+ * Creates a {@link RyaIRI} for the specified local name.
* @param namespace the namespace.
- * @param localName the URI's local name.
- * @return the {@link RyaURI}.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createIRI(namespace, localName));
+ public static RyaIRI createRyaIri(final String namespace, final String localName) {
+ return RdfToRyaConversions.convertIRI(VALUE_FACTORY.createIRI(namespace, localName));
}
/**
- * Converts a {@link RyaURI} to the contained data string.
- * @param the {@link RyaURI} to convert.
+ * Converts a {@link RyaIRI} to the contained data string.
+ * @param ryaIri the {@link RyaIRI} to convert.
* @return the data value without the namespace.
*/
- public static String convertRyaUriToString(final RyaURI ryaUri) {
- return convertRyaUriToString(NAMESPACE, ryaUri);
+ public static String convertRyaIriToString(final RyaIRI ryaIri) {
+ return convertRyaIriToString(NAMESPACE, ryaIri);
}
/**
- * Converts a {@link RyaURI} to the contained data string.
+ * Converts a {@link RyaIRI} to the contained data string.
* @param namespace the namespace.
- * @param the {@link RyaURI} to convert.
+ * @param ryaIri the {@link RyaIRI} to convert.
* @return the data value without the namespace.
*/
- public static String convertRyaUriToString(final String namespace, final RyaURI ryaUri) {
- return StringUtils.replaceOnce(ryaUri.getData(), namespace, "");
+ public static String convertRyaIriToString(final String namespace, final RyaIRI ryaIri) {
+ return StringUtils.replaceOnce(ryaIri.getData(), namespace, "");
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStoreTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStoreTest.java b/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStoreTest.java
index 7c2ff83..cdbd0a6 100644
--- a/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStoreTest.java
+++ b/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/AccumuloRyaStatementStoreTest.java
@@ -272,10 +272,10 @@ public class AccumuloRyaStatementStoreTest {
assertEquals(firstRyaStatement, updatedRyaStatement);
- final String subject = TestUtils.convertRyaUriToString(updatedRyaStatement.getSubject());
- final String predicate = TestUtils.convertRyaUriToString(updatedRyaStatement.getPredicate());
- updatedRyaStatement.setSubject(TestUtils.createRyaUri(subject + "_UPDATED"));
- updatedRyaStatement.setPredicate(TestUtils.createRyaUri(predicate + "_UPDATED"));
+ final String subject = TestUtils.convertRyaIriToString(updatedRyaStatement.getSubject());
+ final String predicate = TestUtils.convertRyaIriToString(updatedRyaStatement.getPredicate());
+ updatedRyaStatement.setSubject(TestUtils.createRyaIri(subject + "_UPDATED"));
+ updatedRyaStatement.setPredicate(TestUtils.createRyaIri(predicate + "_UPDATED"));
accumuloRyaStatementStore.updateStatement(firstRyaStatement, updatedRyaStatement);
@@ -312,10 +312,10 @@ public class AccumuloRyaStatementStoreTest {
assertEquals(firstRyaStatement, updatedRyaStatement);
- final String subject = TestUtils.convertRyaUriToString(updatedRyaStatement.getSubject());
- final String predicate = TestUtils.convertRyaUriToString(updatedRyaStatement.getPredicate());
- updatedRyaStatement.setSubject(TestUtils.createRyaUri(subject + "_UPDATED"));
- updatedRyaStatement.setPredicate(TestUtils.createRyaUri(predicate + "_UPDATED"));
+ final String subject = TestUtils.convertRyaIriToString(updatedRyaStatement.getSubject());
+ final String predicate = TestUtils.convertRyaIriToString(updatedRyaStatement.getPredicate());
+ updatedRyaStatement.setSubject(TestUtils.createRyaIri(subject + "_UPDATED"));
+ updatedRyaStatement.setPredicate(TestUtils.createRyaIri(predicate + "_UPDATED"));
accumuloRyaStatementStore.updateStatement(firstRyaStatement, null);
}
@@ -333,10 +333,10 @@ public class AccumuloRyaStatementStoreTest {
assertEquals(notFoundStatement, updatedRyaStatement);
- final String subject = TestUtils.convertRyaUriToString(updatedRyaStatement.getSubject());
- final String predicate = TestUtils.convertRyaUriToString(updatedRyaStatement.getPredicate());
- updatedRyaStatement.setSubject(TestUtils.createRyaUri(subject + "_UPDATED"));
- updatedRyaStatement.setPredicate(TestUtils.createRyaUri(predicate + "_UPDATED"));
+ final String subject = TestUtils.convertRyaIriToString(updatedRyaStatement.getSubject());
+ final String predicate = TestUtils.convertRyaIriToString(updatedRyaStatement.getPredicate());
+ updatedRyaStatement.setSubject(TestUtils.createRyaIri(subject + "_UPDATED"));
+ updatedRyaStatement.setPredicate(TestUtils.createRyaIri(predicate + "_UPDATED"));
accumuloRyaStatementStore.updateStatement(notFoundStatement, updatedRyaStatement);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/TestUtils.java b/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/TestUtils.java
index 34d1ba9..d0a00c6 100644
--- a/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/TestUtils.java
+++ b/extras/rya.export/export.accumulo/src/test/java/org/apache/rya/export/accumulo/TestUtils.java
@@ -21,7 +21,7 @@ package org.apache.rya.export.accumulo;
import java.util.Date;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.export.accumulo.util.AccumuloRyaUtils;
/**
@@ -31,22 +31,21 @@ public final class TestUtils {
private static final String NAMESPACE = "#:";
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String localName) {
- return AccumuloRyaUtils.createRyaUri(NAMESPACE, localName);
+ public static RyaIRI createRyaIri(final String localName) {
+ return AccumuloRyaUtils.createRyaIri(NAMESPACE, localName);
}
/**
- * Converts a {@link RyaURI} to the contained data string.
- * @param namespace the namespace.
- * @param the {@link RyaURI} to convert.
+ * Converts a {@link RyaIRI} to the contained data string.
+ * @param ryaIri the {@link RyaIRI} to convert.
* @return the data value without the namespace.
*/
- public static String convertRyaUriToString(final RyaURI RyaUri) {
- return AccumuloRyaUtils.convertRyaUriToString(NAMESPACE, RyaUri);
+ public static String convertRyaIriToString(final RyaIRI ryaIri) {
+ return AccumuloRyaUtils.convertRyaIriToString(NAMESPACE, ryaIri);
}
/**
@@ -58,10 +57,10 @@ public final class TestUtils {
* @return the {@link RyaStatement}.
*/
public static RyaStatement createRyaStatement(final String subject, final String predicate, final String object, final Date date) {
- final RyaURI subjectUri = createRyaUri(subject);
- final RyaURI predicateUri = createRyaUri(predicate);
- final RyaURI objectUri = createRyaUri(object);
- final RyaStatement ryaStatement = new RyaStatement(subjectUri, predicateUri, objectUri);
+ final RyaIRI subjectIri = createRyaIri(subject);
+ final RyaIRI predicateIri = createRyaIri(predicate);
+ final RyaIRI objectIri = createRyaIri(object);
+ final RyaStatement ryaStatement = new RyaStatement(subjectIri, predicateIri, objectIri);
if (date != null) {
ryaStatement.setTimestamp(date.getTime());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
----------------------------------------------------------------------
diff --git a/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java b/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
index 83fd774..4b7d3f9 100644
--- a/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
+++ b/extras/rya.export/export.integration/src/test/java/org/apache/rya/indexing/export/ITBase.java
@@ -35,7 +35,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -159,11 +159,11 @@ public abstract class ITBase {
checkNotNull(predicate);
checkNotNull(object);
- final RyaStatementBuilder builder = RyaStatement.builder().setSubject(new RyaURI(subject))
- .setPredicate(new RyaURI(predicate));
+ final RyaStatementBuilder builder = RyaStatement.builder().setSubject(new RyaIRI(subject))
+ .setPredicate(new RyaIRI(predicate));
if (object.startsWith("http://")) {
- builder.setObject(new RyaURI(object));
+ builder.setObject(new RyaIRI(object));
} else {
builder.setObject(new RyaType(object));
}
@@ -188,7 +188,7 @@ public abstract class ITBase {
checkNotNull(subject);
checkNotNull(predicate);
- return RyaStatement.builder().setSubject(new RyaURI(subject)).setPredicate(new RyaURI(predicate))
+ return RyaStatement.builder().setSubject(new RyaIRI(subject)).setPredicate(new RyaIRI(predicate))
.setObject(new RyaType(XMLSchema.INT, "" + object)).build();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
----------------------------------------------------------------------
diff --git a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
index d4ae96f..5220ea5 100644
--- a/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
+++ b/extras/rya.forwardchain/src/main/java/org/apache/rya/forwardchain/ForwardChainConstants.java
@@ -20,7 +20,7 @@ package org.apache.rya.forwardchain;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaSchema;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.ValueFactory;
@@ -32,6 +32,6 @@ public class ForwardChainConstants {
public static final IRI DERIVATION_TIME = VF.createIRI(NAMESPACE, "forwardChainIteration");
public static final IRI DERIVATION_RULE = VF.createIRI(NAMESPACE, "forwardChainRule");
- public static final RyaURI RYA_DERIVATION_RULE = RdfToRyaConversions.convertURI(DERIVATION_RULE);
- public static final RyaURI RYA_DERIVATION_TIME = RdfToRyaConversions.convertURI(DERIVATION_TIME);
+ public static final RyaIRI RYA_DERIVATION_RULE = RdfToRyaConversions.convertIRI(DERIVATION_RULE);
+ public static final RyaIRI RYA_DERIVATION_TIME = RdfToRyaConversions.convertIRI(DERIVATION_TIME);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/Event.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/Event.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/Event.java
index 4c50bfb..13ea048 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/Event.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/Event.java
@@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Objects;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInterval;
import org.apache.rya.indexing.geotemporal.GeoTemporalIndexer;
@@ -42,7 +42,7 @@ public class Event {
private final Optional<Geometry> geometry;
private final Optional<TemporalInstant> instant;
private final Optional<TemporalInterval> interval;
- private final RyaURI subject;
+ private final RyaIRI subject;
private final boolean isInstant;
@@ -52,7 +52,7 @@ public class Event {
* @param instant - The {@link TemporalInstant} to use when querying.
* @param subject - The Subject that both statements must have when querying.
*/
- private Event(final Geometry geo, final TemporalInstant instant, final RyaURI subject) {
+ private Event(final Geometry geo, final TemporalInstant instant, final RyaIRI subject) {
this.subject = requireNonNull(subject);
//these fields are nullable since they are filled field by field.
@@ -68,7 +68,7 @@ public class Event {
* @param interval - The {@link TemporalInterval} to use when querying.
* @param subject - The Subject that both statements must have when querying.
*/
- private Event(final Geometry geo, final TemporalInterval interval, final RyaURI subject) {
+ private Event(final Geometry geo, final TemporalInterval interval, final RyaIRI subject) {
this.subject = requireNonNull(subject);
//these fields are nullable since they are filled field by field.
@@ -109,7 +109,7 @@ public class Event {
/**
* @return The statement subject.
*/
- public RyaURI getSubject() {
+ public RyaIRI getSubject() {
return subject;
}
@@ -163,16 +163,16 @@ public class Event {
*/
@DefaultAnnotation(NonNull.class)
public static class Builder {
- private RyaURI subject;
+ private RyaIRI subject;
private Geometry geo;
private TemporalInstant instant;
private TemporalInterval interval;
/**
- * Sets the {@link RyaURI} subject.
+ * Sets the {@link RyaIRI} subject.
* @param subject - The subject to key on the event.
*/
- public Builder setSubject(final RyaURI subject) {
+ public Builder setSubject(final RyaIRI subject) {
this.subject = subject;
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
index 53d4b74..4110d43 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode.java
@@ -30,7 +30,7 @@ import java.util.Optional;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.IndexingExpr;
import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
@@ -179,7 +179,7 @@ public class EventQueryNode extends ExternalSet implements ExternalBatchingItera
if(subjectConstant.isPresent()) {
// if it is, fetch that value and then fetch the entity for the subject.
subj = subjectConstant.get();
- searchEvents = eventStore.search(Optional.of(new RyaURI(subj)), Optional.of(geoFilters), Optional.of(temporalFilters));
+ searchEvents = eventStore.search(Optional.of(new RyaIRI(subj)), Optional.of(geoFilters), Optional.of(temporalFilters));
} else {
searchEvents = eventStore.search(Optional.empty(), Optional.of(geoFilters), Optional.of(temporalFilters));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/storage/EventStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/storage/EventStorage.java b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/storage/EventStorage.java
index 47c18a0..5529960 100644
--- a/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/storage/EventStorage.java
+++ b/extras/rya.geoindexing/geo.common/src/main/java/org/apache/rya/indexing/geotemporal/storage/EventStorage.java
@@ -21,7 +21,7 @@ package org.apache.rya.indexing.geotemporal.storage;
import java.util.Collection;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.IndexingExpr;
import org.apache.rya.indexing.geotemporal.GeoTemporalIndexer;
import org.apache.rya.indexing.geotemporal.model.Event;
@@ -38,7 +38,7 @@ public interface EventStorage extends RyaObjectStorage<Event> {
* @return The {@link Event}, if one exists for the subject.
* @throws ObjectStorageException A problem occurred while fetching the Entity from the storage.
*/
- public Collection<Event> search(final Optional<RyaURI> subject, Optional<Collection<IndexingExpr>> geoFilters, Optional<Collection<IndexingExpr>> temporalFilters) throws ObjectStorageException;
+ public Collection<Event> search(final Optional<RyaIRI> subject, Optional<Collection<IndexingExpr>> geoFilters, Optional<Collection<IndexingExpr>> temporalFilters) throws ObjectStorageException;
/**
* Indicates a problem while interacting with an {@link EventStorage}.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverter.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverter.java
index 926f357..f44699d 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverter.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverter.java
@@ -23,7 +23,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Date;
import java.util.List;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.TemporalInterval;
@@ -97,7 +97,7 @@ public class EventDocumentConverter implements DocumentConverter<Event>{
final String subject = document.getString(SUBJECT);
final Event.Builder builder = new Event.Builder()
- .setSubject(new RyaURI(subject));
+ .setSubject(new RyaIRI(subject));
if(document.containsKey(GEO_KEY)) {
final Document geoObj = (Document) document.get(GEO_KEY);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventUpdater.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventUpdater.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventUpdater.java
index 1c62407..e41f405 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventUpdater.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/EventUpdater.java
@@ -22,7 +22,7 @@ import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.geotemporal.model.Event;
import org.apache.rya.indexing.geotemporal.storage.EventStorage;
import org.apache.rya.indexing.geotemporal.storage.EventStorage.EventStorageException;
@@ -36,7 +36,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
* Performs update operations over an {@link EventStorage}.
*/
@DefaultAnnotation(NonNull.class)
-public class EventUpdater implements MongoDocumentUpdater<RyaURI, Event>{
+public class EventUpdater implements MongoDocumentUpdater<RyaIRI, Event>{
private final EventStorage events;
/**
@@ -49,7 +49,7 @@ public class EventUpdater implements MongoDocumentUpdater<RyaURI, Event>{
}
@Override
- public Optional<Event> getOld(final RyaURI key) throws EventStorageException {
+ public Optional<Event> getOld(final RyaIRI key) throws EventStorageException {
try {
return events.get(key);
} catch (final ObjectStorageException e) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorage.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorage.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorage.java
index 9c13c8b..d7b1850 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorage.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorage.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.IndexingExpr;
import org.apache.rya.indexing.entity.model.TypedEntity;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
@@ -100,7 +100,7 @@ public class MongoEventStorage implements EventStorage {
}
@Override
- public Optional<Event> get(final RyaURI subject) throws EventStorageException {
+ public Optional<Event> get(final RyaIRI subject) throws EventStorageException {
requireNonNull(subject);
try {
@@ -119,7 +119,7 @@ public class MongoEventStorage implements EventStorage {
}
@Override
- public Collection<Event> search(final Optional<RyaURI> subject, final Optional<Collection<IndexingExpr>> geoFilters, final Optional<Collection<IndexingExpr>> temporalFilters) throws EventStorageException {
+ public Collection<Event> search(final Optional<RyaIRI> subject, final Optional<Collection<IndexingExpr>> geoFilters, final Optional<Collection<IndexingExpr>> temporalFilters) throws EventStorageException {
requireNonNull(subject);
try {
@@ -174,7 +174,7 @@ public class MongoEventStorage implements EventStorage {
}
@Override
- public boolean delete(final RyaURI subject) throws EventStorageException {
+ public boolean delete(final RyaIRI subject) throws EventStorageException {
requireNonNull(subject);
try {
@@ -189,7 +189,7 @@ public class MongoEventStorage implements EventStorage {
}
}
- private static Bson makeSubjectFilter(final RyaURI subject) {
+ private static Bson makeSubjectFilter(final RyaIRI subject) {
return Filters.eq(EventDocumentConverter.SUBJECT, subject.getData());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
index bc836bd..4e53481 100644
--- a/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
+++ b/extras/rya.geoindexing/geo.mongo/src/main/java/org/apache/rya/indexing/geotemporal/mongo/MongoGeoTemporalIndexer.java
@@ -30,7 +30,7 @@ import java.util.regex.Matcher;
import org.apache.hadoop.conf.Configuration;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.TemporalInstant;
@@ -112,7 +112,7 @@ public class MongoGeoTemporalIndexer extends AbstractMongoIndexer<GeoTemporalMon
@Override
public void deleteStatement(final RyaStatement statement) throws IOException {
requireNonNull(statement);
- final RyaURI subject = statement.getSubject();
+ final RyaIRI subject = statement.getSubject();
try {
final EventStorage eventStore = events.get();
checkState(events != null, "Must set this indexers configuration before storing statements.");
@@ -161,7 +161,7 @@ public class MongoGeoTemporalIndexer extends AbstractMongoIndexer<GeoTemporalMon
}
}
- private void updateEvent(final RyaURI subject, final RyaStatement statement) throws IndexingException, ParseException {
+ private void updateEvent(final RyaIRI subject, final RyaStatement statement) throws IndexingException, ParseException {
final EventStorage eventStore = events.get();
checkState(events != null, "Must set this indexers configuration before storing statements.");
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
index 316117b..f49252a 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/MongoGeoTemporalIndexIT.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.GeoConstants;
import org.apache.rya.indexing.GeoRyaSailFactory;
import org.apache.rya.indexing.TemporalInstantRfc3339;
@@ -70,7 +70,7 @@ public class MongoGeoTemporalIndexIT extends MongoITBase {
addStatements(repo.getConnection());
final EventStorage events = indexer.getEventStorage();
- final RyaURI subject = new RyaURI("urn:event1");
+ final RyaIRI subject = new RyaIRI("urn:event1");
final Optional<Event> event = events.get(subject);
assertTrue(event.isPresent());
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
index cfcb513..e27b720 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/model/EventQueryNode2IT.java
@@ -30,7 +30,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.IndexingExpr;
import org.apache.rya.indexing.IndexingFunctionRegistry;
import org.apache.rya.indexing.IndexingFunctionRegistry.FUNCTION_TYPE;
@@ -114,7 +114,7 @@ public class EventQueryNode2IT extends MongoITBase {
@Test
public void evaluate_constantSubject() throws Exception {
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), "testDB");
- RyaURI subject = new RyaURI("urn:event-1111");
+ RyaIRI subject = new RyaIRI("urn:event-1111");
final Geometry geo = GF.createPoint(new Coordinate(1, 1));
final TemporalInstant temp = new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0);
final Event event = Event.builder()
@@ -123,7 +123,7 @@ public class EventQueryNode2IT extends MongoITBase {
.setTemporalInstant(temp)
.build();
- subject = new RyaURI("urn:event-2222");
+ subject = new RyaIRI("urn:event-2222");
final Event otherEvent = Event.builder()
.setSubject(subject)
.setGeometry(geo)
@@ -163,7 +163,7 @@ public class EventQueryNode2IT extends MongoITBase {
@Test
public void evaluate_variableSubject() throws Exception {
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), "testDB");
- RyaURI subject = new RyaURI("urn:event-1111");
+ RyaIRI subject = new RyaIRI("urn:event-1111");
Geometry geo = GF.createPoint(new Coordinate(1, 1));
final TemporalInstant temp = new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0);
final Event event = Event.builder()
@@ -172,7 +172,7 @@ public class EventQueryNode2IT extends MongoITBase {
.setTemporalInstant(temp)
.build();
- subject = new RyaURI("urn:event-2222");
+ subject = new RyaIRI("urn:event-2222");
geo = GF.createPoint(new Coordinate(-1, -1));
final Event otherEvent = Event.builder()
.setSubject(subject)
@@ -217,7 +217,7 @@ public class EventQueryNode2IT extends MongoITBase {
@Test
public void evaluate_variableSubject_existingBindingset() throws Exception {
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), "testDB");
- RyaURI subject = new RyaURI("urn:event-1111");
+ RyaIRI subject = new RyaIRI("urn:event-1111");
Geometry geo = GF.createPoint(new Coordinate(1, 1));
final TemporalInstant temp = new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0);
final Event event = Event.builder()
@@ -226,7 +226,7 @@ public class EventQueryNode2IT extends MongoITBase {
.setTemporalInstant(temp)
.build();
- subject = new RyaURI("urn:event-2222");
+ subject = new RyaIRI("urn:event-2222");
geo = GF.createPoint(new Coordinate(-1, -1));
final Event otherEvent = Event.builder()
.setSubject(subject)
@@ -269,7 +269,7 @@ public class EventQueryNode2IT extends MongoITBase {
@Test
public void evaluate_variableSubject_existingBindingsetWrongFilters() throws Exception {
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), "testDB");
- RyaURI subject = new RyaURI("urn:event-1111");
+ RyaIRI subject = new RyaIRI("urn:event-1111");
Geometry geo = GF.createPoint(new Coordinate(1, 1));
final TemporalInstant temp = new TemporalInstantRfc3339(2015, 12, 30, 12, 00, 0);
final Event event = Event.builder()
@@ -278,7 +278,7 @@ public class EventQueryNode2IT extends MongoITBase {
.setTemporalInstant(temp)
.build();
- subject = new RyaURI("urn:event-2222");
+ subject = new RyaIRI("urn:event-2222");
geo = GF.createPoint(new Coordinate(-10, -10));
final Event otherEvent = Event.builder()
.setSubject(subject)
@@ -319,11 +319,11 @@ public class EventQueryNode2IT extends MongoITBase {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final IRI filterURI = VF.createIRI(filter.getURI());
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
+ final IRI filterIRI = VF.createIRI(filter.getURI());
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterIRI, filter.getArgs());
final Value[] arguments = extractArguments(objVar.getName(), filter);
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
- if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
+ final IndexingExpr expr = new IndexingExpr(filterIRI, sps.get(0), Arrays.stream(arguments).toArray());
+ if(IndexingFunctionRegistry.getFunctionType(filterIRI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
temporalFilters.add(expr);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverterTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverterTest.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverterTest.java
index 3f2f9d5..fa6ce85 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverterTest.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/EventDocumentConverterTest.java
@@ -20,7 +20,7 @@ package org.apache.rya.indexing.geotemporal.mongo;
import static org.junit.Assert.assertEquals;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.entity.storage.mongo.DocumentConverter.DocumentConverterException;
@@ -48,7 +48,7 @@ public class EventDocumentConverterTest {
// An Event that will be stored.
final Event event = Event.builder()
- .setSubject(new RyaURI("urn:event/001"))
+ .setSubject(new RyaIRI("urn:event/001"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
index f18b1da..b50fddb 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/GeoTemporalMongoDBStorageStrategyTest.java
@@ -315,11 +315,11 @@ public class GeoTemporalMongoDBStorageStrategyTest {
final List<StatementPattern> sps = getSps(query);
final List<FunctionCall> filters = getFilters(query);
for(final FunctionCall filter : filters) {
- final IRI filterURI = VF.createIRI(filter.getURI());
- final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterURI, filter.getArgs());
+ final IRI filterIRI = VF.createIRI(filter.getURI());
+ final Var objVar = IndexingFunctionRegistry.getResultVarFromFunctionCall(filterIRI, filter.getArgs());
final Value[] arguments = extractArguments(objVar.getName(), filter);
- final IndexingExpr expr = new IndexingExpr(filterURI, sps.get(0), Arrays.stream(arguments).toArray());
- if(IndexingFunctionRegistry.getFunctionType(filterURI) == FUNCTION_TYPE.GEO) {
+ final IndexingExpr expr = new IndexingExpr(filterIRI, sps.get(0), Arrays.stream(arguments).toArray());
+ if(IndexingFunctionRegistry.getFunctionType(filterIRI) == FUNCTION_TYPE.GEO) {
geoFilters.add(expr);
} else {
temporalFilters.add(expr);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorageIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorageIT.java b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorageIT.java
index c7d8a81..a10f05e 100644
--- a/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorageIT.java
+++ b/extras/rya.geoindexing/geo.mongo/src/test/java/org/apache/rya/indexing/geotemporal/mongo/MongoEventStorageIT.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.TemporalInstant;
import org.apache.rya.indexing.TemporalInstantRfc3339;
import org.apache.rya.indexing.geotemporal.model.Event;
@@ -55,7 +55,7 @@ public class MongoEventStorageIT extends MongoITBase {
// An Event that will be stored.
final Event event = Event.builder()
- .setSubject(new RyaURI("urn:event/001"))
+ .setSubject(new RyaIRI("urn:event/001"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
@@ -65,7 +65,7 @@ public class MongoEventStorageIT extends MongoITBase {
storage.create(event);
// Get it.
- final Optional<Event> storedEvent = storage.get(new RyaURI("urn:event/001"));
+ final Optional<Event> storedEvent = storage.get(new RyaIRI("urn:event/001"));
// Verify the correct value was returned.
assertEquals(event, storedEvent.get());
@@ -78,7 +78,7 @@ public class MongoEventStorageIT extends MongoITBase {
// An Event that will be stored.
final Event event = Event.builder()
- .setSubject(new RyaURI("urn:event/001"))
+ .setSubject(new RyaIRI("urn:event/001"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
@@ -101,7 +101,7 @@ public class MongoEventStorageIT extends MongoITBase {
public void get_noneExisting() throws Exception {
// Get a Type that hasn't been created.
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final Optional<Event> storedEvent = storage.get(new RyaURI("urn:event/000"));
+ final Optional<Event> storedEvent = storage.get(new RyaIRI("urn:event/000"));
// Verify nothing was returned.
assertFalse(storedEvent.isPresent());
@@ -114,7 +114,7 @@ public class MongoEventStorageIT extends MongoITBase {
// An Event that will be stored.
final Event event = Event.builder()
- .setSubject(new RyaURI("urn:event/002"))
+ .setSubject(new RyaIRI("urn:event/002"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
@@ -124,7 +124,7 @@ public class MongoEventStorageIT extends MongoITBase {
storage.create(event);
// Delete it.
- final boolean deleted = storage.delete( new RyaURI("urn:event/002") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:event/002") );
// Verify a document was deleted.
assertTrue( deleted );
@@ -134,7 +134,7 @@ public class MongoEventStorageIT extends MongoITBase {
public void delete_nonExisting() throws Exception {
// Delete an Event that has not been created.
final EventStorage storage = new MongoEventStorage(super.getMongoClient(), RYA_INSTANCE_NAME);
- final boolean deleted = storage.delete( new RyaURI("urn:event/003") );
+ final boolean deleted = storage.delete( new RyaIRI("urn:event/003") );
// Verify no document was deleted.
assertFalse( deleted );
@@ -148,7 +148,7 @@ public class MongoEventStorageIT extends MongoITBase {
// An Event that will be stored.
final Event event = Event.builder()
- .setSubject(new RyaURI("urn:event/004"))
+ .setSubject(new RyaIRI("urn:event/004"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
@@ -156,7 +156,7 @@ public class MongoEventStorageIT extends MongoITBase {
storage.create(event);
// Show Alice was stored.
- Optional<Event> latest = storage.get(new RyaURI("urn:event/004"));
+ Optional<Event> latest = storage.get(new RyaIRI("urn:event/004"));
assertEquals(event, latest.get());
instant = new TemporalInstantRfc3339(DateTime.now());
@@ -168,7 +168,7 @@ public class MongoEventStorageIT extends MongoITBase {
storage.update(event, updated);
// Fetch the Alice object and ensure it has the new value.
- latest = storage.get(new RyaURI("urn:event/004"));
+ latest = storage.get(new RyaIRI("urn:event/004"));
assertEquals(updated, latest.get());
}
@@ -181,13 +181,13 @@ public class MongoEventStorageIT extends MongoITBase {
// Two objects that do not have the same Subjects.
final Event old = Event.builder()
- .setSubject(new RyaURI("urn:event/001"))
+ .setSubject(new RyaIRI("urn:event/001"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
final Event updated = Event.builder()
- .setSubject(new RyaURI("urn:event/002"))
+ .setSubject(new RyaIRI("urn:event/002"))
.setGeometry(geo)
.setTemporalInstant(instant)
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.giraph/src/test/java/org/apache/rya/giraph/format/TestVertexFormat.java
----------------------------------------------------------------------
diff --git a/extras/rya.giraph/src/test/java/org/apache/rya/giraph/format/TestVertexFormat.java b/extras/rya.giraph/src/test/java/org/apache/rya/giraph/format/TestVertexFormat.java
index 920e876..25aafee 100644
--- a/extras/rya.giraph/src/test/java/org/apache/rya/giraph/format/TestVertexFormat.java
+++ b/extras/rya.giraph/src/test/java/org/apache/rya/giraph/format/TestVertexFormat.java
@@ -34,7 +34,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.giraph.format.RyaVertexInputFormat;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
@@ -83,18 +83,18 @@ public class TestVertexFormat extends BspCase {
AccumuloRdfConfiguration conf = getConf();
AccumuloRyaDAO ryaDAO = RyaSailFactory.getAccumuloDAO(conf);
- ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"),
- new RyaURI("urn:test#pred1"),
- new RyaURI("urn:test#obj1")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"),
- new RyaURI("urn:test#pred2"),
- new RyaURI("urn:test#obj2")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"),
- new RyaURI("urn:test#pred3"),
- new RyaURI("urn:test#obj3")));
- ryaDAO.add(new RyaStatement(new RyaURI("urn:test#1234"),
- new RyaURI("urn:test#pred4"),
- new RyaURI("urn:test#obj4")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:test#1234"),
+ new RyaIRI("urn:test#pred1"),
+ new RyaIRI("urn:test#obj1")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:test#1234"),
+ new RyaIRI("urn:test#pred2"),
+ new RyaIRI("urn:test#obj2")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:test#1234"),
+ new RyaIRI("urn:test#pred3"),
+ new RyaIRI("urn:test#obj3")));
+ ryaDAO.add(new RyaStatement(new RyaIRI("urn:test#1234"),
+ new RyaIRI("urn:test#pred4"),
+ new RyaIRI("urn:test#obj4")));
ryaDAO.flush();
GiraphJob job = new GiraphJob(conf, getCallingMethodName());
[36/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
RYA-405 Migration of OpenRDF Sesame libraries to RDF4J
Co-authored-by: eric.white <Er...@parsons.com>
Co-authored-by: Jorge Machado <jo...@hotmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/81b99327
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/81b99327
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/81b99327
Branch: refs/heads/master
Commit: 81b99327d97f60de3273c21c25ec564034c974da
Parents: ca055ae
Author: Jorge Machado <jo...@hotmail.com>
Authored: Wed Oct 18 11:32:39 2017 +0200
Committer: Valiyil <Pu...@parsons.com>
Committed: Mon Apr 23 09:19:10 2018 -0400
----------------------------------------------------------------------
README.md | 90 +-
common/rya.api.function/pom.xml | 8 +-
.../function/aggregation/AggregationState.java | 2 +-
.../function/aggregation/AggregationType.java | 12 +-
.../aggregation/AggregationsEvaluator.java | 14 +-
.../function/aggregation/AverageFunction.java | 25 +-
.../api/function/aggregation/CountFunction.java | 13 +-
.../api/function/aggregation/MaxFunction.java | 6 +-
.../api/function/aggregation/MinFunction.java | 6 +-
.../api/function/aggregation/SumFunction.java | 20 +-
.../api/function/filter/FilterEvaluator.java | 35 +-
.../api/function/join/LazyJoiningIterator.java | 6 +-
.../rya/api/function/join/LeftOuterJoin.java | 2 +-
.../projection/MultiProjectionEvaluator.java | 22 +-
.../projection/ProjectionEvaluator.java | 32 +-
.../function/sp/StatementPatternMatcher.java | 12 +-
.../TemporalInstantRelationFunction.java | 8 +-
.../TemporalIntervalRelationFunction.java | 8 +-
...j.query.algebra.evaluation.function.Function | 22 +
...f.query.algebra.evaluation.function.Function | 22 -
.../api/function/join/IterativeJoinTest.java | 15 +-
.../api/function/join/LeftOuterJoinTest.java | 73 +-
.../rya/api/function/join/NaturalJoinTest.java | 73 +-
.../temporal/AfterTemporalFunctionsTest.java | 8 +-
.../temporal/BeforeTemporalFunctionsTest.java | 8 +-
.../temporal/EqualsTemporalFunctionsTest.java | 8 +-
.../temporal/WithinTemporalFunctionsTest.java | 10 +-
.../function/filter/FilterEvaluatorTest.java | 25 +-
.../MultiProjectionEvaluatorTest.java | 50 +-
.../projection/ProjectionEvaluatorTest.java | 72 +-
.../sp/StatementPatternMatcherTest.java | 86 +-
common/rya.api.model/pom.xml | 8 +-
.../rya/api/model/BindingSetDecorator.java | 6 +-
.../rya/api/model/StatementDecorator.java | 10 +-
.../rya/api/model/VisibilityBindingSet.java | 2 +-
.../rya/api/model/VisibilityStatement.java | 2 +-
.../rya/api/model/VisibilityBindingSetTest.java | 8 +-
common/rya.api/pom.xml | 33 +-
.../api/RdfCloudTripleStoreConfiguration.java | 24 +-
...RdfCloudTripleStoreConfigurationBuilder.java | 4 +-
.../rya/api/RdfCloudTripleStoreConstants.java | 22 +-
.../rya/api/RdfCloudTripleStoreStatement.java | 28 +-
.../rya/api/RdfCloudTripleStoreUtils.java | 52 +-
.../rya/api/client/ExecuteSparqlQuery.java | 4 +-
.../apache/rya/api/client/LoadStatements.java | 4 +-
.../rya/api/client/LoadStatementsFile.java | 4 +-
.../rya/api/date/DateTimeTtlValueConverter.java | 8 +-
.../api/date/TimestampTtlStrValueConverter.java | 4 +-
.../api/date/TimestampTtlValueConverter.java | 4 +-
.../apache/rya/api/date/TtlValueConverter.java | 10 +-
.../java/org/apache/rya/api/domain/Node.java | 4 +-
.../org/apache/rya/api/domain/RangeURI.java | 9 +-
.../org/apache/rya/api/domain/RangeValue.java | 4 +-
.../org/apache/rya/api/domain/RyaSchema.java | 8 +-
.../java/org/apache/rya/api/domain/RyaType.java | 28 +-
.../apache/rya/api/domain/RyaTypePrefix.java | 6 +-
.../org/apache/rya/api/domain/RyaTypeRange.java | 8 +-
.../org/apache/rya/api/domain/RyaTypeUtils.java | 14 +-
.../java/org/apache/rya/api/domain/RyaURI.java | 10 +-
.../rya/api/domain/StatementMetadata.java | 6 +-
.../org/apache/rya/api/domain/VarNameUtils.java | 202 ++
.../kryo/RyaStatementSerializer.java | 19 +-
.../rya/api/functions/DateTimeWithinPeriod.java | 36 +-
.../org/apache/rya/api/functions/OWLTime.java | 28 +-
.../java/org/apache/rya/api/path/PathUtils.java | 2 +-
.../apache/rya/api/persist/RdfEvalStatsDAO.java | 8 +-
.../rya/api/persist/RyaNamespaceManager.java | 6 +-
.../api/persist/index/RyaSecondaryIndexer.java | 14 +-
.../persist/joinselect/SelectivityEvalDAO.java | 6 +-
.../rya/api/persist/query/BatchRyaQuery.java | 5 +-
.../rya/api/persist/query/RyaQueryEngine.java | 8 +-
.../rya/api/persist/query/RyaQueryOptions.java | 8 +-
.../rya/api/persist/query/join/HashJoin.java | 10 +-
.../api/persist/query/join/IterativeJoin.java | 19 +-
.../apache/rya/api/persist/query/join/Join.java | 10 +-
.../rya/api/persist/query/join/MergeJoin.java | 19 +-
.../rya/api/persist/utils/RyaDAOHelper.java | 26 +-
.../api/persist/utils/RyaDaoQueryWrapper.java | 27 +-
.../query/strategy/TriplePatternStrategy.java | 9 +-
.../wholerow/NullRowTriplePatternStrategy.java | 4 +-
.../resolver/CustomRyaTypeResolverMapping.java | 10 +-
.../rya/api/resolver/RdfToRyaConversions.java | 28 +-
.../org/apache/rya/api/resolver/RyaContext.java | 12 +-
.../rya/api/resolver/RyaToRdfConversions.java | 35 +-
.../rya/api/resolver/RyaTripleContext.java | 3 -
.../rya/api/resolver/RyaTypeResolver.java | 7 +-
.../api/resolver/RyaTypeResolverMapping.java | 4 +-
.../resolver/impl/BooleanRyaTypeResolver.java | 4 +-
.../api/resolver/impl/ByteRyaTypeResolver.java | 4 +-
.../resolver/impl/CustomDatatypeResolver.java | 4 +-
.../resolver/impl/DateTimeRyaTypeResolver.java | 6 +-
.../resolver/impl/DoubleRyaTypeResolver.java | 6 +-
.../api/resolver/impl/FloatRyaTypeResolver.java | 4 +-
.../resolver/impl/IntegerRyaTypeResolver.java | 4 +-
.../api/resolver/impl/LongRyaTypeResolver.java | 4 +-
.../api/resolver/impl/RyaTypeResolverImpl.java | 12 +-
.../rya/api/resolver/impl/RyaURIResolver.java | 4 +-
.../api/resolver/impl/ShortRyaTypeResolver.java | 4 +-
.../api/utils/CloseableIterableIteration.java | 5 +-
.../rya/api/utils/EnumerationWrapper.java | 6 +-
.../apache/rya/api/utils/IteratorWrapper.java | 6 +-
.../rya/api/utils/NullableStatementImpl.java | 16 +-
.../api/utils/PeekingCloseableIteration.java | 3 +-
.../apache/rya/api/utils/QueryInvestigator.java | 4 +-
.../RyaStatementAddBindingSetFunction.java | 9 +-
...ementRemoveBindingSetCloseableIteration.java | 8 +-
...j.query.algebra.evaluation.function.Function | 17 +
...f.query.algebra.evaluation.function.Function | 17 -
.../org/apache/rya/api/domain/RyaTypeTest.java | 2 +-
.../rya/api/domain/StatementMetadataTest.java | 1 -
.../api/functions/DateTimeWithinPeriodTest.java | 84 +-
.../AbstractTriplePatternStrategyTest.java | 6 +-
...shedPoWholeRowTriplePatternStrategyTest.java | 37 +-
...hedSpoWholeRowTriplePatternStrategyTest.java | 22 +-
.../wholerow/MockRdfCloudConfiguration.java | 32 -
.../strategy/wholerow/MockRdfConfiguration.java | 32 +
.../NullRowTriplePatternStrategyTest.java | 8 +-
.../OspWholeRowTriplePatternStrategyTest.java | 2 +-
.../PoWholeRowTriplePatternStrategyTest.java | 2 +-
.../SpoWholeRowTriplePatternStrategyTest.java | 2 +-
.../apache/rya/api/resolver/RyaContextTest.java | 17 +-
.../impl/CustomDatatypeResolverTest.java | 7 +-
.../impl/DateTimeRyaTypeResolverTest.java | 23 +-
.../impl/DoubleRyaTypeResolverTest.java | 6 +-
.../impl/IntegerRyaTypeResolverTest.java | 7 +-
.../resolver/impl/LongRyaTypeResolverTest.java | 8 +-
.../rya/api/utils/QueryInvestigatorTest.java | 2 +-
.../org/apache/rya/api/utils/RdfIOTest.java | 4 +-
common/rya.provenance/pom.xml | 4 +-
.../ProvenanceCollectionException.java | 3 +-
.../TriplestoreProvenanceCollector.java | 8 +-
.../provenance/rdf/BaseProvenanceModel.java | 39 +-
.../provenance/rdf/RDFProvenanceModel.java | 5 +-
.../TriplestoreProvenanceCollectorTest.java | 19 +-
.../provenance/rdf/BaseProvenanceModelTest.java | 3 +-
dao/accumulo.rya/pom.xml | 21 +-
.../AccumuloNamespaceTableIterator.java | 10 +-
.../rya/accumulo/AccumuloRdfEvalStatsDAO.java | 4 +-
.../rya/accumulo/AccumuloRdfQueryIterator.java | 12 +-
.../org/apache/rya/accumulo/AccumuloRyaDAO.java | 5 +-
.../accumulo/DefineTripleQueryRangeFactory.java | 6 +-
.../apache/rya/accumulo/RyaTableKeyValues.java | 11 +-
.../rya/accumulo/RyaTableMutationsFactory.java | 12 +-
.../accumulo/experimental/AccumuloIndexer.java | 2 -
.../accumulo/query/AccumuloRyaQueryEngine.java | 5 +-
.../query/KeyValueToRyaStatementFunction.java | 11 +-
.../accumulo/query/RangeBindingSetEntries.java | 17 +-
.../RyaStatementBindingSetKeyValueIterator.java | 23 +-
.../query/RyaStatementKeyValueIterator.java | 11 +-
.../apache/rya/accumulo/AccumuloRyaDAOTest.java | 65 +-
.../DefineTripleQueryRangeFactoryTest.java | 50 +-
.../apache/rya/mongodb/MongoDBQueryEngine.java | 9 +-
.../rya/mongodb/MongoDBRdfConfiguration.java | 2 +-
.../AggregationPipelineQueryNode.java | 43 +-
.../AggregationPipelineQueryOptimizer.java | 8 +-
.../aggregation/PipelineResultIteration.java | 25 +-
.../SparqlToPipelineTransformVisitor.java | 23 +-
.../dao/SimpleMongoDBNamespaceManager.java | 5 +-
.../dao/SimpleMongoDBStorageStrategy.java | 10 +-
.../RyaStatementBindingSetCursorIterator.java | 5 +-
.../iter/RyaStatementCursorIterator.java | 8 +-
.../rya/mongodb/MongoDBQueryEngineIT.java | 39 +-
.../SimpleMongoDBStorageStrategyTest.java | 2 +-
.../AggregationPipelineQueryNodeTest.java | 36 +-
.../mongodb/aggregation/PipelineQueryIT.java | 131 +-
.../PipelineResultIterationTest.java | 16 +-
.../SparqlToPipelineTransformVisitorTest.java | 50 +-
extras/indexing/pom.xml | 8 +-
.../iterators/BindingSetHashJoinIterator.java | 25 +-
.../pcj/iterators/IteratorCombiner.java | 11 +-
.../PCJKeyToCrossProductBindingSetIterator.java | 23 +-
.../PCJKeyToJoinBindingSetIterator.java | 23 +-
.../client/accumulo/AccumuloBatchUpdatePCJ.java | 19 +-
.../api/client/accumulo/AccumuloCreatePCJ.java | 12 +-
.../accumulo/AccumuloCreatePeriodicPCJ.java | 12 +-
.../accumulo/AccumuloDeletePeriodicPCJ.java | 4 +-
.../accumulo/AccumuloExecuteSparqlQuery.java | 22 +-
.../api/client/accumulo/AccumuloInstall.java | 12 +-
.../client/accumulo/AccumuloLoadStatements.java | 14 +-
.../accumulo/AccumuloLoadStatementsFile.java | 18 +-
.../api/client/mongo/MongoBatchUpdatePCJ.java | 28 +-
.../client/mongo/MongoExecuteSparqlQuery.java | 20 +-
.../rya/api/client/mongo/MongoInstall.java | 4 +-
.../api/client/mongo/MongoLoadStatements.java | 12 +-
.../client/mongo/MongoLoadStatementsFile.java | 14 +-
.../org/apache/rya/indexing/DocIdIndexer.java | 15 +-
.../rya/indexing/FilterFunctionOptimizer.java | 69 +-
.../apache/rya/indexing/FreeTextIndexer.java | 16 +-
.../org/apache/rya/indexing/GeoConstants.java | 33 +-
.../ExternalIndexMatcher.java | 3 +-
.../GeneralizedExternalProcessor.java | 49 +-
.../IndexPlanValidator/IndexPlanValidator.java | 33 +-
.../IndexPlanValidator/IndexTupleGenerator.java | 3 +-
.../IndexedExecutionPlanGenerator.java | 9 +-
.../IndexedQueryPlanSelector.java | 5 +-
.../ThreshholdPlanSelector.java | 29 +-
.../TupleExecutionPlanGenerator.java | 23 +-
.../IndexPlanValidator/TupleReArranger.java | 29 +-
.../IndexPlanValidator/TupleValidator.java | 3 +-
.../ValidIndexCombinationGenerator.java | 28 +-
.../VarConstantIndexListPruner.java | 16 +-
.../org/apache/rya/indexing/IndexingExpr.java | 14 +-
.../rya/indexing/IndexingFunctionRegistry.java | 46 +-
.../apache/rya/indexing/IteratorFactory.java | 32 +-
.../java/org/apache/rya/indexing/KeyParts.java | 29 +-
.../org/apache/rya/indexing/SearchFunction.java | 9 +-
.../rya/indexing/SearchFunctionFactory.java | 11 +-
.../rya/indexing/StatementConstraints.java | 12 +-
.../rya/indexing/StatementSerializer.java | 44 +-
.../apache/rya/indexing/TemporalIndexer.java | 41 +-
.../apache/rya/indexing/TemporalTupleSet.java | 88 +-
.../accumulo/AccumuloIndexingConfiguration.java | 2 +-
.../rya/indexing/accumulo/ConfigUtils.java | 16 +-
.../accumulo/entity/AccumuloDocIdIndexer.java | 35 +-
.../accumulo/entity/EntityCentricIndex.java | 4 +-
.../accumulo/entity/EntityOptimizer.java | 24 +-
.../accumulo/entity/EntityTupleSet.java | 22 +-
.../rya/indexing/accumulo/entity/StarQuery.java | 18 +-
.../freetext/AccumuloFreeTextIndexer.java | 17 +-
.../accumulo/freetext/ColumnPrefixes.java | 5 +-
.../accumulo/freetext/FreeTextTupleSet.java | 23 +-
.../accumulo/freetext/LuceneTokenizer.java | 8 +-
.../temporal/AccumuloTemporalIndexer.java | 17 +-
.../indexing/entity/EntityIndexOptimizer.java | 8 +-
.../indexing/entity/EntityIndexSetProvider.java | 16 +-
.../entity/EntityToSegmentConverter.java | 8 +-
.../rya/indexing/entity/model/Entity.java | 20 +-
.../indexing/entity/query/EntityQueryNode.java | 28 +-
.../storage/mongo/EntityDocumentConverter.java | 6 +-
.../storage/mongo/RyaTypeDocumentConverter.java | 8 +-
.../entity/update/BaseEntityIndexer.java | 8 +-
.../external/PrecomputedJoinIndexer.java | 4 +-
.../accumulo/AccumuloPcjStorageConfig.java | 3 +-
.../external/fluo/FluoPcjUpdaterConfig.java | 3 +-
.../matching/AbstractExternalSetMatcher.java | 52 +-
.../AbstractExternalSetMatcherFactory.java | 6 +-
.../matching/AbstractExternalSetOptimizer.java | 26 +-
.../external/matching/AbstractQuerySegment.java | 8 +-
.../indexing/external/matching/BasicRater.java | 9 +-
.../external/matching/ExternalSetConverter.java | 2 +-
.../external/matching/ExternalSetMatcher.java | 36 +-
.../external/matching/ExternalSetProvider.java | 22 +-
.../external/matching/FlattenedOptional.java | 38 +-
.../indexing/external/matching/JoinSegment.java | 36 +-
.../external/matching/JoinSegmentMatcher.java | 5 +-
.../external/matching/MatcherUtilities.java | 30 +-
.../external/matching/OptionalJoinSegment.java | 14 +-
.../matching/OptionalJoinSegmentMatcher.java | 5 +-
.../matching/QueryNodeConsolidator.java | 6 +-
.../external/matching/QueryNodeListRater.java | 22 +-
.../matching/QueryNodesToTupleExpr.java | 10 +-
.../external/matching/QuerySegment.java | 6 +-
.../external/matching/QuerySegmentFactory.java | 30 +-
.../matching/TopOfQueryFilterRelocator.java | 12 +-
.../external/tupleSet/AccumuloIndexSet.java | 34 +-
.../external/tupleSet/ExternalTupleSet.java | 52 +-
.../external/tupleSet/ParsedQueryUtil.java | 14 +-
.../tupleSet/SimpleExternalTupleSet.java | 12 +-
.../indexing/mongodb/AbstractMongoIndexer.java | 15 +-
.../mongodb/IndexingMongoDBStorageStrategy.java | 8 +-
.../rya/indexing/mongodb/MongoDbSmartUri.java | 10 +-
.../mongodb/MongoIndexingConfiguration.java | 4 +-
.../mongodb/freetext/MongoFreeTextIndexer.java | 7 +-
.../mongodb/pcj/MongoPcjIndexSetProvider.java | 2 +-
.../indexing/mongodb/pcj/MongoPcjQueryNode.java | 16 +-
.../mongodb/temporal/MongoTemporalIndexer.java | 7 +-
.../rya/indexing/pcj/matching/PCJOptimizer.java | 13 +-
.../pcj/matching/PCJOptimizerUtilities.java | 38 +-
.../pcj/matching/PCJToSegmentConverter.java | 38 +-
.../pcj/matching/QueryVariableNormalizer.java | 74 +-
.../provider/AbstractPcjIndexSetProvider.java | 2 +-
.../provider/AccumuloIndexSetProvider.java | 6 +-
.../rya/indexing/smarturi/SmartUriAdapter.java | 140 +-
.../rya/indexing/smarturi/SmartUriStorage.java | 12 +-
.../duplication/ApproxEqualsDetector.java | 6 +-
.../duplication/DuplicateDataDetector.java | 52 +-
.../MetadataNodeToSegmentConverter.java | 12 +-
.../statement/metadata/matching/OWLReify.java | 27 +-
.../StatementMetadataExternalSetProvider.java | 15 +-
.../matching/StatementMetadataNode.java | 42 +-
.../matching/StatementMetadataOptimizer.java | 7 +-
.../rya/sail/config/RyaAccumuloSailConfig.java | 78 +-
.../rya/sail/config/RyaAccumuloSailFactory.java | 26 +-
.../apache/rya/sail/config/RyaSailFactory.java | 4 +-
.../org.eclipse.rdf4j.sail.config.SailFactory | 1 +
.../org.openrdf.sail.config.SailFactory | 1 -
.../rdf4j/repository/config/RyaAccumuloSail.ttl | 20 +
.../repository/config/RyaAccumuloSail.ttl | 20 -
.../DocumentIndexIntersectingIteratorTest.java | 2923 +++++++++---------
.../api/client/accumulo/AccumuloAddUserIT.java | 10 +-
.../accumulo/AccumuloBatchUpdatePCJIT.java | 56 +-
.../client/accumulo/AccumuloCreatePCJIT.java | 31 +-
.../client/accumulo/AccumuloDeletePCJIT.java | 48 +-
.../accumulo/AccumuloLoadStatementsFileIT.java | 22 +-
.../client/accumulo/AccumuloRemoveUserIT.java | 8 +-
.../rya/api/client/accumulo/FluoITBase.java | 8 +-
.../api/client/mongo/MongoBatchUpdatePCJIT.java | 58 +-
.../client/mongo/MongoExecuteSparqlQueryIT.java | 48 +-
.../client/mongo/MongoLoadStatementsFileIT.java | 22 +-
.../api/client/mongo/MongoLoadStatementsIT.java | 32 +-
.../GeneralizedExternalProcessorTest.java | 9 +-
.../IndexPlanValidatorTest.java | 8 +-
.../IndexedExecutionPlanGeneratorTest.java | 9 +-
.../ThreshholdPlanSelectorTest.java | 18 +-
.../TupleExecutionPlanGeneratorTest.java | 38 +-
.../IndexPlanValidator/TupleReArrangerTest.java | 11 +-
.../ValidIndexCombinationGeneratorTest.java | 9 +-
.../VarConstantIndexListPrunerTest.java | 15 +-
.../accumulo/StatementSerializerTest.java | 47 +-
.../accumulo/entity/AccumuloDocIndexerTest.java | 97 +-
.../accumulo/entity/EntityCentricIndexTest.java | 19 +-
.../accumulo/entity/EntityOptimizerTest.java | 60 +-
.../indexing/accumulo/entity/StarQueryTest.java | 32 +-
.../freetext/AccumuloFreeTextIndexerTest.java | 94 +-
.../temporal/AccumuloTemporalIndexerTest.java | 120 +-
.../entity/query/EntityQueryNodeIT.java | 43 +-
.../mongo/EntityDocumentConverterTest.java | 4 +-
.../storage/mongo/MongoEntityStorageIT.java | 4 +-
.../mongo/RyaTypeDocumentConverterTest.java | 10 +-
.../update/mongo/MongoEntityIndexerIT.java | 6 +-
.../external/AccumuloConstantPcjIT.java | 137 +-
.../rya/indexing/external/AccumuloPcjIT.java | 406 ++-
.../indexing/external/PCJOptionalTestIT.java | 71 +-
.../external/PcjIntegrationTestingUtil.java | 36 +-
.../external/PrecompJoinOptimizerIT.java | 113 +-
.../external/PrecompJoinOptimizerTest.java | 19 +-
.../external/PrecompJoinOptimizerTest2.java | 14 +-
.../PrecompJoinOptimizerVarToConstTest.java | 15 +-
.../AccumuloIndexSetColumnVisibilityTest.java | 48 +-
.../external/tupleSet/AccumuloIndexSetTest.java | 345 +--
.../external/tupleSet/ParsedQueryUtilTest.java | 8 +-
.../tupleSet/QueryVariableNormalizerTest.java | 15 +-
.../tupleSet/SimpleExternalTupleSetTest.java | 8 +-
.../VarConstQueryVariableNormalizerTest.java | 20 +-
.../rya/indexing/mongo/MongoDbSmartUriIT.java | 41 +-
.../rya/indexing/mongo/MongoEntityIndex2IT.java | 21 +-
.../rya/indexing/mongo/MongoEntityIndexIT.java | 148 +-
.../indexing/mongo/MongoFreeTextIndexerIT.java | 48 +-
.../rya/indexing/mongo/MongoPCJIndexIT.java | 90 +-
.../indexing/mongo/MongoPcjIntegrationTest.java | 82 +-
.../indexing/mongo/MongoTemporalIndexerIT.java | 80 +-
.../pcj/matching/FlattenedOptionalTest.java | 17 +-
.../pcj/matching/JoinSegmentPCJMatcherTest.java | 26 +-
.../indexing/pcj/matching/JoinSegmentTest.java | 18 +-
.../OptionalJoinSegmentPCJMatcherTest.java | 28 +-
.../pcj/matching/OptionalJoinSegmentTest.java | 20 +-
.../pcj/matching/PCJNodeConsolidatorTest.java | 18 +-
.../indexing/pcj/matching/PCJOptimizerTest.java | 17 +-
.../pcj/matching/PCJOptimizerUtilitesTest.java | 12 +-
.../duplication/DuplicateDataDetectorIT.java | 151 +-
.../AccumuloStatementMetadataNodeTest.java | 174 +-
.../AccumuloStatementMetadataOptimizerIT.java | 44 +-
.../metadata/MongoStatementMetadataIT.java | 43 +-
.../metadata/MongoStatementMetadataNodeIT.java | 81 +-
...tatementMetadataExternalSetProviderTest.java | 20 +-
.../StatementMetadataOptimizerTest.java | 19 +-
.../metadata/StatementMetadataTestUtils.java | 25 +-
.../sail/config/RyaAccumuloSailFactoryTest.java | 100 +-
.../sail/config/RyaMongoDbSailFactoryTest.java | 16 +-
.../src/test/resources/log4j.properties | 25 +
extras/indexingExample/pom.xml | 6 +-
.../src/main/java/EntityDirectExample.java | 35 +-
.../src/main/java/InferenceExamples.java | 32 +-
.../src/main/java/MongoRyaDirectExample.java | 152 +-
.../src/main/java/ProspectorExample.java | 30 +-
.../src/main/java/RyaClientExample.java | 37 +-
.../src/main/java/RyaDirectExample.java | 102 +-
.../src/main/java/StatementMetadataExample.java | 34 +-
extras/periodic.notification/api/pom.xml | 4 +-
.../periodic/notification/api/BinPruner.java | 4 +-
.../notification/api/BindingSetExporter.java | 2 +-
.../notification/api/BindingSetRecord.java | 2 +-
.../serialization/BindingSetSerDe.java | 7 +-
extras/periodic.notification/service/pom.xml | 4 +-
.../PeriodicNotificationApplication.java | 2 +-
.../PeriodicNotificationApplicationFactory.java | 7 +-
.../exporter/KafkaExporterExecutor.java | 2 +-
.../KafkaPeriodicBindingSetExporter.java | 4 +-
.../TimestampedNotificationProcessor.java | 4 +-
.../notification/pruner/FluoBinPruner.java | 13 +-
.../PeriodicNotificationApplicationIT.java | 85 +-
.../PeriodicNotificationProviderIT.java | 2 +-
.../PeriodicNotificationExporterIT.java | 18 +-
.../PeriodicNotificationProcessorIT.java | 26 +-
.../pruner/PeriodicNotificationBinPrunerIT.java | 45 +-
.../periodic/BenchmarkStatementGenerator.java | 17 +-
.../periodic/KafkaLatencyBenchmark.java | 4 +-
.../benchmark/query/PCJOptimizerBenchmark.java | 10 +-
.../rya/benchmark/query/QueryBenchmark.java | 31 +-
.../benchmark/query/QueryBenchmarkRunIT.java | 42 +-
extras/rya.export/export.accumulo/pom.xml | 6 +
.../accumulo/AccumuloRyaStatementStore.java | 15 +-
.../accumulo/conf/AccumuloExportConstants.java | 1 +
.../export/accumulo/util/AccumuloRyaUtils.java | 4 +-
extras/rya.export/export.client/pom.xml | 17 +-
.../rya/export/client/MergeDriverClient.java | 10 +-
.../rya/export/client/conf/TimeUtils.java | 2 +-
.../org/apache/rya/indexing/export/ITBase.java | 20 +-
extras/rya.forwardchain/pom.xml | 4 +-
.../rya/forwardchain/ForwardChainConstants.java | 8 +-
.../rule/AbstractConstructRule.java | 4 +-
.../rule/AbstractInconsistencyRule.java | 2 +-
.../forwardchain/rule/AntecedentVisitor.java | 6 +-
.../rule/ConstructConsequentVisitor.java | 26 +-
.../org/apache/rya/forwardchain/rule/Rule.java | 2 +-
.../apache/rya/forwardchain/rule/Ruleset.java | 2 +-
.../forwardchain/rule/SpinConstructRule.java | 71 +-
.../strategy/MongoPipelineStrategy.java | 4 +-
.../strategy/RoundRobinStrategy.java | 2 +-
.../strategy/SailExecutionStrategy.java | 22 +-
.../rya/forwardchain/batch/MongoSpinIT.java | 66 +-
.../rule/AntecedentVisitorTest.java | 35 +-
.../rule/ConstructConsequentVisitorTest.java | 30 +-
.../rya/forwardchain/rule/RulesetTest.java | 13 +-
.../rule/SpinConstructRuleTest.java | 43 +-
.../GeoEnabledFilterFunctionOptimizer.java | 61 +-
.../org/apache/rya/indexing/GeoIndexer.java | 16 +-
.../rya/indexing/GeoIndexingTestUtils.java | 2 +-
.../apache/rya/indexing/GeoRyaSailFactory.java | 4 +-
.../indexing/accumulo/geo/GeoParseUtils.java | 16 +-
.../rya/indexing/accumulo/geo/GeoTupleSet.java | 61 +-
.../accumulo/geo/OptionalConfigUtils.java | 6 +-
.../GeoTemporalIndexSetProvider.java | 26 +-
.../geotemporal/GeoTemporalIndexer.java | 46 +-
.../GeoTemporalToSegmentConverter.java | 6 +-
.../geotemporal/model/EventQueryNode.java | 32 +-
.../accumulo/geo/GeoMesaGeoIndexer.java | 17 +-
.../geoExamples/RyaGeoDirectExample.java | 28 +-
.../indexing/accumulo/geo/GeoIndexerSfTest.java | 61 +-
.../indexing/accumulo/geo/GeoIndexerTest.java | 130 +-
.../accumulo/geo/GeoWaveGeoIndexer.java | 16 +-
.../geoExamples/GeowaveDirectExample.java | 28 +-
.../accumulo/geo/GeoWaveIndexerSfTest.java | 60 +-
.../accumulo/geo/GeoWaveIndexerTest.java | 130 +-
.../geoExamples/RyaMongoGeoDirectExample.java | 24 +-
.../GeoTemporalMongoDBStorageStrategy.java | 10 +-
.../mongo/MongoGeoTemporalIndexer.java | 8 +-
.../mongodb/geo/GeoMongoDBStorageStrategy.java | 4 +-
.../indexing/mongodb/geo/MongoGeoIndexer.java | 9 +-
.../indexing/mongodb/geo/MongoGeoTupleSet.java | 43 +-
.../geotemporal/GeoTemporalProviderTest.java | 40 +-
.../geotemporal/GeoTemporalTestUtils.java | 16 +-
.../geotemporal/MongoGeoTemporalIndexIT.java | 31 +-
.../geotemporal/model/EventQueryNode2IT.java | 53 +-
.../GeoTemporalMongoDBStorageStrategyTest.java | 87 +-
.../mongo/MongoGeoTemporalIndexerIT.java | 27 +-
.../indexing/mongo/MongoGeoIndexerFilterIT.java | 37 +-
.../rya/indexing/mongo/MongoGeoIndexerIT.java | 130 +-
.../rya/indexing/mongo/MongoGeoIndexerSfIT.java | 24 +-
.../indexing/mongo/MongoIndexerDeleteIT.java | 48 +-
.../pcj/storage/PeriodicQueryResultStorage.java | 12 +-
.../pcj/storage/PrecomputedJoinStorage.java | 2 +-
.../storage/accumulo/AccumuloPcjSerializer.java | 18 +-
.../storage/accumulo/AccumuloPcjStorage.java | 4 +-
.../AccumuloPeriodicQueryResultStorage.java | 28 +-
.../AccumuloValueBindingSetIterator.java | 2 +-
.../storage/accumulo/BindingSetConverter.java | 4 +-
.../accumulo/BindingSetStringConverter.java | 25 +-
.../pcj/storage/accumulo/PcjTables.java | 16 +-
.../storage/accumulo/PcjVarOrderFactory.java | 4 +-
.../accumulo/ScannerBindingSetIterator.java | 4 +-
.../storage/accumulo/ShiftVarOrderFactory.java | 10 +-
.../pcj/storage/accumulo/VariableOrder.java | 3 +-
.../accumulo/VisibilityBindingSetSerDe.java | 35 +-
.../VisibilityBindingSetStringConverter.java | 6 +-
.../storage/mongo/MongoBindingSetConverter.java | 2 +-
.../pcj/storage/mongo/MongoPcjDocuments.java | 28 +-
.../pcj/storage/mongo/MongoPcjStorage.java | 2 +-
.../accumulo/AccumuloPcjSerializerTest.java | 75 +-
.../accumulo/BindingSetStringConverterTest.java | 47 +-
.../pcj/storage/accumulo/PcjTablesIT.java | 129 +-
.../storage/accumulo/PcjTablesWithMockTest.java | 94 +-
.../accumulo/ShiftVarOrderFactoryTest.java | 4 +-
.../accumulo/VisibilityBindingSetSerDeTest.java | 8 +-
...VisibilityBindingSetStringConverterTest.java | 32 +-
.../integration/AccumuloPcjStorageIT.java | 38 +-
.../AccumuloPeriodicQueryResultStorageIT.java | 83 +-
.../storage/mongo/MongoPcjDocumentsTest.java | 19 +-
.../pcj/storage/mongo/MongoPcjStorageIT.java | 32 +-
.../mongo/PcjDocumentsIntegrationTest.java | 112 +-
.../storage/mongo/PcjDocumentsWithMockTest.java | 30 +-
extras/rya.manual/src/site/markdown/alx.md | 6 +-
extras/rya.manual/src/site/markdown/loaddata.md | 6 +-
.../rya.manual/src/site/markdown/mapreduce.md | 2 +-
extras/rya.manual/src/site/markdown/overview.md | 2 +-
.../rya.manual/src/site/markdown/sm-addauth.md | 6 +-
extras/rya.manual/src/site/markdown/sm-infer.md | 78 +-
.../src/site/markdown/sm-namedgraph.md | 14 +-
.../src/site/markdown/sm-simpleaqr.md | 6 +-
.../src/site/markdown/sm-sparqlquery.md | 10 +-
.../src/site/markdown/sm-updatedata.md | 2 +-
.../mr/merge/mappers/BaseRuleMapper.java | 9 +-
.../mr/merge/mappers/MergeToolMapper.java | 9 +-
.../mr/merge/util/AccumuloQueryRuleset.java | 13 +-
.../mr/merge/util/AccumuloRyaUtils.java | 9 +-
.../rya/accumulo/mr/merge/util/CopyRule.java | 46 +-
.../accumulo/mr/merge/util/QueryRuleset.java | 59 +-
.../rya/accumulo/mr/merge/CopyToolTest.java | 3 +-
.../rya/accumulo/mr/merge/MergeToolTest.java | 13 +-
.../rya/accumulo/mr/merge/RulesetCopyIT.java | 47 +-
.../rya/accumulo/mr/merge/util/TestUtils.java | 6 +-
.../indexing/pcj/fluo/api/CreateFluoPcj.java | 14 +-
.../pcj/fluo/api/CreatePeriodicQuery.java | 4 +-
.../indexing/pcj/fluo/api/DeleteFluoPcj.java | 2 +-
.../indexing/pcj/fluo/api/ListFluoQueries.java | 6 +-
extras/rya.pcj.fluo/pcj.fluo.app/pom.xml | 4 +-
.../pcj/fluo/app/AggregationResultUpdater.java | 33 +-
.../indexing/pcj/fluo/app/ConstructGraph.java | 13 +-
.../pcj/fluo/app/ConstructProjection.java | 72 +-
.../pcj/fluo/app/FilterResultUpdater.java | 42 +-
.../pcj/fluo/app/FluoStringConverter.java | 70 +-
.../pcj/fluo/app/PeriodicQueryUpdater.java | 14 +-
.../pcj/fluo/app/ProjectionResultUpdater.java | 2 +-
.../fluo/app/batch/JoinBatchInformation.java | 3 +-
.../KryoVisibilityBindingSetSerializer.java | 29 +-
.../fluo/app/observers/AggregationObserver.java | 2 +-
.../pcj/fluo/app/observers/FilterObserver.java | 2 +-
.../pcj/fluo/app/observers/JoinObserver.java | 2 +-
.../app/observers/StatementPatternObserver.java | 2 +-
.../pcj/fluo/app/observers/TripleObserver.java | 3 +-
.../fluo/app/query/ConstructQueryMetadata.java | 6 +-
.../pcj/fluo/app/query/PeriodicQueryNode.java | 10 +-
.../fluo/app/query/SparqlFluoQueryBuilder.java | 77 +-
.../app/util/BindingHashShardingFunction.java | 2 +-
.../pcj/fluo/app/util/BindingSetUtil.java | 6 +-
.../pcj/fluo/app/util/FilterSerializer.java | 20 +-
.../pcj/fluo/app/util/PeriodicQueryUtil.java | 58 +-
.../indexing/pcj/fluo/app/util/RowKeyUtil.java | 2 +-
.../pcj/fluo/app/ConstructGraphTest.java | 29 +-
.../pcj/fluo/app/ConstructGraphTestUtils.java | 3 +-
.../pcj/fluo/app/ConstructProjectionTest.java | 33 +-
.../pcj/fluo/app/FluoStringConverterTest.java | 43 +-
.../pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java | 5 +-
.../BatchInformationSerializerTest.java | 10 +-
.../fluo/app/query/PeriodicQueryUtilTest.java | 40 +-
.../util/BindingHashShardingFunctionTest.java | 16 +-
.../pcj/fluo/app/util/FilterSerializerTest.java | 8 +-
extras/rya.pcj.fluo/pcj.fluo.client/pom.xml | 18 +-
.../pcj/fluo/client/PcjAdminClient.java | 21 +-
.../fluo/client/command/LoadTriplesCommand.java | 8 +-
.../fluo/client/command/NewQueryCommand.java | 21 +-
.../pcj/fluo/client/util/FluoLoader.java | 21 +-
.../fluo/client/util/PcjMetadataRenderer.java | 6 +-
.../fluo/client/util/QueryReportRenderer.java | 6 +-
extras/rya.pcj.fluo/pcj.fluo.demo/pom.xml | 4 +-
.../apache/rya/indexing/pcj/fluo/demo/Demo.java | 3 +-
.../rya/indexing/pcj/fluo/demo/DemoDriver.java | 11 +-
.../pcj/fluo/demo/FluoAndHistoricPcjsDemo.java | 18 +-
.../pcj/fluo/ConstructGraphTestUtils.java | 3 +-
.../indexing/pcj/fluo/api/GetPcjMetadataIT.java | 8 +-
.../fluo/app/query/FluoQueryMetadataDAOIT.java | 12 +-
.../indexing/pcj/fluo/integration/BatchIT.java | 24 +-
.../pcj/fluo/integration/CreateDeleteIT.java | 34 +-
.../integration/CreateDeletePeriodicPCJ.java | 24 +-
.../indexing/pcj/fluo/integration/InputIT.java | 64 +-
.../pcj/fluo/integration/KafkaExportIT.java | 262 +-
.../integration/KafkaRyaSubGraphExportIT.java | 56 +-
.../indexing/pcj/fluo/integration/QueryIT.java | 419 +--
.../pcj/fluo/integration/RyaExportIT.java | 30 +-
.../RyaInputIncrementalUpdateIT.java | 82 +-
.../pcj/fluo/integration/StreamingTestIT.java | 19 +-
.../HistoricStreamingVisibilityIT.java | 32 +-
.../pcj/fluo/visibility/PcjVisibilityIT.java | 78 +-
.../rya/pcj/fluo/test/base/FluoITBase.java | 31 +-
.../pcj/fluo/test/base/KafkaExportITBase.java | 6 +-
.../rya.pcj.fluo/rya.pcj.functions.geo/pom.xml | 5 +-
.../pcj/functions/geo/FunctionAdapter.java | 18 +-
...j.query.algebra.evaluation.function.Function | 30 +
...f.query.algebra.evaluation.function.Function | 30 -
.../pcj/functions/geo/GeoFunctionsIT.java | 138 +-
.../pcj/functions/geo/GeoFunctionsTest.java | 4 +-
.../joinselect/AccumuloSelectivityEvalDAO.java | 62 +-
.../rya/joinselect/CardinalityCalcUtil.java | 6 +-
.../rya/prospector/plans/IndexWorkPlan.java | 2 +-
.../rya/prospector/plans/impl/CountPlan.java | 4 +-
.../service/ProspectorServiceEvalStatsDAO.java | 4 +-
.../AccumuloSelectivityEvalDAOTest.java | 26 +-
.../mr/JoinSelectProspectOutputTest.java | 17 +-
.../rya/prospector/mr/ProspectorTest.java | 4 +-
.../ProspectorServiceEvalStatsDAOTest.java | 23 +-
extras/rya.reasoning/README.md | 8 +-
extras/rya.reasoning/pom.xml | 18 +-
.../apache/rya/reasoning/AbstractReasoner.java | 8 +-
.../org/apache/rya/reasoning/Derivation.java | 16 +-
.../java/org/apache/rya/reasoning/Fact.java | 49 +-
.../org/apache/rya/reasoning/LocalReasoner.java | 44 +-
.../java/org/apache/rya/reasoning/OWL2.java | 22 +-
.../java/org/apache/rya/reasoning/OwlClass.java | 16 +-
.../org/apache/rya/reasoning/OwlProperty.java | 28 +-
.../java/org/apache/rya/reasoning/Schema.java | 42 +-
.../org/apache/rya/reasoning/TypeReasoner.java | 15 +-
.../rya/reasoning/mr/AbstractReasoningTool.java | 17 +-
.../rya/reasoning/mr/ConformanceTest.java | 60 +-
.../apache/rya/reasoning/mr/ForwardChain.java | 15 +-
.../rya/reasoning/mr/ResourceWritable.java | 8 +-
.../apache/rya/reasoning/mr/SchemaWritable.java | 4 +-
.../apache/rya/reasoning/LocalReasonerTest.java | 19 +-
.../apache/rya/reasoning/ReasonerFactTest.java | 17 +-
.../rya/reasoning/SchemaReasoningTest.java | 9 +-
.../org/apache/rya/reasoning/SchemaTest.java | 45 +-
.../org/apache/rya/reasoning/TestUtils.java | 33 +-
.../reasoning/mr/DuplicateEliminationTest.java | 21 +-
.../rya/reasoning/mr/ForwardChainTest.java | 39 +-
extras/rya.streams/api/pom.xml | 4 +-
.../interactor/defaults/DefaultAddQuery.java | 4 +-
.../api/queries/InMemoryQueryChangeLog.java | 3 +-
.../api/queries/InMemoryQueryRepository.java | 4 +-
.../rya/streams/api/queries/QueryChangeLog.java | 3 +-
extras/rya.streams/client/pom.xml | 24 +-
.../streams/client/command/AddQueryCommand.java | 2 +-
.../client/command/StreamResultsCommand.java | 8 +-
.../client/util/QueryResultsOutputUtil.java | 18 +-
.../client/command/LoadStatementsCommandIT.java | 19 +-
.../client/command/RunQueryCommandIT.java | 38 +-
.../client/util/QueryResultsOutputUtilTest.java | 20 +-
.../kafka/processors/filter/GeoFilterIT.java | 29 +-
.../aggregation/AggregationProcessorIT.java | 128 +-
.../processors/filter/FilterProcessorIT.java | 14 +-
.../processors/filter/FilterProcessorTest.java | 12 +-
.../processors/filter/TemporalFilterIT.java | 41 +-
.../kafka/processors/join/JoinProcessorIT.java | 124 +-
.../projection/MultiProjectionProcessorIT.java | 20 +-
.../projection/ProjectionProcessorIT.java | 14 +-
.../sp/StatementPatternProcessorIT.java | 62 +-
extras/rya.streams/kafka/pom.xml | 4 +
.../kafka/SingleThreadKafkaStreamsFactory.java | 2 +-
.../kafka/interactor/KafkaLoadStatements.java | 24 +-
.../StatementPatternProcessorSupplier.java | 4 +-
.../AggregationProcessorSupplier.java | 2 +-
.../KeyValueAggregationStateStore.java | 2 +-
.../processors/join/KeyValueJoinStateStore.java | 2 +-
.../StatementOutputFormatterSupplier.java | 18 +-
.../kafka/queries/KafkaQueryChangeLog.java | 2 +-
.../kafka/topology/TopologyBuilderFactory.java | 2 +-
.../streams/kafka/topology/TopologyFactory.java | 34 +-
.../interactor/KafkaGetQueryResultStreamIT.java | 18 +-
.../kafka/interactor/KafkaLoadStatementsIT.java | 14 +-
.../kafka/interactor/KafkaRunQueryIT.java | 38 +-
.../output/BindingSetOutputFormatterTest.java | 14 +-
.../output/StatementOutputFormatterTest.java | 48 +-
.../MultiProjectionProcessorTest.java | 28 +-
.../projection/ProjectionProcessorTest.java | 22 +-
.../kafka/queries/KafkaQueryChangeLogIT.java | 3 +-
.../VisibilityBindingSetKafkaIT.java | 10 +-
.../VisibilityBindingSetSerdeTest.java | 8 +-
.../VisibilityStatementKafkaIT.java | 12 +-
.../VisibilityStatementSerdeTest.java | 14 +-
.../kafka/topology/TopologyFactoryTest.java | 19 +-
.../rya/streams/querymanager/QueryExecutor.java | 2 +-
.../kafka/LocalQueryExecutorIT.java | 38 +-
.../java/org/apache/rya/shell/RyaCommands.java | 12 +-
.../apache/rya/shell/RyaStreamsCommands.java | 2 +-
.../rya/shell/util/StreamsQueryFormatter.java | 6 +-
.../org/apache/rya/shell/RyaCommandsTest.java | 5 +-
.../vagrantExample/src/main/vagrant/Vagrantfile | 56 +-
.../vagrantExample/src/main/vagrant/readme.md | 41 +-
mapreduce/pom.xml | 12 +-
.../rya/accumulo/mr/AbstractAccumuloMRTool.java | 15 +-
.../org/apache/rya/accumulo/mr/MRUtils.java | 15 +-
.../rya/accumulo/mr/RdfFileInputFormat.java | 19 +-
.../apache/rya/accumulo/mr/RyaOutputFormat.java | 4 +-
.../apache/rya/accumulo/mr/RyaTypeWritable.java | 11 +-
.../accumulo/mr/examples/TextOutputExample.java | 16 +-
.../accumulo/mr/tools/AccumuloRdfCountTool.java | 10 +-
.../rya/accumulo/mr/tools/RdfFileInputTool.java | 3 +-
.../rya/accumulo/mr/tools/Upgrade322Tool.java | 21 +-
.../rya/accumulo/mr/RdfFileInputFormatTest.java | 82 +-
.../rya/accumulo/mr/RyaOutputFormatTest.java | 13 +-
.../accumulo/mr/RyaStatementWritableTest.java | 11 +-
.../mr/tools/AccumuloRdfCountToolTest.java | 139 +-
.../accumulo/mr/tools/RdfFileInputToolTest.java | 8 +-
.../accumulo/mr/tools/Upgrade322ToolTest.java | 42 +-
.../tools/UpgradeObjectSerializationTest.java | 12 +-
osgi/alx.rya.console/pom.xml | 4 +-
.../rya/alx/command/AbstractRyaCommand.java | 6 +-
.../alx/command/GetStatementsRyaCommand.java | 16 +-
.../apache/rya/alx/command/InfoRyaCommand.java | 6 +-
.../src/main/features/alx.rya-features.xml | 80 +-
.../rya/camel/cbsail/CbSailComponent.java | 14 +-
.../apache/rya/camel/cbsail/CbSailEndpoint.java | 12 +-
.../apache/rya/camel/cbsail/CbSailProducer.java | 57 +-
.../org/apache/rya/camel/cbsail/CbSailTest.java | 68 +-
osgi/pom.xml | 4 +-
osgi/rdf4j-runtime-osgi/eclipse-rdf4j-osgi.bnd | 7 +
osgi/rdf4j-runtime-osgi/pom.xml | 139 +
.../sesame-runtime-osgi/openrdf-sesame-osgi.bnd | 7 -
osgi/sesame-runtime-osgi/pom.xml | 139 -
pig/accumulo.pig/pom.xml | 4 +-
.../rya/accumulo/pig/IndexWritingTool.java | 10 +-
.../rya/accumulo/pig/SparqlQueryPigEngine.java | 47 +-
.../pig/SparqlToPigTransformVisitor.java | 33 +-
.../accumulo/pig/StatementPatternStorage.java | 40 +-
.../pig/optimizer/SimilarVarJoinOptimizer.java | 32 +-
.../pig/SparqlToPigTransformVisitorTest.java | 12 +-
.../pig/StatementPatternStorageTest.java | 21 +-
pom.xml | 125 +-
sail/pom.xml | 11 +-
.../rya/rdftriplestore/RdfCloudTripleStore.java | 14 +-
.../RdfCloudTripleStoreConnection.java | 104 +-
.../rya/rdftriplestore/RyaSailRepository.java | 12 +-
.../RyaSailRepositoryConnection.java | 23 +-
.../evaluation/ExternalBatchingIterator.java | 9 +-
.../ExternalMultipleBindingSetsIterator.java | 14 +-
.../evaluation/FilterRangeVisitor.java | 37 +-
.../evaluation/MultipleBindingSetsIterator.java | 16 +-
.../ParallelEvaluationStrategyImpl.java | 77 +-
.../evaluation/ParallelJoinIterator.java | 21 +-
.../evaluation/PushJoinDownVisitor.java | 10 +-
.../evaluation/QueryJoinOptimizer.java | 48 +-
.../evaluation/QueryJoinSelectOptimizer.java | 19 +-
...RdfCloudTripleStoreEvaluationStatistics.java | 35 +-
...pleStoreSelectivityEvaluationStatistics.java | 6 +-
.../evaluation/ReorderJoinVisitor.java | 12 +-
.../evaluation/SeparateFilterJoinsVisitor.java | 15 +-
.../inference/AbstractInferVisitor.java | 12 +-
.../inference/AllValuesFromVisitor.java | 16 +-
.../rdftriplestore/inference/DoNotExpandSP.java | 6 +-
.../inference/DomainRangeVisitor.java | 24 +-
.../inference/HasSelfVisitor.java | 20 +-
.../inference/HasValueVisitor.java | 22 +-
.../rya/rdftriplestore/inference/InferJoin.java | 8 +-
.../rdftriplestore/inference/InferUnion.java | 8 +-
.../inference/InferenceEngine.java | 382 ++-
.../inference/IntersectionOfVisitor.java | 17 +-
.../inference/InverseOfVisitor.java | 22 +-
.../rdftriplestore/inference/InverseURI.java | 8 +-
.../rdftriplestore/inference/OneOfVisitor.java | 14 +-
.../inference/PropertyChainVisitor.java | 24 +-
.../inference/ReflexivePropertyVisitor.java | 10 +-
.../rdftriplestore/inference/SameAsVisitor.java | 34 +-
.../inference/SomeValuesFromVisitor.java | 16 +-
.../inference/SubClassOfVisitor.java | 16 +-
.../inference/SubPropertyOfVisitor.java | 20 +-
.../inference/SymmetricPropertyVisitor.java | 20 +-
.../inference/TransitivePropertyVisitor.java | 16 +-
.../namespace/NamespaceManager.java | 21 +-
.../utils/CombineContextsRdfInserter.java | 27 +-
.../rdftriplestore/utils/DefaultStatistics.java | 6 +-
.../utils/FixedStatementPattern.java | 6 +-
.../rdftriplestore/utils/RdfFormatUtils.java | 101 +
.../utils/TransitivePropertySP.java | 6 +-
.../apache/rya/ArbitraryLengthQueryTest.java | 30 +-
.../test/java/org/apache/rya/HashJoinTest.java | 19 +-
.../java/org/apache/rya/IterativeJoinTest.java | 17 +-
.../test/java/org/apache/rya/MergeJoinTest.java | 19 +-
.../rya/RdfCloudTripleStoreConnectionTest.java | 275 +-
.../org/apache/rya/RdfCloudTripleStoreTest.java | 218 +-
.../rya/RdfCloudTripleStoreUtilsTest.java | 20 +-
.../QueryJoinSelectOptimizerTest.java | 29 +-
...toreSelectivityEvaluationStatisticsTest.java | 28 +-
.../evaluation/StatementPatternEvalTest.java | 61 +-
.../inference/AllValuesFromVisitorTest.java | 50 +-
.../inference/DomainRangeVisitorTest.java | 42 +-
.../inference/HasSelfVisitorTest.java | 36 +-
.../inference/HasValueVisitorTest.java | 92 +-
.../inference/InferenceEngineTest.java | 334 +-
.../rdftriplestore/inference/InferenceIT.java | 140 +-
.../inference/IntersectionOfVisitorTest.java | 44 +-
.../inference/OneOfVisitorTest.java | 70 +-
.../inference/PropertyChainTest.java | 54 +-
.../inference/ReflexivePropertyVisitorTest.java | 28 +-
.../rdftriplestore/inference/SameAsTest.java | 47 +-
.../inference/SomeValuesFromVisitorTest.java | 50 +-
spark/pom.xml | 12 +-
test/rdf/pom.xml | 8 +-
.../apache/rya/streams/kafka/RdfTestUtil.java | 24 +-
web/web.rya/pom.xml | 8 +-
.../cloudbase/sail/AbstractRDFWebServlet.java | 6 +-
.../web/cloudbase/sail/DeleteDataServlet.java | 10 +-
.../rdf/web/cloudbase/sail/LoadDataServlet.java | 10 +-
.../web/cloudbase/sail/QueryDataServlet.java | 46 +-
.../cloudbase/sail/QuerySerqlDataServlet.java | 16 +-
.../cloud/rdf/web/sail/RdfController.java | 65 +-
.../WEB-INF/spring/spring-root-extensions.xml | 2 +-
.../rdf/web/sail/RdfControllerAccumuloTest.java | 17 +-
.../cloud/rdf/web/sail/RdfControllerTest.java | 16 +-
.../test/resources/controllerTest-context.xml | 4 +-
777 files changed, 12039 insertions(+), 12291 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 45399de..fa79ef9 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ under the License. -->
## Overview
-[Apache Rya] is a scalable RDF Store that is built on top of a Columnar Index Store (such as Accumulo). It is implemented as an extension to OpenRdf to provide easy query mechanisms (SPARQL, SERQL, etc) and Rdf data storage (RDF/XML, NTriples, etc).
+[Apache Rya] is a scalable RDF Store that is built on top of a Columnar Index Store (such as Accumulo). It is implemented as an extension to RDF4J to provide easy query mechanisms (SPARQL, SERQL, etc) and Rdf data storage (RDF/XML, NTriples, etc).
Rya stands for RDF y(and) Accumulo.
@@ -125,6 +125,47 @@ Start the Tomcat server. `./bin/startup.sh`
### Load Data
+#### Direct Code
+
+Here is a code snippet for directly running against Accumulo with the code. You will need at least accumulo.rya.jar, rya.api, rya.sail.impl on the classpath and transitive dependencies. I find that Maven is the easiest way to get a project dependency tree set up.
+
+``` JAVA
+Connector connector = new ZooKeeperInstance("instance", "zoo1,zoo2,zoo3").getConnector("user", "password");
+
+final RdfCloudTripleStore store = new RdfCloudTripleStore();
+AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
+crdfdao.setConnector(connector);
+
+AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
+conf.setTablePrefix("rya_");
+conf.setDisplayQueryPlan(true);
+crdfdao.setConf(conf);
+store.setRyaDAO(crdfdao);
+
+InferenceEngine inferenceEngine = new InferenceEngine();
+inferenceEngine.setRyaDAO(crdfdao);
+inferenceEngine.setConf(conf);
+store.setInferenceEngine(inferenceEngine);
+
+Repository myRepository = new RyaSailRepository(store);
+myRepository.initialize();
+
+String query = "select * where {\n" +
+ "<http://mynamespace/ProductType1> ?p ?o.\n" +
+ "}";
+RepositoryConnection conn = myRepository.getConnection();
+System.out.println(query);
+TupleQuery tupleQuery = conn.prepareTupleQuery(
+ QueryLanguage.SPARQL, query);
+ValueFactory vf = ValueFactoryImpl.getInstance();
+
+TupleQueryResultHandler writer = new SPARQLResultsXMLWriter(System.out);
+tupleQuery.evaluate(writer);
+
+conn.close();
+myRepository.shutDown();
+```
+
#### Web REST endpoint
The War sets up a Web REST endpoint at `http://server/web.rya/loadrdf` that allows POST data to get loaded into the Rdf Store. This short tutorial will use Java code to post data.
@@ -208,14 +249,14 @@ Options:
* rdf.tablePrefix : The tables (spo, po, osp) are prefixed with this qualifier. The tables become: (rdf.tablePrefix)spo,(rdf.tablePrefix)po,(rdf.tablePrefix)osp
* ac.* : Accumulo connection parameters
-* rdf.format : See RDFFormat from openrdf, samples include (Trig, N-Triples, RDF/XML)
+* rdf.format : See RDFFormat from RDF4J, samples include (Trig, N-Triples, RDF/XML)
* io.sort.mb : Higher the value, the faster the job goes. Just remember that you will need this much ram at least per mapper
The argument is the directory/file to load. This file needs to be loaded into HDFS before running.
-#### Direct OpenRDF API
+#### Direct RDF4J API
-Here is some sample code to load data directly through the OpenRDF API. (Loading N-Triples data)
+Here is some sample code to load data directly through the RDF4J API. (Loading N-Triples data)
You will need at least accumulo.rya-<version>, rya.api, rya.sail.impl on the classpath and transitive dependencies. I find that Maven is the easiest way to get a project dependency tree set up.
``` JAVA
@@ -297,47 +338,6 @@ public class QueryDataServletRun {
Compile and run this code above, changing the url that your Rdf War is running at.
-#### Direct Code
-
-Here is a code snippet for directly running against Accumulo with the code. You will need at least accumulo.rya.jar, rya.api, rya.sail.impl on the classpath and transitive dependencies. I find that Maven is the easiest way to get a project dependency tree set up.
-
-``` JAVA
-Connector connector = new ZooKeeperInstance("instance", "zoo1,zoo2,zoo3").getConnector("user", "password");
-
-final RdfCloudTripleStore store = new RdfCloudTripleStore();
-AccumuloRyaDAO crdfdao = new AccumuloRyaDAO();
-crdfdao.setConnector(connector);
-
-AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
-conf.setTablePrefix("rya_");
-conf.setDisplayQueryPlan(true);
-crdfdao.setConf(conf);
-store.setRyaDAO(crdfdao);
-
-InferenceEngine inferenceEngine = new InferenceEngine();
-inferenceEngine.setRyaDAO(crdfdao);
-inferenceEngine.setConf(conf);
-store.setInferenceEngine(inferenceEngine);
-
-Repository myRepository = new RyaSailRepository(store);
-myRepository.initialize();
-
-String query = "select * where {\n" +
- "<http://mynamespace/ProductType1> ?p ?o.\n" +
- "}";
-RepositoryConnection conn = myRepository.getConnection();
-System.out.println(query);
-TupleQuery tupleQuery = conn.prepareTupleQuery(
- QueryLanguage.SPARQL, query);
-ValueFactory vf = ValueFactoryImpl.getInstance();
-
-TupleQueryResultHandler writer = new SPARQLResultsXMLWriter(System.out);
-tupleQuery.evaluate(writer);
-
-conn.close();
-myRepository.shutDown();
-```
-
[Apache Rya]: http://rya.incubator.apache.org/
[Accumulo]: https://accumulo.apache.org/
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/pom.xml
----------------------------------------------------------------------
diff --git a/common/rya.api.function/pom.xml b/common/rya.api.function/pom.xml
index cb09c2b..293019f 100644
--- a/common/rya.api.function/pom.xml
+++ b/common/rya.api.function/pom.xml
@@ -39,12 +39,12 @@ under the License.
<!-- Third Party Dependencies -->
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-model</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-model</artifactId>
</dependency>
<dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-queryalgebra-evaluation</artifactId>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-queryalgebra-evaluation</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationState.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationState.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationState.java
index 2551696..8e3175d 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationState.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationState.java
@@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationType.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationType.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationType.java
index 5383da1..fb0e876 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationType.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationType.java
@@ -22,12 +22,12 @@ import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.openrdf.query.algebra.AggregateOperator;
-import org.openrdf.query.algebra.Avg;
-import org.openrdf.query.algebra.Count;
-import org.openrdf.query.algebra.Max;
-import org.openrdf.query.algebra.Min;
-import org.openrdf.query.algebra.Sum;
+import org.eclipse.rdf4j.query.algebra.AggregateOperator;
+import org.eclipse.rdf4j.query.algebra.Avg;
+import org.eclipse.rdf4j.query.algebra.Count;
+import org.eclipse.rdf4j.query.algebra.Max;
+import org.eclipse.rdf4j.query.algebra.Min;
+import org.eclipse.rdf4j.query.algebra.Sum;
import com.google.common.collect.ImmutableMap;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationsEvaluator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationsEvaluator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationsEvaluator.java
index 2aa716f..d0a89fc 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationsEvaluator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AggregationsEvaluator.java
@@ -28,12 +28,12 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.visibility.VisibilitySimplifier;
-import org.openrdf.query.algebra.AggregateOperator;
-import org.openrdf.query.algebra.Group;
-import org.openrdf.query.algebra.GroupElem;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.algebra.AggregateOperator;
+import org.eclipse.rdf4j.query.algebra.Group;
+import org.eclipse.rdf4j.query.algebra.GroupElem;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import com.google.common.collect.ImmutableMap;
@@ -113,7 +113,7 @@ public class AggregationsEvaluator {
final String resultBindingName = groupElem.getName();
final AtomicReference<String> aggregatedBindingName = new AtomicReference<>();
- groupElem.visitChildren(new QueryModelVisitorBase<RuntimeException>() {
+ groupElem.visitChildren(new AbstractQueryModelVisitor<RuntimeException>() {
@Override
public void meet(final Var node) {
aggregatedBindingName.set( node.getName() );
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AverageFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AverageFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AverageFunction.java
index 4a31fce..b2c92e6 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AverageFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/AverageFunction.java
@@ -26,15 +26,15 @@ import java.math.BigInteger;
import java.util.Map;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Value;
-import org.openrdf.model.datatypes.XMLDatatypeUtil;
-import org.openrdf.model.impl.DecimalLiteralImpl;
-import org.openrdf.model.impl.IntegerLiteralImpl;
-import org.openrdf.query.algebra.MathExpr.MathOp;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.util.MathUtil;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.MathUtil;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,6 +48,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public final class AverageFunction implements AggregationFunction {
private static final Logger log = LoggerFactory.getLogger(AverageFunction.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
@@ -73,15 +74,15 @@ public final class AverageFunction implements AggregationFunction {
if (childLiteral.getDatatype() != null && XMLDatatypeUtil.isNumericDatatype(childLiteral.getDatatype())) {
try {
// Update the sum.
- final Literal oldSum = new DecimalLiteralImpl(averageState.getSum());
+ final Literal oldSum = VF.createLiteral(averageState.getSum());
final BigDecimal sum = MathUtil.compute(oldSum, childLiteral, MathOp.PLUS).decimalValue();
// Update the count.
final BigInteger count = averageState.getCount().add( BigInteger.ONE );
// Update the BindingSet to include the new average.
- final Literal sumLiteral = new DecimalLiteralImpl(sum);
- final Literal countLiteral = new IntegerLiteralImpl(count);
+ final Literal sumLiteral = VF.createLiteral(sum);
+ final Literal countLiteral = VF.createLiteral(count);
final Literal average = MathUtil.compute(sumLiteral, countLiteral, MathOp.DIVIDE);
result.addBinding(resultName, average);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/CountFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/CountFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/CountFunction.java
index 879df5e..c6d76f9 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/CountFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/CountFunction.java
@@ -24,9 +24,10 @@ import static java.util.Objects.requireNonNull;
import java.math.BigInteger;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Literal;
-import org.openrdf.model.impl.IntegerLiteralImpl;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -37,6 +38,8 @@ import edu.umd.cs.findbugs.annotations.NonNull;
*/
@DefaultAnnotation(NonNull.class)
public final class CountFunction implements AggregationFunction {
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
+
@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
checkArgument(aggregation.getAggregationType() == AggregationType.COUNT, "The CountFunction only accepts COUNT AggregationElements.");
@@ -52,12 +55,12 @@ public final class CountFunction implements AggregationFunction {
if(newBinding) {
// Initialize the binding.
- result.addBinding(resultName, new IntegerLiteralImpl(BigInteger.ONE));
+ result.addBinding(resultName, VF.createLiteral(BigInteger.ONE));
} else {
// Update the existing binding.
final Literal count = (Literal) result.getValue(resultName);
final BigInteger updatedCount = count.integerValue().add( BigInteger.ONE );
- result.addBinding(resultName, new IntegerLiteralImpl(updatedCount));
+ result.addBinding(resultName, VF.createLiteral(updatedCount));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MaxFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MaxFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MaxFunction.java
index 5b5d493..3700076 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MaxFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MaxFunction.java
@@ -22,9 +22,9 @@ import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.evaluation.util.ValueComparator;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MinFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MinFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MinFunction.java
index f1b083c..9cd233c 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MinFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/MinFunction.java
@@ -22,9 +22,9 @@ import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Value;
-import org.openrdf.query.algebra.evaluation.util.ValueComparator;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/SumFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/SumFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/SumFunction.java
index 7ddc9ae..e248ee4 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/SumFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/aggregation/SumFunction.java
@@ -24,14 +24,15 @@ import static java.util.Objects.requireNonNull;
import java.math.BigInteger;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Value;
-import org.openrdf.model.datatypes.XMLDatatypeUtil;
-import org.openrdf.model.impl.IntegerLiteralImpl;
-import org.openrdf.query.algebra.MathExpr.MathOp;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.util.MathUtil;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.Literal;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.MathUtil;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,6 +46,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public final class SumFunction implements AggregationFunction {
private static final Logger log = LoggerFactory.getLogger(SumFunction.class);
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
@@ -62,7 +64,7 @@ public final class SumFunction implements AggregationFunction {
// Get the starting number for the sum.
Literal sum;
if(newBinding) {
- sum = new IntegerLiteralImpl(BigInteger.ZERO);
+ sum = VF.createLiteral(BigInteger.ZERO);
} else {
sum = (Literal) state.getBindingSet().getValue(resultName);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
index 3ec97cb..a70fc53 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/filter/FilterEvaluator.java
@@ -21,24 +21,24 @@ package org.apache.rya.api.function.filter;
import static java.util.Objects.requireNonNull;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.URI;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.Filter;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.algebra.evaluation.TripleSource;
-import org.openrdf.query.algebra.evaluation.impl.EvaluationStrategyImpl;
-import org.openrdf.query.algebra.evaluation.util.QueryEvaluationUtil;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.Resource;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.Filter;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.StrictEvaluationStrategy;
+import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
-import info.aduna.iteration.CloseableIteration;
/**
* Processes a {@link Filter} node from a SPARQL query.
@@ -50,9 +50,9 @@ public class FilterEvaluator {
/**
* Is used to evaluate the conditions of a {@link Filter}.
*/
- private static final EvaluationStrategyImpl EVALUATOR = new EvaluationStrategyImpl(
+ private static final StrictEvaluationStrategy EVALUATOR = new StrictEvaluationStrategy(
new TripleSource() {
- private final ValueFactory valueFactory = new ValueFactoryImpl();
+ private final ValueFactory valueFactory = SimpleValueFactory.getInstance();
@Override
public ValueFactory getValueFactory() {
@@ -62,12 +62,13 @@ public class FilterEvaluator {
@Override
public CloseableIteration<? extends Statement, QueryEvaluationException> getStatements(
final Resource arg0,
- final URI arg1,
+ final IRI arg1,
final Value arg2,
final Resource... arg3) throws QueryEvaluationException {
throw new UnsupportedOperationException();
}
- });
+ },
+ null);
private final ValueExpr condition;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LazyJoiningIterator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LazyJoiningIterator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LazyJoiningIterator.java
index b504a7e..e41a6e8 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LazyJoiningIterator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LazyJoiningIterator.java
@@ -24,9 +24,9 @@ import java.util.Iterator;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.model.visibility.VisibilitySimplifier;
-import org.openrdf.query.Binding;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.query.Binding;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LeftOuterJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LeftOuterJoin.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LeftOuterJoin.java
index 79af26c..b4b9f7e 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LeftOuterJoin.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/join/LeftOuterJoin.java
@@ -26,7 +26,7 @@ import java.util.List;
import org.apache.rya.api.function.join.LazyJoiningIterator.Side;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.query.BindingSet;
+import org.eclipse.rdf4j.query.BindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/MultiProjectionEvaluator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/MultiProjectionEvaluator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/MultiProjectionEvaluator.java
index 0e9093d..9a7eac5 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/MultiProjectionEvaluator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/MultiProjectionEvaluator.java
@@ -27,15 +27,15 @@ import java.util.Optional;
import java.util.Set;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.BNode;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.BNodeGenerator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.MultiProjection;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.BNodeGenerator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.MultiProjection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -48,7 +48,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public class MultiProjectionEvaluator {
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
private final Set<ProjectionEvaluator> projections;
private final Set<String> blankNodeSourceNames;
@@ -116,7 +116,7 @@ public class MultiProjectionEvaluator {
// Generate an ID for each blank node that will appear in the results.
final Map<String, BNode> blankNodes = new HashMap<>();
for(final String blankNodeSourceName : blankNodeSourceNames) {
- blankNodes.put(blankNodeSourceName, vf.createBNode(bNodeIdFactory.nextId()));
+ blankNodes.put(blankNodeSourceName, VF.createBNode(bNodeIdFactory.nextId()));
}
// Iterate through each of the projections and create the results from them.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/ProjectionEvaluator.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/ProjectionEvaluator.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/ProjectionEvaluator.java
index 4b37448..d4b3a2d 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/ProjectionEvaluator.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/projection/ProjectionEvaluator.java
@@ -28,20 +28,20 @@ import java.util.Set;
import java.util.UUID;
import org.apache.rya.api.model.VisibilityBindingSet;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.algebra.BNodeGenerator;
-import org.openrdf.query.algebra.Extension;
-import org.openrdf.query.algebra.ExtensionElem;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.ProjectionElem;
-import org.openrdf.query.algebra.ProjectionElemList;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.ValueConstant;
-import org.openrdf.query.algebra.ValueExpr;
-import org.openrdf.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.model.BNode;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.algebra.BNodeGenerator;
+import org.eclipse.rdf4j.query.algebra.Extension;
+import org.eclipse.rdf4j.query.algebra.ExtensionElem;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.ProjectionElem;
+import org.eclipse.rdf4j.query.algebra.ProjectionElemList;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.ValueConstant;
+import org.eclipse.rdf4j.query.algebra.ValueExpr;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -63,7 +63,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public class ProjectionEvaluator {
- private final ValueFactory vf = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
/**
* All off the projection elements that define what will appear in the resulting binding sets.
@@ -175,7 +175,7 @@ public class ProjectionEvaluator {
if(blankNodes.containsKey(sourceName)) {
value = blankNodes.get(sourceName);
} else {
- value = vf.createBNode( UUID.randomUUID().toString() );
+ value = VF.createBNode( UUID.randomUUID().toString() );
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/sp/StatementPatternMatcher.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/sp/StatementPatternMatcher.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/sp/StatementPatternMatcher.java
index 208f8d1..090482d 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/sp/StatementPatternMatcher.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/sp/StatementPatternMatcher.java
@@ -22,12 +22,12 @@ import static java.util.Objects.requireNonNull;
import java.util.Optional;
-import org.openrdf.model.Statement;
-import org.openrdf.model.Value;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.Var;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.Var;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalInstantRelationFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalInstantRelationFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalInstantRelationFunction.java
index d622329..ae1b846 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalInstantRelationFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalInstantRelationFunction.java
@@ -21,10 +21,10 @@ package org.apache.rya.api.function.temporal;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIntervalRelationFunction.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIntervalRelationFunction.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIntervalRelationFunction.java
index 4a0d4bd..889353d 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIntervalRelationFunction.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIntervalRelationFunction.java
@@ -21,10 +21,10 @@ package org.apache.rya.api.function.temporal;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
-import org.openrdf.query.algebra.evaluation.function.Function;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
+import org.eclipse.rdf4j.query.algebra.evaluation.function.Function;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function b/common/rya.api.function/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
new file mode 100644
index 0000000..1172844
--- /dev/null
+++ b/common/rya.api.function/src/main/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+org.apache.rya.api.function.temporal.EqualsTemporalInstant
+org.apache.rya.api.function.temporal.BeforeTemporalInstant
+org.apache.rya.api.function.temporal.AfterTemporalInstant
+org.apache.rya.api.function.temporal.WithinTemporalInterval
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/common/rya.api.function/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function b/common/rya.api.function/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
deleted file mode 100644
index 1172844..0000000
--- a/common/rya.api.function/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function
+++ /dev/null
@@ -1,22 +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.
-#
-org.apache.rya.api.function.temporal.EqualsTemporalInstant
-org.apache.rya.api.function.temporal.BeforeTemporalInstant
-org.apache.rya.api.function.temporal.AfterTemporalInstant
-org.apache.rya.api.function.temporal.WithinTemporalInterval
[48/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
Rya-405 Refactor RyaURI to RyaIRI to match RDF4J. Closes #291
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/9c2bad66
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/9c2bad66
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/9c2bad66
Branch: refs/heads/master
Commit: 9c2bad66b0b29468e842f993052e557c68e1a110
Parents: 855d715
Author: eric.white <Er...@parsons.com>
Authored: Fri Apr 20 16:47:35 2018 -0400
Committer: Valiyil <Pu...@parsons.com>
Committed: Mon Apr 23 09:20:05 2018 -0400
----------------------------------------------------------------------
.../function/temporal/AfterTemporalInstant.java | 2 +-
.../temporal/BeforeTemporalInstant.java | 2 +-
.../temporal/EqualsTemporalInstant.java | 2 +-
.../rya/api/function/temporal/TemporalIRIs.java | 42 ++++
.../rya/api/function/temporal/TemporalURIs.java | 42 ----
.../temporal/WithinTemporalInterval.java | 2 +-
.../api/RdfCloudTripleStoreConfiguration.java | 12 +-
.../rya/api/RdfCloudTripleStoreConstants.java | 6 +-
.../org/apache/rya/api/domain/RangeIRI.java | 51 +++++
.../org/apache/rya/api/domain/RangeURI.java | 51 -----
.../java/org/apache/rya/api/domain/RyaIRI.java | 61 ++++++
.../org/apache/rya/api/domain/RyaIRIPrefix.java | 47 ++++
.../org/apache/rya/api/domain/RyaIRIRange.java | 95 +++++++++
.../org/apache/rya/api/domain/RyaStatement.java | 44 ++--
.../org/apache/rya/api/domain/RyaTypeUtils.java | 6 +-
.../java/org/apache/rya/api/domain/RyaURI.java | 61 ------
.../org/apache/rya/api/domain/RyaURIPrefix.java | 47 ----
.../org/apache/rya/api/domain/RyaURIRange.java | 95 ---------
.../rya/api/domain/StatementMetadata.java | 12 +-
.../kryo/RyaStatementSerializer.java | 8 +-
.../java/org/apache/rya/api/persist/RyaDAO.java | 4 +-
.../api/persist/index/RyaSecondaryIndexer.java | 4 +-
.../rya/api/persist/query/join/HashJoin.java | 32 +--
.../api/persist/query/join/IterativeJoin.java | 26 +--
.../apache/rya/api/persist/query/join/Join.java | 6 +-
.../rya/api/persist/query/join/MergeJoin.java | 32 +--
.../query/strategy/TriplePatternStrategy.java | 6 +-
.../HashedPoWholeRowTriplePatternStrategy.java | 8 +-
.../HashedSpoWholeRowTriplePatternStrategy.java | 12 +-
.../wholerow/NullRowTriplePatternStrategy.java | 8 +-
.../OspWholeRowTriplePatternStrategy.java | 8 +-
.../PoWholeRowTriplePatternStrategy.java | 8 +-
.../SpoWholeRowTriplePatternStrategy.java | 12 +-
.../rya/api/resolver/RdfToRyaConversions.java | 26 +--
.../org/apache/rya/api/resolver/RyaContext.java | 4 +-
.../rya/api/resolver/RyaToRdfConversions.java | 18 +-
.../rya/api/resolver/RyaTripleContext.java | 4 +-
.../rya/api/resolver/impl/RyaIRIResolver.java | 42 ++++
.../rya/api/resolver/impl/RyaURIResolver.java | 42 ----
.../api/resolver/triple/TripleRowResolver.java | 2 +-
.../impl/WholeRowHashedTripleResolver.java | 22 +-
.../triple/impl/WholeRowTripleResolver.java | 22 +-
.../apache/rya/api/domain/RyaIRIPrefixTest.java | 37 ++++
.../org/apache/rya/api/domain/RyaTypeTest.java | 26 +--
.../apache/rya/api/domain/RyaURIPrefixTest.java | 37 ----
.../rya/api/domain/StatementMetadataTest.java | 2 +-
.../rya/api/persist/query/RyaQueryTest.java | 8 +-
.../AbstractTriplePatternStrategyTest.java | 12 +-
...shedPoWholeRowTriplePatternStrategyTest.java | 42 ++--
...hedSpoWholeRowTriplePatternStrategyTest.java | 34 +--
.../NullRowTriplePatternStrategyTest.java | 16 +-
.../OspWholeRowTriplePatternStrategyTest.java | 30 +--
.../PoWholeRowTriplePatternStrategyTest.java | 32 +--
.../SpoWholeRowTriplePatternStrategyTest.java | 34 +--
.../apache/rya/api/resolver/RyaContextTest.java | 18 +-
.../api/resolver/impl/RyaIRIResolverTest.java | 40 ++++
.../api/resolver/impl/RyaURIResolverTest.java | 40 ----
.../impl/HashedWholeRowTripleResolverTest.java | 34 +--
.../triple/impl/WholeRowTripleResolverTest.java | 34 +--
.../org/apache/rya/accumulo/AccumuloRyaDAO.java | 6 +-
.../experimental/AbstractAccumuloIndexer.java | 4 +-
.../accumulo/query/AccumuloRyaQueryEngine.java | 18 +-
.../apache/rya/accumulo/AccumuloRyaDAOTest.java | 144 ++++++-------
.../org/apache/rya/mongodb/MongoDBRyaDAO.java | 4 +-
.../AggregationPipelineQueryNode.java | 12 +-
.../dao/SimpleMongoDBStorageStrategy.java | 16 +-
.../rya/mongodb/MongoDBQueryEngineIT.java | 8 +-
.../rya/mongodb/MongoDBRyaBatchWriterIT.java | 12 +-
.../apache/rya/mongodb/MongoDBRyaDAO2IT.java | 42 ++--
.../org/apache/rya/mongodb/MongoDBRyaDAOIT.java | 50 ++---
.../SimpleMongoDBStorageStrategyTest.java | 10 +-
.../mongodb/aggregation/PipelineQueryIT.java | 2 +-
extras/indexing/README.md | 8 +-
.../accumulo/AccumuloIndexingConfiguration.java | 12 +-
.../accumulo/entity/AccumuloDocIdIndexer.java | 10 +-
.../accumulo/entity/EntityCentricIndex.java | 24 +--
.../rya/indexing/accumulo/entity/StarQuery.java | 8 +-
.../accumulo/freetext/FreeTextTupleSet.java | 2 +-
.../indexing/entity/EntityIndexSetProvider.java | 16 +-
.../rya/indexing/entity/model/Entity.java | 82 +++----
.../rya/indexing/entity/model/Property.java | 8 +-
.../apache/rya/indexing/entity/model/Type.java | 12 +-
.../rya/indexing/entity/model/TypedEntity.java | 30 +--
.../indexing/entity/query/EntityQueryNode.java | 32 +--
.../indexing/entity/storage/EntityStorage.java | 6 +-
.../indexing/entity/storage/TypeStorage.java | 8 +-
.../storage/mongo/EntityDocumentConverter.java | 10 +-
.../storage/mongo/MongoEntityStorage.java | 26 +--
.../entity/storage/mongo/MongoTypeStorage.java | 10 +-
.../storage/mongo/TypeDocumentConverter.java | 8 +-
.../entity/update/BaseEntityIndexer.java | 30 +--
.../indexing/entity/update/EntityUpdater.java | 6 +-
.../external/PrecomputedJoinIndexer.java | 4 +-
.../indexing/mongodb/AbstractMongoIndexer.java | 4 +-
.../rya/indexing/mongodb/MongoDbSmartUri.java | 6 +-
.../mongodb/update/RyaObjectStorage.java | 8 +-
.../rya/indexing/smarturi/SmartUriAdapter.java | 114 +++++-----
.../rya/indexing/smarturi/SmartUriStorage.java | 10 +-
.../duplication/DuplicateDataDetector.java | 14 +-
.../StatementMetadataExternalSetProvider.java | 12 +-
.../matching/StatementMetadataNode.java | 48 ++---
.../DocumentIndexIntersectingIteratorTest.java | 16 +-
.../AccumuloIndexingConfigurationTest.java | 4 +-
.../accumulo/entity/AccumuloDocIndexerTest.java | 128 +++++------
.../accumulo/entity/EntityCentricIndexTest.java | 8 +-
.../freetext/AccumuloFreeTextIndexerTest.java | 16 +-
.../entity/query/EntityQueryNodeIT.java | 52 ++---
.../mongo/EntityDocumentConverterTest.java | 14 +-
.../storage/mongo/MongoEntityStorageIT.java | 212 +++++++++----------
.../storage/mongo/MongoTypeStorageIT.java | 72 +++----
.../mongo/TypeDocumentConverterTest.java | 22 +-
.../update/mongo/MongoEntityIndexerIT.java | 138 ++++++------
.../rya/indexing/mongo/MongoDbSmartUriIT.java | 92 ++++----
.../rya/indexing/mongo/MongoEntityIndex2IT.java | 22 +-
.../rya/indexing/mongo/MongoEntityIndexIT.java | 44 ++--
.../indexing/mongo/MongoFreeTextIndexerIT.java | 16 +-
.../duplication/DuplicateDataDetectorIT.java | 112 +++++-----
.../AccumuloStatementMetadataNodeTest.java | 106 +++++-----
.../AccumuloStatementMetadataOptimizerIT.java | 60 +++---
.../metadata/MongoStatementMetadataIT.java | 58 ++---
.../metadata/MongoStatementMetadataNodeIT.java | 64 +++---
...tatementMetadataExternalSetProviderTest.java | 16 +-
.../StatementMetadataOptimizerTest.java | 6 +-
.../metadata/StatementMetadataTestUtils.java | 16 +-
.../src/main/java/StatementMetadataExample.java | 96 ++++-----
.../export/accumulo/util/AccumuloRyaUtils.java | 38 ++--
.../accumulo/AccumuloRyaStatementStoreTest.java | 24 +--
.../apache/rya/export/accumulo/TestUtils.java | 29 ++-
.../org/apache/rya/indexing/export/ITBase.java | 10 +-
.../rya/forwardchain/ForwardChainConstants.java | 6 +-
.../rya/indexing/geotemporal/model/Event.java | 16 +-
.../geotemporal/model/EventQueryNode.java | 4 +-
.../geotemporal/storage/EventStorage.java | 4 +-
.../mongo/EventDocumentConverter.java | 4 +-
.../geotemporal/mongo/EventUpdater.java | 6 +-
.../geotemporal/mongo/MongoEventStorage.java | 10 +-
.../mongo/MongoGeoTemporalIndexer.java | 6 +-
.../geotemporal/MongoGeoTemporalIndexIT.java | 4 +-
.../geotemporal/model/EventQueryNode2IT.java | 26 +--
.../mongo/EventDocumentConverterTest.java | 4 +-
.../GeoTemporalMongoDBStorageStrategyTest.java | 8 +-
.../geotemporal/mongo/MongoEventStorageIT.java | 26 +--
.../rya/giraph/format/TestVertexFormat.java | 26 +--
.../accumulo/BindingSetStringConverter.java | 4 +-
.../mr/merge/util/AccumuloRyaUtils.java | 36 ++--
.../rya/accumulo/mr/merge/MergeToolTest.java | 2 +-
.../rya/accumulo/mr/merge/RulesetCopyIT.java | 8 +-
.../accumulo/mr/merge/demo/MergeToolDemo.java | 4 +-
.../merge/driver/MiniAccumuloClusterDriver.java | 2 +-
.../rya/accumulo/mr/merge/util/TestUtils.java | 20 +-
.../indexing/pcj/fluo/api/CreateFluoPcj.java | 14 +-
.../pcj/fluo/app/ConstructProjection.java | 6 +-
.../pcj/fluo/app/ConstructGraphTest.java | 14 +-
.../pcj/fluo/app/ConstructGraphTestUtils.java | 4 +-
.../pcj/fluo/app/ConstructProjectionTest.java | 8 +-
.../pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java | 10 +-
.../pcj/fluo/demo/FluoAndHistoricPcjsDemo.java | 54 ++---
.../pcj/fluo/ConstructGraphTestUtils.java | 4 +-
.../pcj/fluo/api/CountStatementsIT.java | 12 +-
.../indexing/pcj/fluo/api/GetQueryReportIT.java | 34 +--
.../indexing/pcj/fluo/integration/BatchIT.java | 50 ++---
.../indexing/pcj/fluo/integration/InputIT.java | 26 +--
.../integration/KafkaRyaSubGraphExportIT.java | 72 +++----
.../pcj/fluo/integration/RyaExportIT.java | 32 +--
.../pcj/fluo/visibility/PcjVisibilityIT.java | 32 +--
.../rya/prospector/plans/impl/CountPlan.java | 6 +-
.../rya/joinselect/mr/JoinSelectMapperTest.java | 4 +-
.../joinselect/mr/JoinSelectStatisticsTest.java | 42 ++--
.../rya/prospector/mr/ProspectorTest.java | 12 +-
.../ProspectorServiceEvalStatsDAOTest.java | 22 +-
.../org/apache/rya/reasoning/LocalReasoner.java | 28 +--
.../java/org/apache/rya/reasoning/OwlClass.java | 22 +-
.../org/apache/rya/reasoning/OwlProperty.java | 24 +--
.../rya/reasoning/mr/ConformanceTest.java | 6 +-
.../org/apache/rya/reasoning/TestUtils.java | 6 +-
.../processors/filter/TemporalFilterIT.java | 10 +-
.../rya/accumulo/mr/GraphXEdgeInputFormat.java | 6 +-
.../apache/rya/accumulo/mr/RyaOutputFormat.java | 12 +-
.../rya/accumulo/mr/RyaStatementWritable.java | 2 +-
.../accumulo/mr/examples/TextOutputExample.java | 14 +-
.../accumulo/mr/tools/AccumuloRdfCountTool.java | 4 +-
.../accumulo/mr/GraphXEdgeInputFormatTest.java | 8 +-
.../rya/accumulo/mr/GraphXInputFormatTest.java | 8 +-
.../rya/accumulo/mr/RyaInputFormatTest.java | 8 +-
.../rya/accumulo/mr/RyaOutputFormatTest.java | 54 ++---
.../accumulo/mr/RyaStatementWritableTest.java | 14 +-
.../mr/tools/AccumuloRdfCountToolTest.java | 16 +-
.../accumulo/mr/tools/RdfFileInputToolTest.java | 14 +-
.../accumulo/mr/tools/Upgrade322ToolTest.java | 40 ++--
.../accumulo/pig/StatementPatternStorage.java | 6 +-
.../pig/StatementPatternStorageTest.java | 12 +-
.../RdfCloudTripleStoreConnection.java | 12 +-
.../evaluation/FilterRangeVisitor.java | 6 +-
.../inference/HasValueVisitor.java | 6 +-
.../inference/InferenceEngine.java | 22 +-
.../rdftriplestore/inference/InverseIRI.java | 64 ++++++
.../inference/InverseOfVisitor.java | 8 +-
.../rdftriplestore/inference/InverseURI.java | 64 ------
.../inference/PropertyChainVisitor.java | 6 +-
.../inference/SubClassOfVisitor.java | 18 +-
.../inference/SubPropertyOfVisitor.java | 16 +-
.../inference/SymmetricPropertyVisitor.java | 4 +-
.../inference/TransitivePropertyVisitor.java | 4 +-
.../test/java/org/apache/rya/HashJoinTest.java | 128 +++++------
.../java/org/apache/rya/IterativeJoinTest.java | 124 +++++------
.../test/java/org/apache/rya/MergeJoinTest.java | 118 +++++------
.../evaluation/StatementPatternEvalTest.java | 62 +++---
.../inference/PropertyChainTest.java | 2 +-
208 files changed, 2780 insertions(+), 2781 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/AfterTemporalInstant.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/AfterTemporalInstant.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/AfterTemporalInstant.java
index fe58e37..1ec0128 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/AfterTemporalInstant.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/AfterTemporalInstant.java
@@ -32,7 +32,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
public class AfterTemporalInstant extends TemporalInstantRelationFunction {
@Override
public String getURI() {
- return TemporalURIs.AFTER;
+ return TemporalIRIs.AFTER;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/BeforeTemporalInstant.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/BeforeTemporalInstant.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/BeforeTemporalInstant.java
index 4cb12e0..1399723 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/BeforeTemporalInstant.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/BeforeTemporalInstant.java
@@ -32,7 +32,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
public class BeforeTemporalInstant extends TemporalInstantRelationFunction {
@Override
public String getURI() {
- return TemporalURIs.BEFORE;
+ return TemporalIRIs.BEFORE;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/EqualsTemporalInstant.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/EqualsTemporalInstant.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/EqualsTemporalInstant.java
index 10fe40b..ce52436 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/EqualsTemporalInstant.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/EqualsTemporalInstant.java
@@ -32,7 +32,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
public class EqualsTemporalInstant extends TemporalInstantRelationFunction {
@Override
public String getURI() {
- return TemporalURIs.EQUALS;
+ return TemporalIRIs.EQUALS;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIRIs.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIRIs.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIRIs.java
new file mode 100644
index 0000000..89f9c93
--- /dev/null
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalIRIs.java
@@ -0,0 +1,42 @@
+/*
+ * 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.rya.api.function.temporal;
+
+/**
+ * Constants for the Temporal Functions used in rya.
+ */
+public class TemporalIRIs {
+ /**
+ * All temporal functions have the namespace (<tt>http://rya.apache.org/ns/temporal#</tt>).
+ */
+ public static final String NAMESPACE = "http://rya.apache.org/ns/temporal#";
+
+ /** <tt>http://rya.apache.org/ns/temporal#equals</tt> */
+ public final static String EQUALS = NAMESPACE + "equals";
+
+ /** <tt>http://rya.apache.org/ns/temporal#before</tt> */
+ public final static String BEFORE = NAMESPACE + "before";
+
+ /** <tt>http://rya.apache.org/ns/temporal#after</tt> */
+ public final static String AFTER = NAMESPACE + "after";
+
+ /** <tt>http://rya.apache.org/ns/temporal#within</tt> */
+ public final static String WITHIN = NAMESPACE + "within";
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalURIs.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalURIs.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalURIs.java
deleted file mode 100644
index 3fd016a..0000000
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/TemporalURIs.java
+++ /dev/null
@@ -1,42 +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.rya.api.function.temporal;
-
-/**
- * Constants for the Temporal Functions used in rya.
- */
-public class TemporalURIs {
- /**
- * All temporal functions have the namespace (<tt>http://rya.apache.org/ns/temporal#</tt>).
- */
- public static final String NAMESPACE = "http://rya.apache.org/ns/temporal#";
-
- /** <tt>http://rya.apache.org/ns/temporal#equals</tt> */
- public final static String EQUALS = NAMESPACE + "equals";
-
- /** <tt>http://rya.apache.org/ns/temporal#before</tt> */
- public final static String BEFORE = NAMESPACE + "before";
-
- /** <tt>http://rya.apache.org/ns/temporal#after</tt> */
- public final static String AFTER = NAMESPACE + "after";
-
- /** <tt>http://rya.apache.org/ns/temporal#within</tt> */
- public final static String WITHIN = NAMESPACE + "within";
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/WithinTemporalInterval.java
----------------------------------------------------------------------
diff --git a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/WithinTemporalInterval.java b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/WithinTemporalInterval.java
index 5fc3e03..dcb8c94 100644
--- a/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/WithinTemporalInterval.java
+++ b/common/rya.api.function/src/main/java/org/apache/rya/api/function/temporal/WithinTemporalInterval.java
@@ -33,7 +33,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
public class WithinTemporalInterval extends TemporalIntervalRelationFunction {
@Override
public String getURI() {
- return TemporalURIs.WITHIN;
+ return TemporalIRIs.WITHIN;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
index c5d3e5f..4a10506 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConfiguration.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Set;
import org.apache.hadoop.conf.Configuration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.layout.TableLayoutStrategy;
import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
import org.apache.rya.api.persist.RdfEvalStatsDAO;
@@ -657,11 +657,11 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
return getBoolean(CONF_USE_STATEMENT_METADATA, false);
}
- public void setStatementMetadataProperties(final Set<RyaURI> metadataProperties) {
+ public void setStatementMetadataProperties(final Set<RyaIRI> metadataProperties) {
final String[] propArray = new String[metadataProperties.size()];
int i = 0;
- for(final RyaURI uri: metadataProperties) {
+ for(final RyaIRI uri: metadataProperties) {
propArray[i] = uri.getData();
i++;
}
@@ -669,12 +669,12 @@ public abstract class RdfCloudTripleStoreConfiguration extends Configuration {
}
- public Set<RyaURI> getStatementMetadataProperties() {
- final Set<RyaURI> uriSet = new HashSet<>();
+ public Set<RyaIRI> getStatementMetadataProperties() {
+ final Set<RyaIRI> uriSet = new HashSet<>();
final String[] uriStrings = getStrings(CONF_STATEMENT_METADATA_PROPERTIES);
if (uriStrings != null) {
for (final String s : uriStrings) {
- uriSet.add(new RyaURI(s));
+ uriSet.add(new RyaIRI(s));
}
}
return uriSet;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
index a0ac20d..a61137d 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/RdfCloudTripleStoreConstants.java
@@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets;
import org.apache.hadoop.io.Text;
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Literal;
import org.eclipse.rdf4j.model.Value;
@@ -141,9 +141,9 @@ public class RdfCloudTripleStoreConstants {
//TODO: This should be in a version file somewhere
public static IRI RTS_SUBJECT = VALUE_FACTORY.createIRI(NAMESPACE, "rts");
- public static RyaURI RTS_SUBJECT_RYA = new RyaURI(RTS_SUBJECT.stringValue());
+ public static RyaIRI RTS_SUBJECT_RYA = new RyaIRI(RTS_SUBJECT.stringValue());
public static IRI RTS_VERSION_PREDICATE = VALUE_FACTORY.createIRI(NAMESPACE, "version");
- public static RyaURI RTS_VERSION_PREDICATE_RYA = new RyaURI(RTS_VERSION_PREDICATE.stringValue());
+ public static RyaIRI RTS_VERSION_PREDICATE_RYA = new RyaIRI(RTS_VERSION_PREDICATE.stringValue());
public static final Value VERSION = VALUE_FACTORY.createLiteral("3.0.0");
public static RyaType VERSION_RYA = new RyaType(VERSION.stringValue());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeIRI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeIRI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeIRI.java
new file mode 100644
index 0000000..84b38d1
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeIRI.java
@@ -0,0 +1,51 @@
+package org.apache.rya.api.domain;
+
+/*
+ * 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.
+ */
+
+
+
+import org.eclipse.rdf4j.model.IRI;
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 4/11/12
+ * Time: 1:03 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class RangeIRI extends RangeValue<IRI> implements IRI {
+
+ public RangeIRI(IRI start, IRI end) {
+ super(start, end);
+ }
+
+ public RangeIRI(RangeValue rangeValue) {
+ super((IRI) rangeValue.getStart(), (IRI) rangeValue.getEnd());
+ }
+
+ @Override
+ public String getNamespace() {
+ throw new UnsupportedOperationException("Ranges do not have a namespace");
+ }
+
+ @Override
+ public String getLocalName() {
+ throw new UnsupportedOperationException("Ranges do not have a localname");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
deleted file mode 100644
index d47ab5a..0000000
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RangeURI.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.rya.api.domain;
-
-/*
- * 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.
- */
-
-
-
-import org.eclipse.rdf4j.model.IRI;
-
-/**
- * Created by IntelliJ IDEA.
- * Date: 4/11/12
- * Time: 1:03 PM
- * To change this template use File | Settings | File Templates.
- */
-public class RangeURI extends RangeValue<IRI> implements IRI {
-
- public RangeURI(IRI start, IRI end) {
- super(start, end);
- }
-
- public RangeURI(RangeValue rangeValue) {
- super((IRI) rangeValue.getStart(), (IRI) rangeValue.getEnd());
- }
-
- @Override
- public String getNamespace() {
- throw new UnsupportedOperationException("Ranges do not have a namespace");
- }
-
- @Override
- public String getLocalName() {
- throw new UnsupportedOperationException("Ranges do not have a localname");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRI.java
new file mode 100644
index 0000000..8909b05
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRI.java
@@ -0,0 +1,61 @@
+package org.apache.rya.api.domain;
+
+/*
+ * 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.
+ */
+
+import org.eclipse.rdf4j.model.IRI;
+import org.eclipse.rdf4j.model.util.URIUtil;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+
+
+/**
+ * Date: 7/16/12
+ * Time: 11:56 AM
+ */
+public class RyaIRI extends RyaType {
+
+ public RyaIRI() {
+ setDataType(XMLSchema.ANYURI);
+ }
+
+ public RyaIRI(String data) {
+ super(XMLSchema.ANYURI, data);
+ }
+
+ public RyaIRI(String namespace, String data) {
+ super(XMLSchema.ANYURI, namespace + data);
+ }
+
+ protected RyaIRI(IRI datatype, String data) {
+ super(datatype, data);
+ }
+
+ @Override
+ public void setData(String data) {
+ super.setData(data);
+ validate(data);
+ }
+
+ protected void validate(String data) {
+ if (data == null)
+ throw new IllegalArgumentException("Null not IRI");
+ URIUtil.getLocalNameIndex(data);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIPrefix.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIPrefix.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIPrefix.java
new file mode 100644
index 0000000..3251237
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIPrefix.java
@@ -0,0 +1,47 @@
+package org.apache.rya.api.domain;
+
+/*
+ * 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.
+ */
+
+
+
+import org.apache.rya.api.RdfCloudTripleStoreConstants;
+
+/**
+ * Date: 7/24/12
+ * Time: 3:26 PM
+ */
+public class RyaIRIPrefix extends RyaIRIRange {
+ public static final String LAST = "\u00FF";
+
+ public RyaIRIPrefix(String prefix) {
+ super();
+ setPrefix(prefix);
+ }
+
+ public void setPrefix(String prefix) {
+ setStart(new RyaIRI(prefix + RdfCloudTripleStoreConstants.DELIM));
+ setStop(new RyaIRI(prefix + LAST));
+ }
+
+ public String getPrefix() {
+ String data = getStart().getData();
+ return data.substring(0, data.length() - 1);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIRange.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIRange.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIRange.java
new file mode 100644
index 0000000..177048e
--- /dev/null
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaIRIRange.java
@@ -0,0 +1,95 @@
+package org.apache.rya.api.domain;
+
+/*
+ * 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.
+ */
+
+
+
+/**
+ * Date: 7/17/12
+ * Time: 9:59 AM
+ */
+public class RyaIRIRange extends RyaIRI implements RyaRange {
+ public static final RyaIRI LAST_IRI = new RyaIRI(((char) 255) + ":#" + ((char) 255));
+
+ private RyaIRI start;
+ private RyaIRI stop;
+
+ public RyaIRIRange() {
+ super();
+ }
+
+ public RyaIRIRange(RyaIRI start, RyaIRI stop) {
+ this.start = start;
+ this.stop = stop;
+ }
+
+ public RyaIRI getStart() {
+ return start;
+ }
+
+ public void setStart(RyaIRI start) {
+ this.start = start;
+ }
+
+ public RyaIRI getStop() {
+ return stop;
+ }
+
+ public void setStop(RyaIRI stop) {
+ this.stop = stop;
+ }
+
+ @Override
+ public String getData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("RyaIRIRange");
+ sb.append("{start=").append(start);
+ sb.append(", stop=").append(stop);
+ sb.append('}');
+ return sb.toString();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ if (!super.equals(o)) return false;
+
+ RyaIRIRange that = (RyaIRIRange) o;
+
+ if (start != null ? !start.equals(that.start) : that.start != null) return false;
+ if (stop != null ? !stop.equals(that.stop) : that.stop != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + (start != null ? start.hashCode() : 0);
+ result = 31 * result + (stop != null ? stop.hashCode() : 0);
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaStatement.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaStatement.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaStatement.java
index eac6740..4d870a8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaStatement.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaStatement.java
@@ -26,10 +26,10 @@ import java.util.Arrays;
* Time: 7:20 AM
*/
public class RyaStatement {
- private RyaURI subject;
- private RyaURI predicate;
+ private RyaIRI subject;
+ private RyaIRI predicate;
private RyaType object;
- private RyaURI context;
+ private RyaIRI context;
private String qualifer;
private byte[] columnVisibility;
private byte[] value;
@@ -38,34 +38,34 @@ public class RyaStatement {
public RyaStatement() {
}
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object) {
this(subject, predicate, object, null);
}
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
this(subject, predicate, object, context, null);
}
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context, final String qualifier) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context, final String qualifier) {
this(subject, predicate, object, context, qualifier, new StatementMetadata());
}
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context, final String qualifier, final StatementMetadata metadata) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context, final String qualifier, final StatementMetadata metadata) {
this(subject, predicate, object, context, qualifier, metadata, null);
}
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context, final String qualifier, final StatementMetadata metadata, final byte[] columnVisibility) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context, final String qualifier, final StatementMetadata metadata, final byte[] columnVisibility) {
this(subject, predicate, object, context, qualifier, columnVisibility, metadata.toBytes());
}
@Deprecated
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context, final String qualifier, final byte[] columnVisibility, final byte[] value) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context, final String qualifier, final byte[] columnVisibility, final byte[] value) {
this(subject, predicate, object, context, qualifier, columnVisibility, value, null);
}
@Deprecated
- public RyaStatement(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context, final String qualifier, final byte[] columnVisibility, final byte[] value, final Long timestamp) {
+ public RyaStatement(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context, final String qualifier, final byte[] columnVisibility, final byte[] value, final Long timestamp) {
this.subject = subject;
this.predicate = predicate;
this.object = object;
@@ -76,19 +76,19 @@ public class RyaStatement {
this.timestamp = timestamp != null ? timestamp : System.currentTimeMillis();
}
- public RyaURI getSubject() {
+ public RyaIRI getSubject() {
return subject;
}
- public void setSubject(final RyaURI subject) {
+ public void setSubject(final RyaIRI subject) {
this.subject = subject;
}
- public RyaURI getPredicate() {
+ public RyaIRI getPredicate() {
return predicate;
}
- public void setPredicate(final RyaURI predicate) {
+ public void setPredicate(final RyaIRI predicate) {
this.predicate = predicate;
}
@@ -100,11 +100,11 @@ public class RyaStatement {
this.object = object;
}
- public RyaURI getContext() {
+ public RyaIRI getContext() {
return context;
}
- public void setContext(final RyaURI context) {
+ public void setContext(final RyaIRI context) {
this.context = context;
}
@@ -273,18 +273,18 @@ public class RyaStatement {
return this;
}
- public RyaStatementBuilder setContext(final RyaURI ryaURI) {
- ryaStatement.setContext(ryaURI);
+ public RyaStatementBuilder setContext(final RyaIRI ryaIRI) {
+ ryaStatement.setContext(ryaIRI);
return this;
}
- public RyaStatementBuilder setSubject(final RyaURI ryaURI) {
- ryaStatement.setSubject(ryaURI);
+ public RyaStatementBuilder setSubject(final RyaIRI ryaIRI) {
+ ryaStatement.setSubject(ryaIRI);
return this;
}
- public RyaStatementBuilder setPredicate(final RyaURI ryaURI) {
- ryaStatement.setPredicate(ryaURI);
+ public RyaStatementBuilder setPredicate(final RyaIRI ryaIRI) {
+ ryaStatement.setPredicate(ryaIRI);
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
index 3136af3..505c8ba 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaTypeUtils.java
@@ -45,8 +45,8 @@ public final class RyaTypeUtils {
.put(Long.class, (v) -> longRyaType((Long) v))
.put(Short.class, (v) -> shortRyaType((Short) v))
.put(String.class, (v) -> stringRyaType((String) v))
- .put(IRI.class, (v) -> uriRyaType((IRI) v))
- .put(SimpleIRI.class, (v) -> uriRyaType((SimpleIRI) v))
+ .put(IRI.class, (v) -> iriRyaType((IRI) v))
+ .put(SimpleIRI.class, (v) -> iriRyaType((SimpleIRI) v))
.build();
/**
@@ -186,7 +186,7 @@ public final class RyaTypeUtils {
* @return the {@link RyaType} with the data type set to
* {@link XMLSchema#ANYURI} and the data set to the specified {@code value}.
*/
- public static RyaType uriRyaType(final IRI value) {
+ public static RyaType iriRyaType(final IRI value) {
return new RyaType(XMLSchema.ANYURI, value.stringValue());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
deleted file mode 100644
index 1e948ae..0000000
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURI.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.rya.api.domain;
-
-/*
- * 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.
- */
-
-import org.eclipse.rdf4j.model.IRI;
-import org.eclipse.rdf4j.model.util.URIUtil;
-import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
-
-
-/**
- * Date: 7/16/12
- * Time: 11:56 AM
- */
-public class RyaURI extends RyaType {
-
- public RyaURI() {
- setDataType(XMLSchema.ANYURI);
- }
-
- public RyaURI(String data) {
- super(XMLSchema.ANYURI, data);
- }
-
- public RyaURI(String namespace, String data) {
- super(XMLSchema.ANYURI, namespace + data);
- }
-
- protected RyaURI(IRI datatype, String data) {
- super(datatype, data);
- }
-
- @Override
- public void setData(String data) {
- super.setData(data);
- validate(data);
- }
-
- protected void validate(String data) {
- if (data == null)
- throw new IllegalArgumentException("Null not URI");
- URIUtil.getLocalNameIndex(data);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIPrefix.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIPrefix.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIPrefix.java
deleted file mode 100644
index 094eb65..0000000
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIPrefix.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.rya.api.domain;
-
-/*
- * 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.
- */
-
-
-
-import org.apache.rya.api.RdfCloudTripleStoreConstants;
-
-/**
- * Date: 7/24/12
- * Time: 3:26 PM
- */
-public class RyaURIPrefix extends RyaURIRange {
- public static final String LAST = "\u00FF";
-
- public RyaURIPrefix(String prefix) {
- super();
- setPrefix(prefix);
- }
-
- public void setPrefix(String prefix) {
- setStart(new RyaURI(prefix + RdfCloudTripleStoreConstants.DELIM));
- setStop(new RyaURI(prefix + LAST));
- }
-
- public String getPrefix() {
- String data = getStart().getData();
- return data.substring(0, data.length() - 1);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIRange.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIRange.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIRange.java
deleted file mode 100644
index 7fa9289..0000000
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/RyaURIRange.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.apache.rya.api.domain;
-
-/*
- * 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.
- */
-
-
-
-/**
- * Date: 7/17/12
- * Time: 9:59 AM
- */
-public class RyaURIRange extends RyaURI implements RyaRange {
- public static final RyaURI LAST_URI = new RyaURI(((char) 255) + ":#" + ((char) 255));
-
- private RyaURI start;
- private RyaURI stop;
-
- public RyaURIRange() {
- super();
- }
-
- public RyaURIRange(RyaURI start, RyaURI stop) {
- this.start = start;
- this.stop = stop;
- }
-
- public RyaURI getStart() {
- return start;
- }
-
- public void setStart(RyaURI start) {
- this.start = start;
- }
-
- public RyaURI getStop() {
- return stop;
- }
-
- public void setStop(RyaURI stop) {
- this.stop = stop;
- }
-
- @Override
- public String getData() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- sb.append("RyaURIRange");
- sb.append("{start=").append(start);
- sb.append(", stop=").append(stop);
- sb.append('}');
- return sb.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
-
- RyaURIRange that = (RyaURIRange) o;
-
- if (start != null ? !start.equals(that.start) : that.start != null) return false;
- if (stop != null ? !stop.equals(that.stop) : that.stop != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (start != null ? start.hashCode() : 0);
- result = 31 * result + (stop != null ? stop.hashCode() : 0);
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
index 23fe2d3..13e656a 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/StatementMetadata.java
@@ -45,9 +45,9 @@ public class StatementMetadata {
.registerTypeHierarchyAdapter(RyaType.class, new RyaTypeAdapter()).create();
public static StatementMetadata EMPTY_METADATA = new StatementMetadata();
- private Map<RyaURI, RyaType> metadataMap = new HashMap<>();
+ private Map<RyaIRI, RyaType> metadataMap = new HashMap<>();
@SuppressWarnings("serial")
- private Type type = new TypeToken<Map<RyaURI, RyaType>>(){}.getType();
+ private Type type = new TypeToken<Map<RyaIRI, RyaType>>(){}.getType();
public StatementMetadata() {}
@@ -77,11 +77,11 @@ public class StatementMetadata {
}
}
- public void addMetadata(RyaURI key, RyaType value) {
+ public void addMetadata(RyaIRI key, RyaType value) {
metadataMap.put(key, value);
}
- public Map<RyaURI, RyaType> getMetadata() {
+ public Map<RyaIRI, RyaType> getMetadata() {
return metadataMap;
}
@@ -124,8 +124,8 @@ public class StatementMetadata {
String[] array = element.getAsJsonPrimitive().getAsString().split("\u0000");
Preconditions.checkArgument(array.length == 2);
- if(type.equals(RyaURI.class.getName())){
- return new RyaURI(array[0]);
+ if(type.equals(RyaIRI.class.getName())){
+ return new RyaIRI(array[0]);
} else if(type.equals(RyaType.class.getName())){
RyaType ryaType = new RyaType(SimpleValueFactory.getInstance().createIRI(array[1]), array[0]);
return ryaType;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java b/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
index 69a09bb..71de966 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/domain/serialization/kryo/RyaStatementSerializer.java
@@ -20,7 +20,7 @@ package org.apache.rya.api.domain.serialization.kryo;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
@@ -115,16 +115,16 @@ public class RyaStatementSerializer extends Serializer<RyaStatement> {
String objectValue = input.readString();
RyaType value;
if (objectType.equals(XMLSchema.ANYURI.toString())){
- value = new RyaURI(objectValue);
+ value = new RyaIRI(objectValue);
}
else {
value = new RyaType(VF.createIRI(objectType), objectValue);
}
- RyaStatement statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), value);
+ RyaStatement statement = new RyaStatement(new RyaIRI(subject), new RyaIRI(predicate), value);
int length = 0;
boolean hasNextValue = input.readBoolean();
if (hasNextValue){
- statement.setContext(new RyaURI(input.readString()));
+ statement.setContext(new RyaIRI(input.readString()));
}
hasNextValue = input.readBoolean();
if (hasNextValue){
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaDAO.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaDAO.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaDAO.java
index d83a5e9..2820beb 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaDAO.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/RyaDAO.java
@@ -25,7 +25,7 @@ import java.util.Iterator;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.query.RyaQueryEngine;
/**
@@ -89,7 +89,7 @@ public interface RyaDAO<C extends RdfCloudTripleStoreConfiguration> extends RyaC
* @param conf
* @throws RyaDAOException
*/
- public void dropGraph(C conf, RyaURI... graphs) throws RyaDAOException;
+ public void dropGraph(C conf, RyaIRI... graphs) throws RyaDAOException;
/**
* Delete a collection of RyaStatements.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
index 2696e5b..0ac31e6 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/index/RyaSecondaryIndexer.java
@@ -27,7 +27,7 @@ import java.util.Set;
import org.apache.hadoop.conf.Configurable;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.model.IRI;
public interface RyaSecondaryIndexer extends Closeable, Flushable, Configurable {
@@ -50,7 +50,7 @@ public interface RyaSecondaryIndexer extends Closeable, Flushable, Configurable
public void deleteStatement(RyaStatement stmt) throws IOException;
- public void dropGraph(RyaURI... graphs);
+ public void dropGraph(RyaIRI... graphs);
/**
* @return the set of predicates indexed by the indexer.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
index 65c01a7..209e9d8 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/HashJoin.java
@@ -27,7 +27,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
@@ -54,20 +54,20 @@ public class HashJoin<C extends RdfCloudTripleStoreConfiguration> implements Joi
}
@Override
- public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds) throws RyaDAOException {
- ConcurrentHashMap<Map.Entry<RyaURI, RyaType>, Integer> ht = new ConcurrentHashMap<Map.Entry<RyaURI, RyaType>, Integer>();
+ public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaIRI... preds) throws RyaDAOException {
+ ConcurrentHashMap<Map.Entry<RyaIRI, RyaType>, Integer> ht = new ConcurrentHashMap<Map.Entry<RyaIRI, RyaType>, Integer>();
int count = 0;
boolean first = true;
- for (RyaURI pred : preds) {
+ for (RyaIRI pred : preds) {
count++;
//query
CloseableIteration<RyaStatement, RyaDAOException> results = ryaQueryEngine.query(new RyaStatement(null, pred, null), null);
//add to hashtable
while (results.hasNext()) {
RyaStatement next = results.next();
- RyaURI subject = next.getSubject();
+ RyaIRI subject = next.getSubject();
RyaType object = next.getObject();
- Map.Entry<RyaURI, RyaType> entry = new RdfCloudTripleStoreUtils.CustomEntry<RyaURI, RyaType>(subject, object);
+ Map.Entry<RyaIRI, RyaType> entry = new RdfCloudTripleStoreUtils.CustomEntry<RyaIRI, RyaType>(subject, object);
if (!first) {
if (!ht.containsKey(entry)) {
continue; //not in join
@@ -79,14 +79,14 @@ public class HashJoin<C extends RdfCloudTripleStoreConfiguration> implements Joi
if (first) {
first = false;
} else {
- for (Map.Entry<Map.Entry<RyaURI, RyaType>, Integer> entry : ht.entrySet()) {
+ for (Map.Entry<Map.Entry<RyaIRI, RyaType>, Integer> entry : ht.entrySet()) {
if (entry.getValue() < count) {
ht.remove(entry.getKey());
}
}
}
}
- final Enumeration<Map.Entry<RyaURI, RyaType>> keys = ht.keys();
+ final Enumeration<Map.Entry<RyaIRI, RyaType>> keys = ht.keys();
return new CloseableIteration<RyaStatement, RyaDAOException>() {
@Override
public void close() throws RyaDAOException {
@@ -100,7 +100,7 @@ public class HashJoin<C extends RdfCloudTripleStoreConfiguration> implements Joi
@Override
public RyaStatement next() throws RyaDAOException {
- Map.Entry<RyaURI, RyaType> subjObj = keys.nextElement();
+ Map.Entry<RyaIRI, RyaType> subjObj = keys.nextElement();
return new RyaStatement(subjObj.getKey(), null, subjObj.getValue());
}
@@ -112,19 +112,19 @@ public class HashJoin<C extends RdfCloudTripleStoreConfiguration> implements Joi
}
@Override
- public CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs) throws RyaDAOException {
- ConcurrentHashMap<RyaURI, Integer> ht = new ConcurrentHashMap<RyaURI, Integer>();
+ public CloseableIteration<RyaIRI, RyaDAOException> join(C conf, Map.Entry<RyaIRI, RyaType>... predObjs) throws RyaDAOException {
+ ConcurrentHashMap<RyaIRI, Integer> ht = new ConcurrentHashMap<RyaIRI, Integer>();
int count = 0;
boolean first = true;
- for (Map.Entry<RyaURI, RyaType> predObj : predObjs) {
+ for (Map.Entry<RyaIRI, RyaType> predObj : predObjs) {
count++;
- RyaURI pred = predObj.getKey();
+ RyaIRI pred = predObj.getKey();
RyaType obj = predObj.getValue();
//query
CloseableIteration<RyaStatement, RyaDAOException> results = ryaQueryEngine.query(new RyaStatement(null, pred, obj), null);
//add to hashtable
while (results.hasNext()) {
- RyaURI subject = results.next().getSubject();
+ RyaIRI subject = results.next().getSubject();
if (!first) {
if (!ht.containsKey(subject)) {
continue; //not in join
@@ -136,14 +136,14 @@ public class HashJoin<C extends RdfCloudTripleStoreConfiguration> implements Joi
if (first) {
first = false;
} else {
- for (Map.Entry<RyaURI, Integer> entry : ht.entrySet()) {
+ for (Map.Entry<RyaIRI, Integer> entry : ht.entrySet()) {
if (entry.getValue() < count) {
ht.remove(entry.getKey());
}
}
}
}
- return new EnumerationWrapper<RyaURI, RyaDAOException>(ht.keys());
+ return new EnumerationWrapper<RyaIRI, RyaDAOException>(ht.keys());
}
public RyaQueryEngine getRyaQueryEngine() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
index 9bf216c..3c1d659 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/IterativeJoin.java
@@ -27,7 +27,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
@@ -60,14 +60,14 @@ public class IterativeJoin<C extends RdfCloudTripleStoreConfiguration> implement
* @return
*/
@Override
- public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds)
+ public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaIRI... preds)
throws RyaDAOException {
Preconditions.checkNotNull(preds);
Preconditions.checkArgument(preds.length > 1, "Must join 2 or more");
//TODO: Reorder predObjs based on statistics
CloseableIteration<RyaStatement, RyaDAOException> iter = null;
- for (RyaURI pred : preds) {
+ for (RyaIRI pred : preds) {
if (iter == null) {
iter = ryaQueryEngine.query(new RyaStatement(null, pred, null), null);
} else {
@@ -88,22 +88,22 @@ public class IterativeJoin<C extends RdfCloudTripleStoreConfiguration> implement
*
*/
@Override
- public CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs)
+ public CloseableIteration<RyaIRI, RyaDAOException> join(C conf, Map.Entry<RyaIRI, RyaType>... predObjs)
throws RyaDAOException {
Preconditions.checkNotNull(predObjs);
Preconditions.checkArgument(predObjs.length > 1, "Must join 2 or more");
//TODO: Reorder predObjs based on statistics
CloseableIteration<RyaStatement, RyaDAOException> first = null;
- CloseableIteration<RyaURI, RyaDAOException> iter = null;
- for (Map.Entry<RyaURI, RyaType> entry : predObjs) {
+ CloseableIteration<RyaIRI, RyaDAOException> iter = null;
+ for (Map.Entry<RyaIRI, RyaType> entry : predObjs) {
if (first == null) {
first = ryaQueryEngine.query(new RyaStatement(null, entry.getKey(), entry.getValue()), null);
} else if (iter == null) {
- iter = join(new ConvertingIteration<RyaStatement, RyaURI, RyaDAOException>(first) {
+ iter = join(new ConvertingIteration<RyaStatement, RyaIRI, RyaDAOException>(first) {
@Override
- protected RyaURI convert(RyaStatement statement) throws RyaDAOException {
+ protected RyaIRI convert(RyaStatement statement) throws RyaDAOException {
return statement.getSubject();
}
}, entry);
@@ -115,12 +115,12 @@ public class IterativeJoin<C extends RdfCloudTripleStoreConfiguration> implement
return iter;
}
- protected CloseableIteration<RyaURI, RyaDAOException> join(final CloseableIteration<RyaURI, RyaDAOException> iteration,
- final Map.Entry<RyaURI, RyaType> predObj) {
+ protected CloseableIteration<RyaIRI, RyaDAOException> join(final CloseableIteration<RyaIRI, RyaDAOException> iteration,
+ final Map.Entry<RyaIRI, RyaType> predObj) {
//TODO: configure batch
//TODO: batch = 1, does not work
final int batch = 100;
- return new CloseableIteration<RyaURI, RyaDAOException>() {
+ return new CloseableIteration<RyaIRI, RyaDAOException>() {
private CloseableIteration<Map.Entry<RyaStatement, BindingSet>, RyaDAOException> query;
@@ -138,7 +138,7 @@ public class IterativeJoin<C extends RdfCloudTripleStoreConfiguration> implement
}
@Override
- public RyaURI next() throws RyaDAOException {
+ public RyaIRI next() throws RyaDAOException {
if (query == null || !query.hasNext()) {
if (!batchNext()) return null;
}
@@ -170,7 +170,7 @@ public class IterativeJoin<C extends RdfCloudTripleStoreConfiguration> implement
}
protected CloseableIteration<RyaStatement, RyaDAOException> join(
- final CloseableIteration<RyaStatement, RyaDAOException> iteration, final RyaURI pred) {
+ final CloseableIteration<RyaStatement, RyaDAOException> iteration, final RyaIRI pred) {
//TODO: configure batch
//TODO: batch = 1, does not work
final int batch = 100;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
index 3334cd8..21ce1a2 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/Join.java
@@ -24,7 +24,7 @@ import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
@@ -34,9 +34,9 @@ import org.eclipse.rdf4j.common.iteration.CloseableIteration;
*/
public interface Join<C extends RdfCloudTripleStoreConfiguration> {
- public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds)
+ public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaIRI... preds)
throws RyaDAOException;
- public CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs)
+ public CloseableIteration<RyaIRI, RyaDAOException> join(C conf, Map.Entry<RyaIRI, RyaType>... predObjs)
throws RyaDAOException;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
index c858327..327ff39 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/persist/query/join/MergeJoin.java
@@ -27,8 +27,8 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQueryEngine;
import org.apache.rya.api.resolver.RyaContext;
@@ -61,13 +61,13 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
* @return
*/
@Override
- public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaURI... preds)
+ public CloseableIteration<RyaStatement, RyaDAOException> join(C conf, RyaIRI... preds)
throws RyaDAOException {
Preconditions.checkNotNull(preds);
Preconditions.checkArgument(preds.length > 1, "Must join 2 or more");
//TODO: Reorder predObjs based on statistics
final List<CloseableIteration<RyaStatement, RyaDAOException>> iters = new ArrayList<CloseableIteration<RyaStatement, RyaDAOException>>();
- for (RyaURI predicate : preds) {
+ for (RyaIRI predicate : preds) {
Preconditions.checkArgument(predicate != null && !(predicate instanceof RyaRange));
CloseableIteration<RyaStatement, RyaDAOException> iter = ryaQueryEngine.query(new RyaStatement(null, predicate, null), conf);
@@ -146,16 +146,16 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
* @throws RyaDAOException
*/
@Override
- public CloseableIteration<RyaURI, RyaDAOException> join(C conf, Map.Entry<RyaURI, RyaType>... predObjs)
+ public CloseableIteration<RyaIRI, RyaDAOException> join(C conf, Map.Entry<RyaIRI, RyaType>... predObjs)
throws RyaDAOException {
Preconditions.checkNotNull(predObjs);
Preconditions.checkArgument(predObjs.length > 1, "Must join 2 or more");
//TODO: Reorder predObjs based on statistics
final List<CloseableIteration<RyaStatement, RyaDAOException>> iters = new ArrayList<CloseableIteration<RyaStatement, RyaDAOException>>();
- RyaURI earliest_subject = null;
- for (Map.Entry<RyaURI, RyaType> predObj : predObjs) {
- RyaURI predicate = predObj.getKey();
+ RyaIRI earliest_subject = null;
+ for (Map.Entry<RyaIRI, RyaType> predObj : predObjs) {
+ RyaIRI predicate = predObj.getKey();
RyaType object = predObj.getValue();
Preconditions.checkArgument(predicate != null && !(predicate instanceof RyaRange));
Preconditions.checkArgument(object != null && !(object instanceof RyaRange));
@@ -166,10 +166,10 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
ryaQueryEngine.query(new RyaStatement(null, predicate, object), conf));
} else {
iter = new PeekingCloseableIteration<RyaStatement, RyaDAOException>(
- ryaQueryEngine.query(new RyaStatement(new RyaURIRange(earliest_subject, RyaURIRange.LAST_URI), predicate, object), conf));
+ ryaQueryEngine.query(new RyaStatement(new RyaIRIRange(earliest_subject, RyaIRIRange.LAST_IRI), predicate, object), conf));
}
if (!iter.hasNext()) {
- return new EmptyIteration<RyaURI, RyaDAOException>();
+ return new EmptyIteration<RyaIRI, RyaDAOException>();
}
//setting up range to make performant query
earliest_subject = iter.peek().getSubject();
@@ -181,9 +181,9 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
//perform merge operation
- return new CloseableIteration<RyaURI, RyaDAOException>() {
+ return new CloseableIteration<RyaIRI, RyaDAOException>() {
- private RyaURI first_subj;
+ private RyaIRI first_subj;
@Override
public void close() throws RyaDAOException {
@@ -198,14 +198,14 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
}
@Override
- public RyaURI next() throws RyaDAOException {
+ public RyaIRI next() throws RyaDAOException {
if (first_subj != null) {
- RyaURI temp = first_subj;
+ RyaIRI temp = first_subj;
first_subj = null;
return temp;
}
if (check()) {
- RyaURI temp = first_subj;
+ RyaIRI temp = first_subj;
first_subj = null;
return temp;
}
@@ -222,7 +222,7 @@ public class MergeJoin<C extends RdfCloudTripleStoreConfiguration> implements Jo
first_subj = first.next().getSubject();
for (CloseableIteration<RyaStatement, RyaDAOException> iter : iters) {
if (!iter.hasNext()) return false; //no more left to join
- RyaURI iter_subj = iter.next().getSubject();
+ RyaIRI iter_subj = iter.next().getSubject();
while (first_subj.compareTo(iter_subj) < 0) {
if (!first.hasNext()) return false;
first_subj = first.next().getSubject();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
index 15a3a88..d8c8226 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/TriplePatternStrategy.java
@@ -25,7 +25,7 @@ import java.util.Map;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.triple.TripleRowRegex;
/**
@@ -34,12 +34,12 @@ import org.apache.rya.api.resolver.triple.TripleRowRegex;
*/
public interface TriplePatternStrategy {
- public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context,
+ public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(RyaIRI subject, RyaIRI predicate, RyaType object, RyaIRI context,
RdfCloudTripleStoreConfiguration conf) throws IOException;
public TABLE_LAYOUT getLayout();
- public boolean handles(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context);
+ public boolean handles(RyaIRI subject, RyaIRI predicate, RyaType object, RyaIRI context);
public TripleRowRegex buildRegex(String subject, String predicate, String object, String context, byte[] objectTypeInfo);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategy.java
index 6e8bb31..1b69721 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedPoWholeRowTriplePatternStrategy.java
@@ -34,7 +34,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
@@ -54,8 +54,8 @@ public class HashedPoWholeRowTriplePatternStrategy extends AbstractHashedTripleP
@Override
public Map.Entry<RdfCloudTripleStoreConstants.TABLE_LAYOUT,
- ByteRange> defineRange(final RyaURI subject, final RyaURI predicate, final RyaType object,
- final RyaURI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
+ ByteRange> defineRange(final RyaIRI subject, final RyaIRI predicate, final RyaType object,
+ final RyaIRI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
try {
//po(ng)
//po_r(s)(ng)
@@ -122,7 +122,7 @@ public class HashedPoWholeRowTriplePatternStrategy extends AbstractHashedTripleP
}
@Override
- public boolean handles(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public boolean handles(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
//po(ng)
//p_r(o)(ng)
//po_r(s)(ng)
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategy.java
index c87d268..42fd9d2 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/HashedSpoWholeRowTriplePatternStrategy.java
@@ -34,8 +34,8 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.domain.RyaURIRange;
+import org.apache.rya.api.domain.RyaIRI;
+import org.apache.rya.api.domain.RyaIRIRange;
import org.apache.rya.api.query.strategy.ByteRange;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
@@ -55,8 +55,8 @@ public class HashedSpoWholeRowTriplePatternStrategy extends AbstractHashedTriple
}
@Override
- public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(final RyaURI subject, final RyaURI predicate, final RyaType object,
- final RyaURI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
+ public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(final RyaIRI subject, final RyaIRI predicate, final RyaType object,
+ final RyaIRI context, final RdfCloudTripleStoreConfiguration conf) throws IOException {
try {
//spo(ng)
//sp(ng)
@@ -134,8 +134,8 @@ public class HashedSpoWholeRowTriplePatternStrategy extends AbstractHashedTriple
}
@Override
- public boolean handles(final RyaURI subject, final RyaURI predicate, final RyaType object, final RyaURI context) {
+ public boolean handles(final RyaIRI subject, final RyaIRI predicate, final RyaType object, final RyaIRI context) {
//if subject is not null and not a range (if predicate is null then object must be null)
- return (subject != null && !(subject instanceof RyaURIRange)) && !((predicate == null || predicate instanceof RyaURIRange) && (object != null));
+ return (subject != null && !(subject instanceof RyaIRIRange)) && !((predicate == null || predicate instanceof RyaIRIRange) && (object != null));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
index 5398fc0..afc3af2 100644
--- a/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
+++ b/common/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/NullRowTriplePatternStrategy.java
@@ -28,7 +28,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.query.strategy.AbstractTriplePatternStrategy;
import org.apache.rya.api.query.strategy.ByteRange;
@@ -40,15 +40,15 @@ public class NullRowTriplePatternStrategy extends AbstractTriplePatternStrategy
}
@Override
- public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(RyaURI subject, RyaURI predicate, RyaType object,
- RyaURI context, RdfCloudTripleStoreConfiguration conf) throws IOException {
+ public Map.Entry<TABLE_LAYOUT, ByteRange> defineRange(RyaIRI subject, RyaIRI predicate, RyaType object,
+ RyaIRI context, RdfCloudTripleStoreConfiguration conf) throws IOException {
byte[] start = new byte[]{ /* empty array */ }; // Scan from the beginning of the Accumulo Table
byte[] stop = LAST_BYTES; // Scan to the end, up through things beginning with 0xff.
return new RdfCloudTripleStoreUtils.CustomEntry<>(TABLE_LAYOUT.SPO, new ByteRange(start, stop));
}
@Override
- public boolean handles(RyaURI subject, RyaURI predicate, RyaType object, RyaURI context) {
+ public boolean handles(RyaIRI subject, RyaIRI predicate, RyaType object, RyaIRI context) {
return subject == null && predicate == null && object == null;
}
}
[46/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolverTest.java
----------------------------------------------------------------------
diff --git a/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolverTest.java b/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolverTest.java
index 9fd5260..a812068 100644
--- a/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolverTest.java
+++ b/common/rya.api/src/test/java/org/apache/rya/api/resolver/triple/impl/WholeRowTripleResolverTest.java
@@ -24,7 +24,7 @@ package org.apache.rya.api.resolver.triple.impl;
import junit.framework.TestCase;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowRegex;
@@ -42,10 +42,10 @@ public class WholeRowTripleResolverTest extends TestCase {
public void testSerialize() throws Exception {
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
@@ -64,10 +64,10 @@ public class WholeRowTripleResolverTest extends TestCase {
public void testSerializePO() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.PO;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
@@ -85,10 +85,10 @@ public class WholeRowTripleResolverTest extends TestCase {
public void testSerializeOSP() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
@@ -106,10 +106,10 @@ public class WholeRowTripleResolverTest extends TestCase {
public void testSerializeOSPCustomType() throws Exception {
RdfCloudTripleStoreConstants.TABLE_LAYOUT po = RdfCloudTripleStoreConstants.TABLE_LAYOUT.OSP;
//no context
- RyaURI subj = new RyaURI("urn:test#1234");
- RyaURI pred = new RyaURI("urn:test#pred");
- RyaURI obj = new RyaURI("urn:test#obj");
- RyaURI cntxt = new RyaURI("urn:test#cntxt");
+ RyaIRI subj = new RyaIRI("urn:test#1234");
+ RyaIRI pred = new RyaIRI("urn:test#pred");
+ RyaIRI obj = new RyaIRI("urn:test#obj");
+ RyaIRI cntxt = new RyaIRI("urn:test#cntxt");
final RyaStatement stmt = new RyaStatement(subj, pred, obj, null, null, null, null, 100l);
final RyaStatement stmtContext = new RyaStatement(subj, pred, obj, cntxt, null, null, null, 100l);
Map<RdfCloudTripleStoreConstants.TABLE_LAYOUT, TripleRow> serialize = tripleResolver.serialize(stmt);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
index f3e97a3..9b3752b 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/AccumuloRyaDAO.java
@@ -63,7 +63,7 @@ import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.layout.TableLayoutStrategy;
import org.apache.rya.api.persist.RyaDAO;
import org.apache.rya.api.persist.RyaDAOException;
@@ -215,7 +215,7 @@ public class AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaName
}
@Override
- public void dropGraph(final AccumuloRdfConfiguration conf, final RyaURI... graphs) throws RyaDAOException {
+ public void dropGraph(final AccumuloRdfConfiguration conf, final RyaIRI... graphs) throws RyaDAOException {
BatchDeleter bd_spo = null;
BatchDeleter bd_po = null;
BatchDeleter bd_osp = null;
@@ -229,7 +229,7 @@ public class AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaName
bd_po.setRanges(Collections.singleton(new Range()));
bd_osp.setRanges(Collections.singleton(new Range()));
- for (final RyaURI graph : graphs){
+ for (final RyaIRI graph : graphs){
bd_spo.fetchColumnFamily(new Text(graph.getData()));
bd_po.fetchColumnFamily(new Text(graph.getData()));
bd_osp.fetchColumnFamily(new Text(graph.getData()));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AbstractAccumuloIndexer.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AbstractAccumuloIndexer.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AbstractAccumuloIndexer.java
index 90cae5e..6d6a13b 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AbstractAccumuloIndexer.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/experimental/AbstractAccumuloIndexer.java
@@ -24,7 +24,7 @@ import java.io.IOException;
import java.util.Collection;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
@@ -46,7 +46,7 @@ public abstract class AbstractAccumuloIndexer implements AccumuloIndexer {
}
@Override
- public void dropGraph(RyaURI... graphs) {
+ public void dropGraph(RyaIRI... graphs) {
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
index 8887739..b39f44f 100644
--- a/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
+++ b/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
@@ -48,7 +48,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaRange;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.layout.TableLayoutStrategy;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.BatchRyaQuery;
@@ -129,9 +129,9 @@ public class AccumuloRyaQueryEngine implements RyaQueryEngine<AccumuloRdfConfigu
Collection<Range> ranges = new HashSet<Range>();
RangeBindingSetEntries rangeMap = new RangeBindingSetEntries();
TABLE_LAYOUT layout = null;
- RyaURI context = null;
+ RyaIRI context = null;
TriplePatternStrategy strategy = null;
- RyaURI columnFamily = null;
+ RyaIRI columnFamily = null;
boolean columnFamilySet = false;
for (Map.Entry<RyaStatement, BindingSet> stmtbs : stmts) {
RyaStatement stmt = stmtbs.getKey();
@@ -269,10 +269,10 @@ public class AccumuloRyaQueryEngine implements RyaQueryEngine<AccumuloRdfConfigu
TriplePatternStrategy strategy = ryaContext.retrieveStrategy(stmt);
TABLE_LAYOUT layout;
Range range;
- RyaURI subject = stmt.getSubject();
- RyaURI predicate = stmt.getPredicate();
+ RyaIRI subject = stmt.getSubject();
+ RyaIRI predicate = stmt.getPredicate();
RyaType object = stmt.getObject();
- RyaURI context = stmt.getContext();
+ RyaIRI context = stmt.getContext();
String qualifier = stmt.getQualifer();
TripleRowRegex tripleRowRegex = null;
if (strategy != null) {
@@ -347,7 +347,7 @@ public class AccumuloRyaQueryEngine implements RyaQueryEngine<AccumuloRdfConfigu
try {
Collection<Range> ranges = new HashSet<Range>();
TABLE_LAYOUT layout = null;
- RyaURI context = null;
+ RyaIRI context = null;
TriplePatternStrategy strategy = null;
for (RyaStatement stmt : stmts) {
context = stmt.getContext(); // TODO: This will be overwritten
@@ -382,7 +382,7 @@ public class AccumuloRyaQueryEngine implements RyaQueryEngine<AccumuloRdfConfigu
results = FluentCloseableIterable.from(new ScannerBaseCloseableIterable(scanner))
.transform(keyValueToRyaStatementFunctionMap.get(layout));
} else {
- final RyaURI fcontext = context;
+ final RyaIRI fcontext = context;
final RdfCloudTripleStoreConfiguration fconf = ryaQuery.getConf();
FluentIterable<RyaStatement> fluent = FluentIterable.from(ranges)
.transformAndConcat(new Function<Range, Iterable<Map.Entry<Key, Value>>>() {
@@ -410,7 +410,7 @@ public class AccumuloRyaQueryEngine implements RyaQueryEngine<AccumuloRdfConfigu
}
}
- protected void fillScanner(ScannerBase scanner, RyaURI context, String qualifier, Long ttl, Long currentTime,
+ protected void fillScanner(ScannerBase scanner, RyaIRI context, String qualifier, Long ttl, Long currentTime,
TripleRowRegex tripleRowRegex, RdfCloudTripleStoreConfiguration conf) throws IOException {
if (context != null && qualifier != null) {
scanner.fetchColumn(new Text(context.getData()), new Text(qualifier));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
----------------------------------------------------------------------
diff --git a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
index 75e5861..35d18ea 100644
--- a/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
+++ b/dao/accumulo.rya/src/test/java/org/apache/rya/accumulo/AccumuloRyaDAOTest.java
@@ -38,7 +38,7 @@ import org.apache.accumulo.core.iterators.FirstEntryInRowIterator;
import org.apache.rya.accumulo.query.AccumuloRyaQueryEngine;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQuery;
@@ -84,9 +84,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testAdd() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
+ RyaIRI cpu = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "cpu"));
+ RyaIRI loadPerc = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaIRI uri1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "uri1"));
dao.add(new RyaStatement(cpu, loadPerc, uri1));
CloseableIteration<RyaStatement, RyaDAOException> iter = dao.getQueryEngine().query(new RyaStatement(cpu, loadPerc, null), conf);
@@ -112,9 +112,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testDeleteDiffVisibility() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
+ RyaIRI cpu = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "cpu"));
+ RyaIRI loadPerc = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaIRI uri1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "uri1"));
RyaStatement stmt1 = new RyaStatement(cpu, loadPerc, uri1, null, "1", new StatementMetadata(), "vis1".getBytes());
dao.add(stmt1);
RyaStatement stmt2 = new RyaStatement(cpu, loadPerc, uri1, null, "2", new StatementMetadata(), "vis2".getBytes());
@@ -146,9 +146,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testDeleteDiffTimestamp() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
- RyaURI uri1 = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "uri1"));
+ RyaIRI cpu = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "cpu"));
+ RyaIRI loadPerc = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaIRI uri1 = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "uri1"));
RyaStatement stmt1 = new RyaStatement(cpu, loadPerc, uri1, null, "1", null, null, 100l);
dao.add(stmt1);
RyaStatement stmt2 = new RyaStatement(cpu, loadPerc, uri1, null, "2", null, null, 100l);
@@ -170,14 +170,14 @@ public class AccumuloRyaDAOTest {
@Test
public void testDelete() throws Exception {
- RyaURI predicate = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "pred"));
- RyaURI subj = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "subj"));
+ RyaIRI predicate = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "pred"));
+ RyaIRI subj = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "subj"));
// create a "bulk load" of 10,000 statements
int statement_count = 10000;
for (int i = 0 ; i < statement_count ; i++){
//make the statement very large so we will get a lot of random flushes
- RyaURI obj = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, String.format("object%050d",i)));
+ RyaIRI obj = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, String.format("object%050d",i)));
RyaStatement stmt = new RyaStatement(subj, predicate, obj);
dao.add(stmt);
}
@@ -208,8 +208,8 @@ public class AccumuloRyaDAOTest {
@Test
public void testAddEmptyString() throws Exception {
- RyaURI cpu = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "cpu"));
- RyaURI loadPerc = RdfToRyaConversions.convertURI(VF.createIRI(litdupsNS, "loadPerc"));
+ RyaIRI cpu = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "cpu"));
+ RyaIRI loadPerc = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "loadPerc"));
RyaType empty = new RyaType("");
dao.add(new RyaStatement(cpu, loadPerc, empty));
@@ -222,13 +222,13 @@ public class AccumuloRyaDAOTest {
@Test
public void testMaxResults() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri1")));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri2")));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri3")));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri4")));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri5")));
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri1")));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri2")));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri3")));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri4")));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri5")));
AccumuloRyaQueryEngine queryEngine = dao.getQueryEngine();
AccumuloRdfConfiguration queryConf = new AccumuloRdfConfiguration(conf);
@@ -247,9 +247,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testAddValue() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
String myval = "myval";
byte[] columnVis = null;
dao.add(new RyaStatement(cpu, loadPerc, uri1, null, null, columnVis, myval.getBytes()));
@@ -263,11 +263,11 @@ public class AccumuloRyaDAOTest {
@Test
public void testAddCv() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
- RyaURI uri2 = new RyaURI(litdupsNS + "uri2");
- RyaURI uri3 = new RyaURI(litdupsNS + "uri3");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
+ RyaIRI uri2 = new RyaIRI(litdupsNS + "uri2");
+ RyaIRI uri3 = new RyaIRI(litdupsNS + "uri3");
byte[] colVisABC = "A|B|C".getBytes();
byte[] colVisAB = "A|B".getBytes();
byte[] colVisA = "A".getBytes();
@@ -311,14 +311,14 @@ public class AccumuloRyaDAOTest {
@Test
public void testTTL() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
long current = System.currentTimeMillis();
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri1"), null, null, null, null, current));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri2"), null, null, null, null, current - 1010l));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri3"), null, null, null, null, current - 2010l));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri4"), null, null, null, null, current - 3010l));
- dao.add(new RyaStatement(cpu, loadPerc, new RyaURI(litdupsNS + "uri5"), null, null, null, null, current - 4010l));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri1"), null, null, null, null, current));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri2"), null, null, null, null, current - 1010l));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri3"), null, null, null, null, current - 2010l));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri4"), null, null, null, null, current - 3010l));
+ dao.add(new RyaStatement(cpu, loadPerc, new RyaIRI(litdupsNS + "uri5"), null, null, null, null, current - 4010l));
AccumuloRyaQueryEngine queryEngine = dao.getQueryEngine();
AccumuloRdfConfiguration queryConf = conf.clone();
@@ -355,14 +355,14 @@ public class AccumuloRyaDAOTest {
//TOOD: Add test for set of queries
@Test
public void testQuery() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
- RyaURI uri2 = new RyaURI(litdupsNS + "uri2");
- RyaURI uri3 = new RyaURI(litdupsNS + "uri3");
- RyaURI uri4 = new RyaURI(litdupsNS + "uri4");
- RyaURI uri5 = new RyaURI(litdupsNS + "uri5");
- RyaURI uri6 = new RyaURI(litdupsNS + "uri6");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
+ RyaIRI uri2 = new RyaIRI(litdupsNS + "uri2");
+ RyaIRI uri3 = new RyaIRI(litdupsNS + "uri3");
+ RyaIRI uri4 = new RyaIRI(litdupsNS + "uri4");
+ RyaIRI uri5 = new RyaIRI(litdupsNS + "uri5");
+ RyaIRI uri6 = new RyaIRI(litdupsNS + "uri6");
dao.add(new RyaStatement(cpu, loadPerc, uri1));
dao.add(new RyaStatement(cpu, loadPerc, uri2));
dao.add(new RyaStatement(cpu, loadPerc, uri3));
@@ -409,8 +409,8 @@ public class AccumuloRyaDAOTest {
@Test
public void testQueryDates() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
RyaType uri0 = new RyaType(XMLSchema.DATETIME, "1960-01-01"); // How handles local time
RyaType uri1 = new RyaType(XMLSchema.DATETIME, "1992-01-01T+10:00"); // See Magadan Time
RyaType uri2 = new RyaType(XMLSchema.DATETIME, "2000-01-01TZ"); // How it handles UTC.
@@ -475,14 +475,14 @@ public class AccumuloRyaDAOTest {
@Test
public void testQueryCollectionRegex() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
- RyaURI uri2 = new RyaURI(litdupsNS + "uri2");
- RyaURI uri3 = new RyaURI(litdupsNS + "uri3");
- RyaURI uri4 = new RyaURI(litdupsNS + "uri4");
- RyaURI uri5 = new RyaURI(litdupsNS + "uri5");
- RyaURI uri6 = new RyaURI(litdupsNS + "uri6");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
+ RyaIRI uri2 = new RyaIRI(litdupsNS + "uri2");
+ RyaIRI uri3 = new RyaIRI(litdupsNS + "uri3");
+ RyaIRI uri4 = new RyaIRI(litdupsNS + "uri4");
+ RyaIRI uri5 = new RyaIRI(litdupsNS + "uri5");
+ RyaIRI uri6 = new RyaIRI(litdupsNS + "uri6");
dao.add(new RyaStatement(cpu, loadPerc, uri1));
dao.add(new RyaStatement(cpu, loadPerc, uri2));
dao.add(new RyaStatement(cpu, loadPerc, uri3));
@@ -518,14 +518,14 @@ public class AccumuloRyaDAOTest {
@Test
public void testQueryCollectionRegexWBatchScanner() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
- RyaURI uri2 = new RyaURI(litdupsNS + "uri2");
- RyaURI uri3 = new RyaURI(litdupsNS + "uri3");
- RyaURI uri4 = new RyaURI(litdupsNS + "uri4");
- RyaURI uri5 = new RyaURI(litdupsNS + "uri5");
- RyaURI uri6 = new RyaURI(litdupsNS + "uri6");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
+ RyaIRI uri2 = new RyaIRI(litdupsNS + "uri2");
+ RyaIRI uri3 = new RyaIRI(litdupsNS + "uri3");
+ RyaIRI uri4 = new RyaIRI(litdupsNS + "uri4");
+ RyaIRI uri5 = new RyaIRI(litdupsNS + "uri5");
+ RyaIRI uri6 = new RyaIRI(litdupsNS + "uri6");
dao.add(new RyaStatement(cpu, loadPerc, uri1));
dao.add(new RyaStatement(cpu, loadPerc, uri2));
dao.add(new RyaStatement(cpu, loadPerc, uri3));
@@ -563,8 +563,8 @@ public class AccumuloRyaDAOTest {
@Test
public void testLiteralTypes() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
RyaType longLit = new RyaType(XMLSchema.LONG, "3");
dao.add(new RyaStatement(cpu, loadPerc, longLit));
@@ -590,8 +590,8 @@ public class AccumuloRyaDAOTest {
@Test
public void testSameLiteralStringTypes() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
RyaType longLit = new RyaType(XMLSchema.LONG, "10");
RyaType strLit = new RyaType(XMLSchema.STRING, new String(RyaContext.getInstance().serializeType(longLit)[0]));
@@ -641,9 +641,9 @@ public class AccumuloRyaDAOTest {
@Test
public void testQueryWithIterators() throws Exception {
- RyaURI cpu = new RyaURI(litdupsNS + "cpu");
- RyaURI loadPerc = new RyaURI(litdupsNS + "loadPerc");
- RyaURI uri1 = new RyaURI(litdupsNS + "uri1");
+ RyaIRI cpu = new RyaIRI(litdupsNS + "cpu");
+ RyaIRI loadPerc = new RyaIRI(litdupsNS + "loadPerc");
+ RyaIRI uri1 = new RyaIRI(litdupsNS + "uri1");
dao.add(new RyaStatement(cpu, loadPerc, uri1, null, "qual1"));
dao.add(new RyaStatement(cpu, loadPerc, uri1, null, "qual2"));
@@ -699,8 +699,8 @@ public class AccumuloRyaDAOTest {
}
private RyaStatement newRyaStatement() {
- RyaURI subject = new RyaURI(litdupsNS + randomString());
- RyaURI predicate = new RyaURI(litdupsNS + randomString());
+ RyaIRI subject = new RyaIRI(litdupsNS + randomString());
+ RyaIRI predicate = new RyaIRI(litdupsNS + randomString());
RyaType object = new RyaType(randomString());
return new RyaStatement(subject, predicate, object);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java
index d01c2d7..ab153b3 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java
@@ -31,7 +31,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAO;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.RyaNamespaceManager;
@@ -237,7 +237,7 @@ public final class MongoDBRyaDAO implements RyaDAO<StatefulMongoDBRdfConfigurati
}
@Override
- public void dropGraph(final StatefulMongoDBRdfConfiguration conf, final RyaURI... graphs)
+ public void dropGraph(final StatefulMongoDBRdfConfiguration conf, final RyaIRI... graphs)
throws RyaDAOException {
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
index 769d2de..35525ad 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/aggregation/AggregationPipelineQueryNode.java
@@ -44,7 +44,7 @@ import java.util.function.Function;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.mongodb.MongoDbRdfConstants;
@@ -256,21 +256,21 @@ public class AggregationPipelineQueryNode extends ExternalSet {
final Var predVar = sp.getPredicateVar();
final Var objVar = sp.getObjectVar();
final Var contextVar = sp.getContextVar();
- RyaURI s = null;
- RyaURI p = null;
+ RyaIRI s = null;
+ RyaIRI p = null;
RyaType o = null;
- RyaURI c = null;
+ RyaIRI c = null;
if (subjVar != null && subjVar.getValue() instanceof Resource) {
s = RdfToRyaConversions.convertResource((Resource) subjVar.getValue());
}
if (predVar != null && predVar.getValue() instanceof IRI) {
- p = RdfToRyaConversions.convertURI((IRI) predVar.getValue());
+ p = RdfToRyaConversions.convertIRI((IRI) predVar.getValue());
}
if (objVar != null && objVar.getValue() != null) {
o = RdfToRyaConversions.convertValue(objVar.getValue());
}
if (contextVar != null && contextVar.getValue() instanceof IRI) {
- c = RdfToRyaConversions.convertURI((IRI) contextVar.getValue());
+ c = RdfToRyaConversions.convertIRI((IRI) contextVar.getValue());
}
RyaStatement rs = new RyaStatement(s, p, o, c);
DBObject obj = strategy.getQuery(rs);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
index b2490bc..ec5c7a5 100644
--- a/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
+++ b/dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/dao/SimpleMongoDBStorageStrategy.java
@@ -30,7 +30,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.query.RyaQuery;
import org.apache.rya.mongodb.document.visibility.DocumentVisibility;
@@ -94,10 +94,10 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
@Override
public DBObject getQuery(final RyaStatement stmt) {
- final RyaURI subject = stmt.getSubject();
- final RyaURI predicate = stmt.getPredicate();
+ final RyaIRI subject = stmt.getSubject();
+ final RyaIRI predicate = stmt.getPredicate();
final RyaType object = stmt.getObject();
- final RyaURI context = stmt.getContext();
+ final RyaIRI context = stmt.getContext();
final BasicDBObject query = new BasicDBObject();
if (subject != null){
query.append(SUBJECT_HASH, hash(subject.getData()));
@@ -133,7 +133,7 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
final String statementMetadata = (String) result.get(STATEMENT_METADATA);
RyaType objectRya = null;
if (objectType.equalsIgnoreCase(ANYURI.stringValue())){
- objectRya = new RyaURI(object);
+ objectRya = new RyaIRI(object);
}
else {
objectRya = new RyaType(factory.createIRI(objectType), object);
@@ -141,10 +141,10 @@ public class SimpleMongoDBStorageStrategy implements MongoDBStorageStrategy<RyaS
final RyaStatement statement;
if (!context.isEmpty()){
- statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), objectRya,
- new RyaURI(context));
+ statement = new RyaStatement(new RyaIRI(subject), new RyaIRI(predicate), objectRya,
+ new RyaIRI(context));
} else {
- statement = new RyaStatement(new RyaURI(subject), new RyaURI(predicate), objectRya);
+ statement = new RyaStatement(new RyaIRI(subject), new RyaIRI(predicate), objectRya);
}
statement.setColumnVisibility(documentVisibility.flatten());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
index 4aef8cd..ead87d2 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBQueryEngineIT.java
@@ -27,7 +27,7 @@ import java.util.Map.Entry;
import org.apache.rya.api.RdfCloudTripleStoreUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
@@ -46,13 +46,13 @@ public class MongoDBQueryEngineIT extends MongoITBase {
private RyaStatement getStatement(final String s, final String p, final String o) {
final RyaStatementBuilder builder = new RyaStatementBuilder();
if (s != null) {
- builder.setSubject(new RyaURI(s));
+ builder.setSubject(new RyaIRI(s));
}
if (p != null) {
- builder.setPredicate(new RyaURI(p));
+ builder.setPredicate(new RyaIRI(p));
}
if (o != null) {
- builder.setObject(new RyaURI(o));
+ builder.setObject(new RyaIRI(o));
}
return builder.build();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaBatchWriterIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaBatchWriterIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaBatchWriterIT.java
index d024cc4..4ce1348 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaBatchWriterIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaBatchWriterIT.java
@@ -26,7 +26,7 @@ import java.util.List;
import org.apache.log4j.BasicConfigurator;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.mongodb.batch.MongoDbBatchWriter;
import org.apache.rya.mongodb.batch.MongoDbBatchWriterConfig;
import org.apache.rya.mongodb.batch.MongoDbBatchWriterUtils;
@@ -156,15 +156,15 @@ public class MongoDBRyaBatchWriterIT extends MongoITBase {
return document;
}
- private static RyaURI ryaURI(final int v) {
- return new RyaURI("u:" + v);
+ private static RyaIRI ryaIRI(final int v) {
+ return new RyaIRI("u:" + v);
}
private static RyaStatement statement(final int v) {
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(ryaURI(v));
- builder.setSubject(ryaURI(v));
- builder.setObject(ryaURI(v));
+ builder.setPredicate(ryaIRI(v));
+ builder.setSubject(ryaIRI(v));
+ builder.setObject(ryaIRI(v));
return builder.build();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAO2IT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAO2IT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAO2IT.java
index 67002d7..25bf844 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAO2IT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAO2IT.java
@@ -27,7 +27,7 @@ import java.io.IOException;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.document.visibility.DocumentVisibility;
import org.bson.Document;
@@ -50,7 +50,7 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
dao.delete(builder.build(), conf);
} finally {
dao.destroy();
@@ -66,9 +66,9 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
final MongoCollection<Document> coll = db.getCollection(conf.getTriplesCollectionName());
@@ -89,9 +89,9 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
final RyaStatement statement = builder.build();
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -115,10 +115,10 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
- builder.setContext(new RyaURI("http://context.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
+ builder.setContext(new RyaIRI("http://context.com"));
final RyaStatement statement = builder.build();
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -128,9 +128,9 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
assertEquals(coll.count(),1);
final RyaStatementBuilder builder2 = new RyaStatementBuilder();
- builder2.setPredicate(new RyaURI("http://temp.com"));
- builder2.setObject(new RyaURI("http://object.com"));
- builder2.setContext(new RyaURI("http://context3.com"));
+ builder2.setPredicate(new RyaIRI("http://temp.com"));
+ builder2.setObject(new RyaIRI("http://object.com"));
+ builder2.setContext(new RyaIRI("http://context3.com"));
final RyaStatement query = builder2.build();
dao.delete(query, conf);
@@ -148,9 +148,9 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("B").flatten());
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -181,9 +181,9 @@ public class MongoDBRyaDAO2IT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("B").flatten());
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java
index c5ff223..939eff3 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/MongoDBRyaDAOIT.java
@@ -29,7 +29,7 @@ import java.io.IOException;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.RyaQuery;
import org.apache.rya.mongodb.document.util.AuthorizationsUtil;
@@ -57,7 +57,7 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
builder.setColumnVisibility(new DocumentVisibility("A").flatten());
dao.delete(builder.build(), conf);
} finally {
@@ -73,9 +73,9 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("B").flatten());
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -101,9 +101,9 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("C").flatten());
final RyaStatement statement = builder.build();
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -127,10 +127,10 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
- builder.setContext(new RyaURI("http://context.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
+ builder.setContext(new RyaIRI("http://context.com"));
builder.setColumnVisibility(new DocumentVisibility("A&B&C").flatten());
final RyaStatement statement = builder.build();
@@ -141,9 +141,9 @@ public class MongoDBRyaDAOIT extends MongoITBase {
assertEquals(1, coll.count());
final RyaStatementBuilder builder2 = new RyaStatementBuilder();
- builder2.setPredicate(new RyaURI("http://temp.com"));
- builder2.setObject(new RyaURI("http://object.com"));
- builder2.setContext(new RyaURI("http://context3.com"));
+ builder2.setPredicate(new RyaIRI("http://temp.com"));
+ builder2.setObject(new RyaIRI("http://object.com"));
+ builder2.setContext(new RyaIRI("http://context3.com"));
final RyaStatement query = builder2.build();
dao.delete(query, conf);
@@ -161,9 +161,9 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("B").flatten());
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -194,9 +194,9 @@ public class MongoDBRyaDAOIT extends MongoITBase {
dao.init();
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
builder.setColumnVisibility(new DocumentVisibility("B").flatten());
final MongoDatabase db = conf.getMongoClient().getDatabase(conf.get(MongoDBRdfConfiguration.MONGO_DB_NAME));
@@ -621,10 +621,10 @@ public class MongoDBRyaDAOIT extends MongoITBase {
private static RyaStatement buildVisibilityTestRyaStatement(final String documentVisibility) {
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI("http://temp.com"));
- builder.setSubject(new RyaURI("http://subject.com"));
- builder.setObject(new RyaURI("http://object.com"));
- builder.setContext(new RyaURI("http://context.com"));
+ builder.setPredicate(new RyaIRI("http://temp.com"));
+ builder.setSubject(new RyaIRI("http://subject.com"));
+ builder.setObject(new RyaIRI("http://object.com"));
+ builder.setContext(new RyaIRI("http://context.com"));
builder.setColumnVisibility(documentVisibility != null ? documentVisibility.getBytes() : null);
final RyaStatement statement = builder.build();
return statement;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
index 9f61dfd..576610c 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/SimpleMongoDBStorageStrategyTest.java
@@ -26,7 +26,7 @@ import java.io.IOException;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaStatement.RyaStatementBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.mongodb.dao.SimpleMongoDBStorageStrategy;
import org.apache.rya.mongodb.document.util.DocumentVisibilityConversionException;
@@ -52,10 +52,10 @@ public class SimpleMongoDBStorageStrategyTest {
static {
final RyaStatementBuilder builder = new RyaStatementBuilder();
- builder.setPredicate(new RyaURI(PREDICATE));
- builder.setSubject(new RyaURI(SUBJECT));
- builder.setObject(new RyaURI(OBJECT));
- builder.setContext(new RyaURI(CONTEXT));
+ builder.setPredicate(new RyaIRI(PREDICATE));
+ builder.setSubject(new RyaIRI(SUBJECT));
+ builder.setObject(new RyaIRI(OBJECT));
+ builder.setContext(new RyaIRI(CONTEXT));
builder.setColumnVisibility(DOCUMENT_VISIBILITY.flatten());
builder.setTimestamp(null);
testStatement = builder.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
----------------------------------------------------------------------
diff --git a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
index 8dbf4b5..cd3c513 100644
--- a/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
+++ b/dao/mongodb.rya/src/test/java/org/apache/rya/mongodb/aggregation/PipelineQueryIT.java
@@ -85,7 +85,7 @@ public class PipelineQueryIT extends MongoITBase {
private void insert(Resource subject, IRI predicate, Value object, int derivationLevel) throws RyaDAOException {
final RyaStatementBuilder builder = new RyaStatementBuilder();
builder.setSubject(RdfToRyaConversions.convertResource(subject));
- builder.setPredicate(RdfToRyaConversions.convertURI(predicate));
+ builder.setPredicate(RdfToRyaConversions.convertIRI(predicate));
builder.setObject(RdfToRyaConversions.convertValue(object));
final RyaStatement rstmt = builder.build();
if (derivationLevel > 0) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/README.md
----------------------------------------------------------------------
diff --git a/extras/indexing/README.md b/extras/indexing/README.md
index a2f7497..6ee6dd2 100644
--- a/extras/indexing/README.md
+++ b/extras/indexing/README.md
@@ -46,10 +46,10 @@ flavor is "Chocolate", but has no ingredients or nutritional information, as
an Entity by doing the following:
```
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- .setExplicitType(new RyaURI("urn:icecream"))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ .setExplicitType(new RyaIRI("urn:icecream"))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
.build();
```
The two types of Entities that may be created are implicit and explicit.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
index e6deab7..4b703eb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/AccumuloIndexingConfiguration.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AbstractAccumuloRdfConfigurationBuilder;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRdfConfigurationBuilder;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.accumulo.entity.EntityCentricIndex;
import org.apache.rya.indexing.accumulo.freetext.AccumuloFreeTextIndexer;
import org.apache.rya.indexing.accumulo.temporal.AccumuloTemporalIndexer;
@@ -287,12 +287,12 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
return getStrings(ConfigUtils.TEMPORAL_PREDICATES_LIST);
}
- private static Set<RyaURI> getPropURIFromStrings(final String... props) {
- final Set<RyaURI> properties = new HashSet<>();
+ private static Set<RyaIRI> getPropURIFromStrings(final String... props) {
+ final Set<RyaIRI> properties = new HashSet<>();
if (props != null) {
for(final String prop : props) {
if (StringUtils.isNotBlank(prop)) {
- properties.add(new RyaURI(prop));
+ properties.add(new RyaIRI(prop));
}
}
}
@@ -320,7 +320,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
private boolean usePcj = false;
private boolean useOptimalPcj = false;
private String[] pcjs = new String[0];
- private Set<RyaURI> metadataProps = new HashSet<>();
+ private Set<RyaIRI> metadataProps = new HashSet<>();
private static final String USE_FREETEXT = "use.freetext";
private static final String USE_TEMPORAL = "use.temporal";
@@ -587,7 +587,7 @@ public class AccumuloIndexingConfiguration extends AccumuloRdfConfiguration {
* @param useMetadata
* @return AccumuloIndexingConfigBuilder for chaining method invocations
*/
- public AccumuloIndexingConfigBuilder setStatementMetadataProperties(final Set<RyaURI> metadataProps) {
+ public AccumuloIndexingConfigBuilder setStatementMetadataProperties(final Set<RyaIRI> metadataProps) {
this.metadataProps = metadataProps;
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
index 1b20514..8deda36 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIdIndexer.java
@@ -48,7 +48,7 @@ import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.documentIndex.DocIndexIteratorUtil;
import org.apache.rya.accumulo.documentIndex.DocumentIndexIntersectingIterator;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTypeResolverException;
@@ -341,9 +341,9 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
}
if (!commonVarSet && sq.isCommonVarURI()) {
- final RyaURI rURI = new RyaURI(row.toString());
+ final RyaIRI rIRI = new RyaIRI(row.toString());
currentSolutionBs.addBinding(sq.getCommonVarName(),
- RyaToRdfConversions.convertValue(rURI));
+ RyaToRdfConversions.convertValue(rIRI));
commonVarSet = true;
}
@@ -381,8 +381,8 @@ public class AccumuloDocIdIndexer implements DocIdIndexer {
currentSolutionBs.addBinding(sq.getCommonVarName(), v);
commonVarSet = true;
}
- final RyaURI rURI = new RyaURI(new String(cqContent, StandardCharsets.UTF_8));
- currentSolutionBs.addBinding(s, RyaToRdfConversions.convertValue(rURI));
+ final RyaIRI rIRI = new RyaIRI(new String(cqContent, StandardCharsets.UTF_8));
+ currentSolutionBs.addBinding(s, RyaToRdfConversions.convertValue(rIRI));
} else {
throw new IllegalArgumentException("Invalid row.");
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
index 300d8ba..cad6a6c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndex.java
@@ -53,7 +53,7 @@ import org.apache.rya.accumulo.experimental.AbstractAccumuloIndexer;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
import org.apache.rya.api.resolver.triple.TripleRow;
@@ -231,10 +231,10 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
}
private static List<TripleRow> serializeStatement(final RyaStatement stmt) throws RyaTypeResolverException {
- final RyaURI subject = stmt.getSubject();
- final RyaURI predicate = stmt.getPredicate();
+ final RyaIRI subject = stmt.getSubject();
+ final RyaIRI predicate = stmt.getPredicate();
final RyaType object = stmt.getObject();
- final RyaURI context = stmt.getContext();
+ final RyaIRI context = stmt.getContext();
final Long timestamp = stmt.getTimestamp();
final byte[] columnVisibility = stmt.getColumnVisibility();
final byte[] value = stmt.getValue();
@@ -292,19 +292,19 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
final byte[] otherNodeData = Arrays.copyOf(otherNodeBytes, split);
final byte[] typeBytes = Arrays.copyOfRange(otherNodeBytes, split, otherNodeBytes.length);
byte[] objectBytes;
- RyaURI subject;
- final RyaURI predicate = new RyaURI(new String(predicateBytes, StandardCharsets.UTF_8));
+ RyaIRI subject;
+ final RyaIRI predicate = new RyaIRI(new String(predicateBytes, StandardCharsets.UTF_8));
RyaType object;
- RyaURI context = null;
+ RyaIRI context = null;
// Expect either: entity=subject.data, otherNodeVar="object", otherNodeBytes={object.data, object.datatype}
// or: entity=object.data, otherNodeVar="subject", otherNodeBytes={subject.data, object.datatype}
switch (otherNodeVar) {
case SUBJECT:
- subject = new RyaURI(new String(otherNodeData, StandardCharsets.UTF_8));
+ subject = new RyaIRI(new String(otherNodeData, StandardCharsets.UTF_8));
objectBytes = Bytes.concat(entityBytes, typeBytes);
break;
case OBJECT:
- subject = new RyaURI(new String(entityBytes, StandardCharsets.UTF_8));
+ subject = new RyaIRI(new String(entityBytes, StandardCharsets.UTF_8));
objectBytes = Bytes.concat(otherNodeData, typeBytes);
break;
default:
@@ -313,7 +313,7 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
}
object = RyaContext.getInstance().deserialize(objectBytes);
if (columnFamily != null && columnFamily.length > 0) {
- context = new RyaURI(new String(columnFamily, StandardCharsets.UTF_8));
+ context = new RyaIRI(new String(columnFamily, StandardCharsets.UTF_8));
}
return new RyaStatement(subject, predicate, object, context,
null, columnVisibility, valueBytes, timestamp);
@@ -343,7 +343,7 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
split = Bytes.indexOf(otherNodeBytes, TYPE_DELIM_BYTES);
final byte[] typeBytes = Arrays.copyOfRange(otherNodeBytes, split, otherNodeBytes.length);
byte[] objectBytes;
- RyaURI subject;
+ RyaIRI subject;
RyaType object;
RyaType type = null;
switch (otherNodeVar) {
@@ -353,7 +353,7 @@ public class EntityCentricIndex extends AbstractAccumuloIndexer {
type = object;
break;
case OBJECT:
- subject = new RyaURI(new String(entityBytes, StandardCharsets.UTF_8));
+ subject = new RyaIRI(new String(entityBytes, StandardCharsets.UTF_8));
type = subject;
break;
default:
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
index fc1b15e..c4b9aeb 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/entity/StarQuery.java
@@ -28,7 +28,7 @@ import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.hadoop.io.Text;
import org.apache.rya.accumulo.documentIndex.TextColumn;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaContext;
@@ -336,7 +336,7 @@ public class StarQuery {
final String[] cqArray = cq.split("\u0000");
if (cqArray[0].equals("subject")) {
- // RyaURI subjURI = (RyaURI) RdfToRyaConversions.convertValue(v);
+ // RyaIRI subjIRI = (RyaIRI) RdfToRyaConversions.convertValue(v);
tc.setColumnQualifier(new Text("subject" + "\u0000" + v.stringValue()));
tc.setIsPrefix(false);
} else if (cqArray[0].equals("object")) {
@@ -366,7 +366,7 @@ public class StarQuery {
final Var predVar = node.getPredicateVar();
final Var objVar = node.getObjectVar();
- final RyaURI predURI = (RyaURI) RdfToRyaConversions.convertValue(node.getPredicateVar().getValue());
+ final RyaIRI predURI = (RyaIRI) RdfToRyaConversions.convertValue(node.getPredicateVar().getValue());
//assumes StatementPattern contains at least on variable
@@ -436,7 +436,7 @@ public class StarQuery {
}
if(hasContext()) {
- final RyaURI ctxtURI = (RyaURI) RdfToRyaConversions.convertValue(context.getValue());
+ final RyaIRI ctxtURI = (RyaIRI) RdfToRyaConversions.convertValue(context.getValue());
contextURI = ctxtURI.getData();
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
index e98cccb..b46c9b0 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/accumulo/freetext/FreeTextTupleSet.java
@@ -125,7 +125,7 @@ public class FreeTextTupleSet extends ExternalTupleSet {
throws QueryEvaluationException {
- IRI funcURI = filterInfo.getFunction();
+ IRI funcIRI = filterInfo.getFunction();
SearchFunction searchFunction = new SearchFunction() {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
index e52b92b..d6f1771 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/EntityIndexSetProvider.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Type;
import org.apache.rya.indexing.entity.query.EntityQueryNode;
@@ -72,9 +72,9 @@ public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNo
return pattern.getSubjectVar();
}
- private RyaURI getPredURI(final StatementPattern pattern) {
+ private RyaIRI getPredIRI(final StatementPattern pattern) {
final Var pred = pattern.getPredicateVar();
- return new RyaURI(pred.getValue().stringValue());
+ return new RyaIRI(pred.getValue().stringValue());
}
@Override
@@ -102,11 +102,11 @@ public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNo
private void discoverEntities(final StatementPattern pattern, final List<StatementPattern> unmatched) {
final Var subj = pattern.getSubjectVar();
final String subjStr = subj.getName();
- final RyaURI predURI = getPredURI(pattern);
+ final RyaIRI predIRI = getPredIRI(pattern);
//check to see if current node is type
- if(VF.createIRI(predURI.getData()).equals(RDF.TYPE)) {
+ if(VF.createIRI(predIRI.getData()).equals(RDF.TYPE)) {
final Var obj = pattern.getObjectVar();
- final RyaURI objURI = new RyaURI(obj.getValue().stringValue());
+ final RyaIRI objURI = new RyaIRI(obj.getValue().stringValue());
try {
final Optional<Type> optType = typeStorage.get(objURI);
//if is type, fetch type add to subject -> type map
@@ -117,7 +117,7 @@ public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNo
//check unmatched properties, add matches
for(final StatementPattern propertyPattern : unmatched) {
//store sps into the type -> property map
- final RyaURI property = getPredURI(propertyPattern);
+ final RyaIRI property = getPredIRI(propertyPattern);
final Var typeSubVar = getTypeSubject(type);
final Var patternSubVar = propertyPattern.getSubjectVar();
if (type.getPropertyNames().contains(property) && typeSubVar.equals(patternSubVar)) {
@@ -133,7 +133,7 @@ public class EntityIndexSetProvider implements ExternalSetProvider<EntityQueryNo
if(subjectTypeMap.containsKey(subjStr)) {
//if is, check to see if pred is a property of type
final Type type = subjectTypeMap.get(subjStr);
- if(type.getPropertyNames().contains(predURI)) {
+ if(type.getPropertyNames().contains(predIRI)) {
//if is, add sp to type -> sp map
if(!typeMap.containsKey(type)) {
//each variable can only contain 1 type for now @see:Rya-235?
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
index fb64ccf..6874a16 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Entity.java
@@ -30,7 +30,7 @@ import java.util.Optional;
import org.apache.http.annotation.Immutable;
import org.apache.log4j.Logger;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.storage.EntityStorage;
import org.apache.rya.indexing.smarturi.SmartUriAdapter;
import org.apache.rya.indexing.smarturi.SmartUriException;
@@ -63,10 +63,10 @@ import edu.umd.cs.findbugs.annotations.Nullable;
* an Entity by doing the following:
* <pre>
* final Entity entity = Entity.builder()
- * .setSubject(new RyaURI("urn:GTIN-14/00012345600012"))
- * .setExplicitType(new RyaURI("urn:icecream"))
- * .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
- * .setProperty(new RyaURI("urn:icecream"), new Property(new RyaURI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
+ * .setSubject(new RyaIRI("urn:GTIN-14/00012345600012"))
+ * .setExplicitType(new RyaIRI("urn:icecream"))
+ * .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:brand"), new RyaType(XMLSchema.STRING, "Awesome Icecream")))
+ * .setProperty(new RyaIRI("urn:icecream"), new Property(new RyaIRI("urn:flavor"), new RyaType(XMLSchema.STRING, "Chocolate")))
* .build();
* </pre>
* The two types of Entities that may be created are implicit and explicit.
@@ -79,13 +79,13 @@ import edu.umd.cs.findbugs.annotations.Nullable;
public class Entity {
private static final Logger log = Logger.getLogger(Entity.class);
- private final RyaURI subject;
- private final ImmutableList<RyaURI> explicitTypeIds;
+ private final RyaIRI subject;
+ private final ImmutableList<RyaIRI> explicitTypeIds;
// First key is Type ID.
// Second key is Property Name.
// Value is the Property value for a specific type.
- private final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> properties;
+ private final ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> properties;
private final int version;
@@ -105,9 +105,9 @@ public class Entity {
* {@link Entity}.
*/
private Entity(
- final RyaURI subject,
- final ImmutableList<RyaURI> explicitTypeIds,
- final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties,
+ final RyaIRI subject,
+ final ImmutableList<RyaIRI> explicitTypeIds,
+ final ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperties,
final int version,
final IRI smartUri) {
this.subject = requireNonNull(subject);
@@ -138,9 +138,9 @@ public class Entity {
* {@link EntityStorage} to prevent stale updates.
*/
private Entity(
- final RyaURI subject,
- final ImmutableList<RyaURI> explicitTypeIds,
- final ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> typeProperties,
+ final RyaIRI subject,
+ final ImmutableList<RyaIRI> explicitTypeIds,
+ final ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> typeProperties,
final int version) {
this(subject, explicitTypeIds, typeProperties, version, null);
}
@@ -148,21 +148,21 @@ public class Entity {
/**
* @return Identifies the thing that is being represented as an Entity.
*/
- public RyaURI getSubject() {
+ public RyaIRI getSubject() {
return subject;
}
/**
* @return {@link Type}s that have been explicitly applied to the {@link Entity}.
*/
- public ImmutableList<RyaURI> getExplicitTypeIds() {
+ public ImmutableList<RyaIRI> getExplicitTypeIds() {
return explicitTypeIds;
}
/**
* @return All {@link Property}s that have been set for the Entity, grouped by Type ID.
*/
- public ImmutableMap<RyaURI, ImmutableMap<RyaURI, Property>> getProperties() {
+ public ImmutableMap<RyaIRI, ImmutableMap<RyaIRI, Property>> getProperties() {
return properties;
}
@@ -184,31 +184,31 @@ public class Entity {
/**
* Does a lookup to see if the {@link Entity} contains the specified
* property for the specified type.
- * @param typeRyaUri the type {@link RyaURI}. (not {@code null})
- * @param propertyRyaUri the property {@link RyaURI}. (not {@code null})
+ * @param type the {@link Type}. (not {@code null})
+ * @param propertyRyaIri the property {@link RyaIRI}. (not {@code null})
* @return the {@link Property} or an empty {@link Optional} if it could not
* be found in the {@link Entity}.
*/
- public Optional<Property> lookupTypeProperty(final Type type, final RyaURI propertyRyaUri) {
+ public Optional<Property> lookupTypeProperty(final Type type, final RyaIRI propertyRyaIri) {
requireNonNull(type);
- return lookupTypeProperty(type.getId(), propertyRyaUri);
+ return lookupTypeProperty(type.getId(), propertyRyaIri);
}
/**
* Does a lookup to see if the {@link Entity} contains the specified
* property for the specified type.
- * @param typeRyaUri the type {@link RyaURI}. (not {@code null})
- * @param propertyRyaUri the property {@link RyaURI}. (not {@code null})
+ * @param typeRyaIri the type {@link RyaIRI}. (not {@code null})
+ * @param propertyRyaIri the property {@link RyaIRI}. (not {@code null})
* @return the {@link Property} or an empty {@link Optional} if it could not
* be found in the {@link Entity}.
*/
- public Optional<Property> lookupTypeProperty(final RyaURI typeRyaUri, final RyaURI propertyRyaUri) {
- requireNonNull(typeRyaUri);
- requireNonNull(propertyRyaUri);
- final ImmutableMap<RyaURI, Property> typePropertyMap = properties.get(typeRyaUri);
+ public Optional<Property> lookupTypeProperty(final RyaIRI typeRyaIri, final RyaIRI propertyRyaIri) {
+ requireNonNull(typeRyaIri);
+ requireNonNull(propertyRyaIri);
+ final ImmutableMap<RyaIRI, Property> typePropertyMap = properties.get(typeRyaIri);
Optional<Property> property = Optional.empty();
if (typePropertyMap != null) {
- property = Optional.ofNullable(typePropertyMap.get(propertyRyaUri));
+ property = Optional.ofNullable(typePropertyMap.get(propertyRyaIri));
}
return property;
}
@@ -240,7 +240,7 @@ public class Entity {
* @return A TypedEntity using this object's values if any properties for the Type
* are present or if the Type was explicitly set. Otherwise an empty {@link Optional}.
*/
- public Optional<TypedEntity> makeTypedEntity(final RyaURI typeId) {
+ public Optional<TypedEntity> makeTypedEntity(final RyaIRI typeId) {
requireNonNull(typeId);
final boolean explicitlyHasType = explicitTypeIds.contains(typeId);
@@ -289,9 +289,9 @@ public class Entity {
@DefaultAnnotation(NonNull.class)
public static class Builder {
- private RyaURI subject = null;
- private final List<RyaURI> explicitTypes = new ArrayList<>();
- private final Map<RyaURI, Map<RyaURI, Property>> properties = new HashMap<>();
+ private RyaIRI subject = null;
+ private final List<RyaIRI> explicitTypes = new ArrayList<>();
+ private final Map<RyaIRI, Map<RyaIRI, Property>> properties = new HashMap<>();
private IRI smartUri = null;
private int version = 0;
@@ -312,7 +312,7 @@ public class Entity {
subject = entity.getSubject();
explicitTypes.addAll( entity.getExplicitTypeIds() );
- for(final Entry<RyaURI, ImmutableMap<RyaURI, Property>> entry : entity.getProperties().entrySet()) {
+ for(final Entry<RyaIRI, ImmutableMap<RyaIRI, Property>> entry : entity.getProperties().entrySet()) {
properties.put(entry.getKey(), Maps.newHashMap(entry.getValue()));
}
@@ -325,7 +325,7 @@ public class Entity {
* @param subject - Identifies the {@link TypedEntity}.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setSubject(@Nullable final RyaURI subject) {
+ public Builder setSubject(@Nullable final RyaIRI subject) {
this.subject = subject;
return this;
}
@@ -334,7 +334,7 @@ public class Entity {
* @param typeId - A {@link Type} that has been explicity set for the {@link TypedEntity}.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setExplicitType(@Nullable final RyaURI typeId) {
+ public Builder setExplicitType(@Nullable final RyaIRI typeId) {
if(typeId != null) {
explicitTypes.add(typeId);
}
@@ -347,7 +347,7 @@ public class Entity {
* @param typeId - The Type ID to remove from the set of explicit types.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder unsetExplicitType(@Nullable final RyaURI typeId) {
+ public Builder unsetExplicitType(@Nullable final RyaIRI typeId) {
if(typeId != null) {
explicitTypes.remove(typeId);
}
@@ -361,7 +361,7 @@ public class Entity {
* @param property - The Property values to add.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder setProperty(@Nullable final RyaURI typeId, @Nullable final Property property) {
+ public Builder setProperty(@Nullable final RyaIRI typeId, @Nullable final Property property) {
if(typeId != null && property != null) {
if(!properties.containsKey(typeId)) {
properties.put(typeId, new HashMap<>());
@@ -379,10 +379,10 @@ public class Entity {
* @param propertyName - The name of the Property to remove.
* @return This {@link Builder} so that method invocations may be chained.
*/
- public Builder unsetProperty(@Nullable final RyaURI typeId, @Nullable final RyaURI propertyName) {
+ public Builder unsetProperty(@Nullable final RyaIRI typeId, @Nullable final RyaIRI propertyName) {
if(typeId != null && propertyName != null) {
if(properties.containsKey(typeId)) {
- final Map<RyaURI, Property> typedProperties = properties.get(typeId);
+ final Map<RyaIRI, Property> typedProperties = properties.get(typeId);
if(typedProperties.containsKey(propertyName)) {
typedProperties.remove(propertyName);
}
@@ -426,8 +426,8 @@ public class Entity {
* @return Builds an instance of {@link Entity} using this builder's values.
*/
public Entity build() {
- final ImmutableMap.Builder<RyaURI, ImmutableMap<RyaURI, Property>> propertiesBuilder = ImmutableMap.builder();
- for(final Entry<RyaURI, Map<RyaURI, Property>> entry : properties.entrySet()) {
+ final ImmutableMap.Builder<RyaIRI, ImmutableMap<RyaIRI, Property>> propertiesBuilder = ImmutableMap.builder();
+ for(final Entry<RyaIRI, Map<RyaIRI, Property>> entry : properties.entrySet()) {
propertiesBuilder.put(entry.getKey(), ImmutableMap.copyOf( entry.getValue() ));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Property.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Property.java b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Property.java
index 53b141e..b44c52c 100644
--- a/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Property.java
+++ b/extras/indexing/src/main/java/org/apache/rya/indexing/entity/model/Property.java
@@ -24,7 +24,7 @@ import java.util.Objects;
import org.apache.http.annotation.Immutable;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
@@ -36,7 +36,7 @@ import edu.umd.cs.findbugs.annotations.NonNull;
@DefaultAnnotation(NonNull.class)
public class Property {
- private final RyaURI name;
+ private final RyaIRI name;
private final RyaType value;
/**
@@ -45,7 +45,7 @@ public class Property {
* @param name - Uniquely identifies the {@link Property}. (not null)
* @param value - The value of the {@link Property}. (not null)
*/
- public Property(final RyaURI name, final RyaType value) {
+ public Property(final RyaIRI name, final RyaType value) {
this.name = requireNonNull(name);
this.value = requireNonNull(value);
}
@@ -53,7 +53,7 @@ public class Property {
/**
* @return Uniquely identifies the {@link Property}.
*/
- public RyaURI getName() {
+ public RyaIRI getName() {
return name;
}
[26/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloAddUserIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloAddUserIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloAddUserIT.java
index 10d24d1..ed359f4 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloAddUserIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloAddUserIT.java
@@ -32,12 +32,12 @@ import org.apache.rya.api.client.RyaClient;
import org.apache.rya.api.instance.RyaDetails;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
import com.google.common.collect.ImmutableList;
@@ -147,7 +147,7 @@ public class AccumuloAddUserIT extends AccumuloITBase {
sailConn = sail.getConnection();
final ValueFactory vf = sail.getValueFactory();
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"));
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"));
} catch(final RuntimeException e) {
final Throwable cause = e.getCause();
@@ -198,7 +198,7 @@ public class AccumuloAddUserIT extends AccumuloITBase {
final ValueFactory vf = sail.getValueFactory();
sailConn.begin();
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"));
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"));
sailConn.close();
} finally {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJIT.java
index 78b4f52..2a6fbd5 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloBatchUpdatePCJIT.java
@@ -34,12 +34,12 @@ import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig.Precomputed
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
/**
* Integration tests the methods of {@link AccumuloBatchUpdatePCJ}.
@@ -82,23 +82,23 @@ public class AccumuloBatchUpdatePCJIT extends AccumuloITBase {
final SailConnection sailConn = sail.getConnection();
sailConn.begin();
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Bob"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:David"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Eve"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Frank"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:George"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
- sailConn.addStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:likes"), vf.createURI("urn:icecream"));
-
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:David"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Eve"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:Frank"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue"));
- sailConn.addStatement(vf.createURI("urn:George"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:green"));
- sailConn.addStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:brown"));
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:David"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:George"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+ sailConn.addStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream"));
+
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:David"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue"));
+ sailConn.addStatement(vf.createIRI("urn:George"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:green"));
+ sailConn.addStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:brown"));
sailConn.commit();
sailConn.close();
@@ -113,27 +113,27 @@ public class AccumuloBatchUpdatePCJIT extends AccumuloITBase {
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Alice"));
+ bs.addBinding("name", vf.createIRI("urn:Alice"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Bob"));
+ bs.addBinding("name", vf.createIRI("urn:Bob"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Charlie"));
+ bs.addBinding("name", vf.createIRI("urn:Charlie"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:David"));
+ bs.addBinding("name", vf.createIRI("urn:David"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Eve"));
+ bs.addBinding("name", vf.createIRI("urn:Eve"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Frank"));
+ bs.addBinding("name", vf.createIRI("urn:Frank"));
expectedResults.add(bs);
final Set<BindingSet> results = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJIT.java
index 3463a02..3f5f5be 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloCreatePCJIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -34,14 +34,13 @@ import org.apache.rya.api.instance.RyaDetails;
import org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.PCJDetails;
import org.apache.rya.api.instance.RyaDetails.PCJIndexDetails.PCJDetails.PCJUpdateStrategy;
import org.apache.rya.indexing.pcj.fluo.api.ListQueryIds;
-import org.apache.rya.indexing.pcj.fluo.app.IncUpdateDAO;
import org.apache.rya.indexing.pcj.storage.PcjMetadata;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
import com.google.common.base.Optional;
import com.google.common.collect.Sets;
@@ -88,16 +87,16 @@ public class AccumuloCreatePCJIT extends FluoITBase {
// Insert some statements into Rya.
final ValueFactory vf = ryaRepo.getValueFactory();
- ryaConn.add(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
// Verify the correct results were exported.
fluo.waitForObservers();
@@ -105,12 +104,12 @@ public class AccumuloCreatePCJIT extends FluoITBase {
final Set<BindingSet> results = Sets.newHashSet( pcjStorage.listResults(pcjId) );
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("x", vf.createURI("http://Bob"));
+ bob.addBinding("x", vf.createIRI("http://Bob"));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("x", vf.createURI("http://Charlie"));
+ charlie.addBinding("x", vf.createIRI("http://Charlie"));
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(bob, charlie);
+ final Set<BindingSet> expected = Sets.newHashSet(bob, charlie);
assertEquals(expected, results);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloDeletePCJIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloDeletePCJIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloDeletePCJIT.java
index 59ee546..ae64abb 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloDeletePCJIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloDeletePCJIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -37,11 +37,11 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage.PCJStorageException;
import org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjStorage;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
+import org.eclipse.rdf4j.repository.RepositoryException;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
-import org.openrdf.repository.RepositoryException;
import com.google.common.collect.Sets;
@@ -70,16 +70,16 @@ public class AccumuloDeletePCJIT extends FluoITBase {
// Insert some statements into Rya.
final ValueFactory vf = ryaRepo.getValueFactory();
- ryaConn.add(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
// Verify the correct results were exported.
fluo.waitForObservers();
@@ -89,12 +89,12 @@ public class AccumuloDeletePCJIT extends FluoITBase {
final Set<BindingSet> results = Sets.newHashSet( pcjStorage.listResults(pcjId) );
final MapBindingSet bob = new MapBindingSet();
- bob.addBinding("x", vf.createURI("http://Bob"));
+ bob.addBinding("x", vf.createIRI("http://Bob"));
final MapBindingSet charlie = new MapBindingSet();
- charlie.addBinding("x", vf.createURI("http://Charlie"));
+ charlie.addBinding("x", vf.createIRI("http://Charlie"));
- final Set<BindingSet> expected = Sets.<BindingSet>newHashSet(bob, charlie);
+ final Set<BindingSet> expected = Sets.newHashSet(bob, charlie);
assertEquals(expected, results);
@@ -155,16 +155,16 @@ public class AccumuloDeletePCJIT extends FluoITBase {
// Insert some statements into Rya.
final ValueFactory vf = ryaRepo.getValueFactory();
- ryaConn.add(vf.createURI("http://Alice"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://talksTo"), vf.createURI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Alice"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://talksTo"), vf.createIRI("http://Eve"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://helps"), vf.createURI("http://Kevin"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://helps"), vf.createIRI("http://Kevin"));
- ryaConn.add(vf.createURI("http://Bob"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Charlie"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://Eve"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
- ryaConn.add(vf.createURI("http://David"), vf.createURI("http://worksAt"), vf.createURI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Bob"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Charlie"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://Eve"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
+ ryaConn.add(vf.createIRI("http://David"), vf.createIRI("http://worksAt"), vf.createIRI("http://TacoJoint"));
// Verify the correct results were exported.
fluo.waitForObservers();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFileIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFileIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFileIT.java
index f5d1923..9b2926e 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFileIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloLoadStatementsFileIT.java
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -40,11 +40,11 @@ import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.impl.WholeRowTripleResolver;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.rio.RDFFormat;
/**
* Integration tests the methods of {@link AccumuloLoadStatementsFile}.
@@ -90,12 +90,12 @@ public class AccumuloLoadStatementsFileIT extends AccumuloITBase {
ryaClient.getLoadStatementsFile().loadStatements(getRyaInstanceName(), Paths.get("src/test/resources/example.ttl"), RDFFormat.TURTLE);
// Verify that the statements were loaded.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final List<Statement> expected = new ArrayList<>();
- expected.add( vf.createStatement(vf.createURI("http://example#alice"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#bob")) );
- expected.add( vf.createStatement(vf.createURI("http://example#bob"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#charlie")) );
- expected.add( vf.createStatement(vf.createURI("http://example#charlie"), vf.createURI("http://example#likes"), vf.createURI("http://example#icecream")) );
+ expected.add( vf.createStatement(vf.createIRI("http://example#alice"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#bob")) );
+ expected.add( vf.createStatement(vf.createIRI("http://example#bob"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#charlie")) );
+ expected.add( vf.createStatement(vf.createIRI("http://example#charlie"), vf.createIRI("http://example#likes"), vf.createIRI("http://example#icecream")) );
final List<Statement> statements = new ArrayList<>();
@@ -124,7 +124,7 @@ public class AccumuloLoadStatementsFileIT extends AccumuloITBase {
}
private boolean isRyaMetadataStatement(final ValueFactory vf, final Statement statement) {
- return statement.getPredicate().equals( vf.createURI("urn:org.apache.rya/2012/05#version") ) ||
- statement.getPredicate().equals( vf.createURI("urn:org.apache.rya/2012/05#rts") );
+ return statement.getPredicate().equals( vf.createIRI("urn:org.apache.rya/2012/05#version") ) ||
+ statement.getPredicate().equals( vf.createIRI("urn:org.apache.rya/2012/05#rts") );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloRemoveUserIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloRemoveUserIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloRemoveUserIT.java
index 224f70d..35e1210 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloRemoveUserIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/AccumuloRemoveUserIT.java
@@ -32,10 +32,10 @@ import org.apache.rya.api.client.RyaClient;
import org.apache.rya.api.instance.RyaDetails;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.sail.config.RyaSailFactory;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailConnection;
import org.junit.Test;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailConnection;
import com.google.common.collect.ImmutableList;
@@ -131,7 +131,7 @@ public class AccumuloRemoveUserIT extends AccumuloITBase {
sailConn = sail.getConnection();
final ValueFactory vf = sail.getValueFactory();
- sailConn.addStatement(vf.createURI("urn:Alice"), vf.createURI("urn:talksTo"), vf.createURI("urn:Bob"));
+ sailConn.addStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:talksTo"), vf.createIRI("urn:Bob"));
} catch(final RuntimeException e) {
final Throwable cause = e.getCause();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/FluoITBase.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/FluoITBase.java b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/FluoITBase.java
index 7277fe0..1ef38aa 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/FluoITBase.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/accumulo/FluoITBase.java
@@ -67,14 +67,14 @@ import org.apache.rya.rdftriplestore.RyaSailRepository;
import org.apache.rya.rdftriplestore.inference.InferenceEngineException;
import org.apache.rya.sail.config.RyaSailFactory;
import org.apache.zookeeper.ClientCnxn;
+import org.eclipse.rdf4j.repository.RepositoryConnection;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.eclipse.rdf4j.sail.Sail;
+import org.eclipse.rdf4j.sail.SailException;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.Sail;
-import org.openrdf.sail.SailException;
/**
* Integration tests that ensure the Fluo application processes PCJs results
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJIT.java
index 7933374..1d796fe 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoBatchUpdatePCJIT.java
@@ -36,12 +36,12 @@ import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
import org.apache.rya.indexing.pcj.storage.mongo.MongoPcjStorage;
import org.apache.rya.mongodb.MongoDBRdfConfiguration;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the methods of {@link AccumuloBatchUpdatePCJ}.
@@ -68,25 +68,25 @@ public class MongoBatchUpdatePCJIT extends MongoITBase {
.build());
// Load some statements into the Rya instance.
- final ValueFactory vf = ValueFactoryImpl.getInstance();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Collection<Statement> statements = new ArrayList<>();
- statements.add(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:Frank"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:George"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
- statements.add(vf.createStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:likes"), vf.createURI("urn:icecream")));
-
- statements.add(vf.createStatement(vf.createURI("urn:Alice"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:Bob"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:Charlie"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:David"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:Eve"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:Frank"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:blue")));
- statements.add(vf.createStatement(vf.createURI("urn:George"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:green")));
- statements.add(vf.createStatement(vf.createURI("urn:Hillary"), vf.createURI("urn:hasEyeColor"), vf.createURI("urn:brown")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:George"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:likes"), vf.createIRI("urn:icecream")));
+
+ statements.add(vf.createStatement(vf.createIRI("urn:Alice"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Bob"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Charlie"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:David"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Eve"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Frank"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:blue")));
+ statements.add(vf.createStatement(vf.createIRI("urn:George"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:green")));
+ statements.add(vf.createStatement(vf.createIRI("urn:Hillary"), vf.createIRI("urn:hasEyeColor"), vf.createIRI("urn:brown")));
ryaClient.getLoadStatements().loadStatements(conf.getRyaInstanceName(), statements);
try(final PrecomputedJoinStorage pcjStorage = new MongoPcjStorage(getMongoClient(), conf.getRyaInstanceName())) {
@@ -101,27 +101,27 @@ public class MongoBatchUpdatePCJIT extends MongoITBase {
final Set<BindingSet> expectedResults = new HashSet<>();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Alice"));
+ bs.addBinding("name", vf.createIRI("urn:Alice"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Bob"));
+ bs.addBinding("name", vf.createIRI("urn:Bob"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Charlie"));
+ bs.addBinding("name", vf.createIRI("urn:Charlie"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:David"));
+ bs.addBinding("name", vf.createIRI("urn:David"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Eve"));
+ bs.addBinding("name", vf.createIRI("urn:Eve"));
expectedResults.add(bs);
bs = new MapBindingSet();
- bs.addBinding("name", vf.createURI("urn:Frank"));
+ bs.addBinding("name", vf.createIRI("urn:Frank"));
expectedResults.add(bs);
final Set<BindingSet> results = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQueryIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQueryIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQueryIT.java
index a1fee6f..a009b2a 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQueryIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoExecuteSparqlQueryIT.java
@@ -27,13 +27,13 @@ import org.apache.rya.api.client.ExecuteSparqlQuery;
import org.apache.rya.api.client.Install.InstallConfiguration;
import org.apache.rya.api.client.RyaClient;
import org.apache.rya.mongodb.MongoITBase;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.TupleQueryResult;
+import org.eclipse.rdf4j.query.impl.MapBindingSet;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.TupleQueryResult;
-import org.openrdf.query.impl.MapBindingSet;
/**
* Integration tests the methods of {@link }.
@@ -82,36 +82,36 @@ public class MongoExecuteSparqlQueryIT extends MongoITBase {
*/
private List<Statement> makeTestStatements() {
final List<Statement> loadMe = new ArrayList<>();
- final ValueFactory vf = new ValueFactoryImpl();
-
- loadMe.add(vf.createStatement(vf.createURI("http://example#alice"), vf.createURI("http://example#talksTo"), vf
- .createURI("http://example#bob")));
- loadMe.add(vf.createStatement(vf.createURI("http://example#bob"), vf.createURI("http://example#talksTo"), vf
- .createURI("http://example#charlie")));
- loadMe.add(vf.createStatement(vf.createURI("http://example#charlie"), vf.createURI("http://example#likes"), vf
- .createURI("http://example#icecream")));
+ final ValueFactory vf = SimpleValueFactory.getInstance();
+
+ loadMe.add(vf.createStatement(vf.createIRI("http://example#alice"), vf.createIRI("http://example#talksTo"), vf
+ .createIRI("http://example#bob")));
+ loadMe.add(vf.createStatement(vf.createIRI("http://example#bob"), vf.createIRI("http://example#talksTo"), vf
+ .createIRI("http://example#charlie")));
+ loadMe.add(vf.createStatement(vf.createIRI("http://example#charlie"), vf.createIRI("http://example#likes"), vf
+ .createIRI("http://example#icecream")));
return loadMe;
}
private List<BindingSet> makeExpectedResults() {
final List<BindingSet> expected = new ArrayList<>();
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
MapBindingSet bs = new MapBindingSet();
- bs.addBinding("a", vf.createURI("http://example#alice"));
- bs.addBinding("b", vf.createURI("http://example#talksTo"));
- bs.addBinding("c", vf.createURI("http://example#bob"));
+ bs.addBinding("a", vf.createIRI("http://example#alice"));
+ bs.addBinding("b", vf.createIRI("http://example#talksTo"));
+ bs.addBinding("c", vf.createIRI("http://example#bob"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("a", vf.createURI("http://example#bob"));
- bs.addBinding("b", vf.createURI("http://example#talksTo"));
- bs.addBinding("c", vf.createURI("http://example#charlie"));
+ bs.addBinding("a", vf.createIRI("http://example#bob"));
+ bs.addBinding("b", vf.createIRI("http://example#talksTo"));
+ bs.addBinding("c", vf.createIRI("http://example#charlie"));
expected.add(bs);
bs = new MapBindingSet();
- bs.addBinding("a", vf.createURI("http://example#charlie"));
- bs.addBinding("b", vf.createURI("http://example#likes"));
- bs.addBinding("c", vf.createURI("http://example#icecream"));
+ bs.addBinding("a", vf.createIRI("http://example#charlie"));
+ bs.addBinding("b", vf.createIRI("http://example#likes"));
+ bs.addBinding("c", vf.createIRI("http://example#icecream"));
expected.add(bs);
return expected;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFileIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFileIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFileIT.java
index 2ecaec0..1eedc68 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFileIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsFileIT.java
@@ -30,11 +30,11 @@ import org.apache.rya.api.client.InstanceDoesNotExistException;
import org.apache.rya.api.client.RyaClient;
import org.apache.rya.mongodb.MongoITBase;
import org.bson.Document;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.rio.RDFFormat;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.rio.RDFFormat;
import com.mongodb.client.MongoCursor;
/**
@@ -72,12 +72,12 @@ public class MongoLoadStatementsFileIT extends MongoITBase {
RDFFormat.TURTLE);
// Verify that the statements were loaded.
- final ValueFactory vf = new ValueFactoryImpl();
+ final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<Statement> expected = new HashSet<>();
- expected.add(vf.createStatement(vf.createURI("http://example#alice"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#bob")));
- expected.add(vf.createStatement(vf.createURI("http://example#bob"), vf.createURI("http://example#talksTo"), vf.createURI("http://example#charlie")));
- expected.add(vf.createStatement(vf.createURI("http://example#charlie"), vf.createURI("http://example#likes"), vf.createURI("http://example#icecream")));
+ expected.add(vf.createStatement(vf.createIRI("http://example#alice"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#bob")));
+ expected.add(vf.createStatement(vf.createIRI("http://example#bob"), vf.createIRI("http://example#talksTo"), vf.createIRI("http://example#charlie")));
+ expected.add(vf.createStatement(vf.createIRI("http://example#charlie"), vf.createIRI("http://example#likes"), vf.createIRI("http://example#icecream")));
final Set<Statement> statements = new HashSet<>();
final MongoCursor<Document> triplesIterator = getMongoClient()
@@ -87,9 +87,9 @@ public class MongoLoadStatementsFileIT extends MongoITBase {
while (triplesIterator.hasNext()) {
final Document triple = triplesIterator.next();
statements.add(vf.createStatement(
- vf.createURI(triple.getString("subject")),
- vf.createURI(triple.getString("predicate")),
- vf.createURI(triple.getString("object"))));
+ vf.createIRI(triple.getString("subject")),
+ vf.createIRI(triple.getString("predicate")),
+ vf.createIRI(triple.getString("object"))));
}
assertEquals(expected, statements);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsIT.java b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsIT.java
index 57e4b76..a491feb 100644
--- a/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/api/client/mongo/MongoLoadStatementsIT.java
@@ -28,10 +28,10 @@ import org.apache.rya.api.client.InstanceDoesNotExistException;
import org.apache.rya.api.client.RyaClient;
import org.apache.rya.mongodb.MongoITBase;
import org.bson.Document;
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
import com.mongodb.client.MongoCursor;
@@ -40,7 +40,7 @@ import com.mongodb.client.MongoCursor;
*/
public class MongoLoadStatementsIT extends MongoITBase {
- private static final ValueFactory VF = new ValueFactoryImpl();
+ private static final ValueFactory VF = SimpleValueFactory.getInstance();
@Test(expected = InstanceDoesNotExistException.class)
public void instanceDoesNotExist() throws Exception {
@@ -84,9 +84,9 @@ public class MongoLoadStatementsIT extends MongoITBase {
while (triplesIterator.hasNext()) {
final Document triple = triplesIterator.next();
stmtResults.add(VF.createStatement(
- VF.createURI(triple.getString("subject")),
- VF.createURI(triple.getString("predicate")),
- VF.createURI(triple.getString("object"))));
+ VF.createIRI(triple.getString("subject")),
+ VF.createIRI(triple.getString("predicate")),
+ VF.createIRI(triple.getString("object"))));
}
// Show the discovered statements match the original statements.
@@ -96,19 +96,19 @@ public class MongoLoadStatementsIT extends MongoITBase {
public Set<Statement> makeTestStatements() {
final Set<Statement> statements = new HashSet<>();
statements.add(VF.createStatement(
- VF.createURI("http://example#alice"),
- VF.createURI("http://example#talksTo"),
- VF.createURI("http://example#bob")));
+ VF.createIRI("http://example#alice"),
+ VF.createIRI("http://example#talksTo"),
+ VF.createIRI("http://example#bob")));
statements.add(
VF.createStatement(
- VF.createURI("http://example#bob"),
- VF.createURI("http://example#talksTo"),
- VF.createURI("http://example#charlie")));
+ VF.createIRI("http://example#bob"),
+ VF.createIRI("http://example#talksTo"),
+ VF.createIRI("http://example#charlie")));
statements.add(
VF.createStatement(
- VF.createURI("http://example#charlie"),
- VF.createURI("http://example#likes"),
- VF.createURI("http://example#icecream")));
+ VF.createIRI("http://example#charlie"),
+ VF.createIRI("http://example#likes"),
+ VF.createIRI("http://example#icecream")));
return statements;
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessorTest.java
index 659e9a8..82e32e6 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/GeneralizedExternalProcessorTest.java
@@ -25,13 +25,12 @@ import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
-
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidatorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidatorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidatorTest.java
index d54523c..92edfef 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidatorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexPlanValidatorTest.java
@@ -32,14 +32,14 @@ import org.apache.rya.indexing.pcj.matching.provider.AbstractPcjIndexSetProvider
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
import org.apache.rya.mongodb.EmbeddedMongoSingleton;
import org.apache.rya.mongodb.StatefulMongoDBRdfConfiguration;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGeneratorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGeneratorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGeneratorTest.java
index 793e6ab..71e9962 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGeneratorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/IndexedExecutionPlanGeneratorTest.java
@@ -26,13 +26,12 @@ import java.util.NoSuchElementException;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
-
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class IndexedExecutionPlanGeneratorTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelectorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelectorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelectorTest.java
index 106288e..485fea5 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelectorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ThreshholdPlanSelectorTest.java
@@ -28,16 +28,16 @@ import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
import org.apache.rya.indexing.pcj.matching.PCJOptimizer;
import org.apache.rya.indexing.pcj.matching.provider.AccumuloIndexSetProvider;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
@@ -691,7 +691,7 @@ public class ThreshholdPlanSelectorTest {
}
public static class NodeCollector extends
- QueryModelVisitorBase<RuntimeException> {
+ AbstractQueryModelVisitor<RuntimeException> {
List<QueryModelNode> qNodes = Lists.newArrayList();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGeneratorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGeneratorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGeneratorTest.java
index 3c11531..11cbea7 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGeneratorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleExecutionPlanGeneratorTest.java
@@ -19,18 +19,16 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
-
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -228,8 +226,8 @@ public class TupleExecutionPlanGeneratorTest {
Assert.assertEquals(2, size);
- Assert.assertTrue(processedTupList.get(0).equals(pq2.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(1).equals(pq1.getTupleExpr()));
+ Assert.assertEquals(pq1.getTupleExpr(), processedTupList.get(0));
+ Assert.assertEquals(pq2.getTupleExpr(), processedTupList.get(1));
}
@@ -280,12 +278,12 @@ public class TupleExecutionPlanGeneratorTest {
Assert.assertTrue(!processedTups.hasNext());
Assert.assertEquals(6, size);
- Assert.assertTrue(processedTupList.get(5).equals(pq1.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(0).equals(pq2.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(2).equals(pq3.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(4).equals(pq4.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(1).equals(pq5.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(3).equals(pq6.getTupleExpr()));
+ Assert.assertEquals(pq1.getTupleExpr(), processedTupList.get(1));
+ Assert.assertEquals(pq2.getTupleExpr(), processedTupList.get(2));
+ Assert.assertEquals(pq3.getTupleExpr(), processedTupList.get(4));
+ Assert.assertEquals(pq4.getTupleExpr(), processedTupList.get(0));
+ Assert.assertEquals(pq5.getTupleExpr(), processedTupList.get(3));
+ Assert.assertEquals(pq6.getTupleExpr(), processedTupList.get(5));
}
@@ -341,12 +339,12 @@ public class TupleExecutionPlanGeneratorTest {
Assert.assertTrue(!processedTups.hasNext());
Assert.assertEquals(6, size);
- Assert.assertTrue(processedTupList.get(5).equals(pq1.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(0).equals(pq2.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(2).equals(pq3.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(4).equals(pq4.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(1).equals(pq5.getTupleExpr()));
- Assert.assertTrue(processedTupList.get(3).equals(pq6.getTupleExpr()));
+ Assert.assertEquals(pq1.getTupleExpr(), processedTupList.get(1));
+ Assert.assertEquals(pq2.getTupleExpr(), processedTupList.get(2));
+ Assert.assertEquals(pq3.getTupleExpr(), processedTupList.get(4));
+ Assert.assertEquals(pq4.getTupleExpr(), processedTupList.get(0));
+ Assert.assertEquals(pq5.getTupleExpr(), processedTupList.get(3));
+ Assert.assertEquals(pq6.getTupleExpr(), processedTupList.get(5));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArrangerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArrangerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArrangerTest.java
index 2d07246..fde4b61 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArrangerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/TupleReArrangerTest.java
@@ -19,16 +19,15 @@ package org.apache.rya.indexing.IndexPlanValidator;
* under the License.
*/
-
import java.util.List;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.FilterOptimizer;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.impl.FilterOptimizer;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
public class TupleReArrangerTest {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGeneratorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGeneratorTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGeneratorTest.java
index 2bb2147..64f5e52 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGeneratorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/ValidIndexCombinationGeneratorTest.java
@@ -25,13 +25,12 @@ import java.util.List;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
-
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPrunerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPrunerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPrunerTest.java
index 7b173da..3452d0f 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPrunerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/IndexPlanValidator/VarConstantIndexListPrunerTest.java
@@ -25,12 +25,11 @@ import java.util.Set;
import org.apache.rya.indexing.external.tupleSet.ExternalTupleSet;
import org.apache.rya.indexing.external.tupleSet.SimpleExternalTupleSet;
-
+import org.eclipse.rdf4j.query.algebra.Projection;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.query.algebra.Projection;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Sets;
@@ -207,8 +206,8 @@ public class VarConstantIndexListPrunerTest {
indexSet.add(extTup2);
indexSet.add(extTup4);
- Assert.assertTrue(Sets.intersection(indexSet, Sets.<ExternalTupleSet> newHashSet(processedIndexSet))
- .equals(Sets.<ExternalTupleSet> newHashSet(processedIndexSet)));
+ Assert.assertTrue(Sets.intersection(indexSet, Sets.newHashSet(processedIndexSet))
+ .equals(Sets.newHashSet(processedIndexSet)));
}
@@ -245,8 +244,8 @@ public class VarConstantIndexListPrunerTest {
indexSet.add(extTup2);
Assert.assertTrue(Sets.intersection(indexSet,
- Sets.<ExternalTupleSet> newHashSet(processedIndexSet)).equals(
- Sets.<ExternalTupleSet> newHashSet(processedIndexSet)));
+ Sets.newHashSet(processedIndexSet)).equals(
+ Sets.newHashSet(processedIndexSet)));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/StatementSerializerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/StatementSerializerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/StatementSerializerTest.java
index b622d40..8689253 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/StatementSerializerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/StatementSerializerTest.java
@@ -19,68 +19,63 @@ package org.apache.rya.indexing.accumulo;
* under the License.
*/
-
-
-import junit.framework.Assert;
import org.apache.rya.indexing.StatementSerializer;
-
+import org.eclipse.rdf4j.model.Statement;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.junit.Assert;
import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ContextStatementImpl;
-import org.openrdf.model.impl.StatementImpl;
-import org.openrdf.model.impl.ValueFactoryImpl;
public class StatementSerializerTest {
@Test
public void testSimpleStatementObjectUri() throws Exception {
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
Statement s;
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createURI("foo:object"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createIRI("foo:object"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new ContextStatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createURI("foo:object"),
- vf.createURI("foo:context"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createIRI("foo:object"),
+ vf.createIRI("foo:context"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
@Test
public void testSimpleObjectLiteral() throws Exception {
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
Statement s;
String str;
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createURI("foo:object"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createIRI("foo:object"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
str = "Alice Palace";
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, "en"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, "en"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, vf.createURI("xsd:string")));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, vf.createIRI("xsd:string")));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
@Test
public void testObjectLiteralWithDataTypeGarbage() throws Exception {
// test with some garbage in the literal that may throw off the parser
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
Statement s;
String str;
str = "Alice ^^<Palace>\"";
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, "en"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, "en"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, vf.createURI("xsd:string")));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, vf.createIRI("xsd:string")));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
@@ -88,18 +83,18 @@ public class StatementSerializerTest {
@Test
public void testObjectLiteralWithAtSignGarbage() throws Exception {
// test with some garbage in the literal that may throw off the parser
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
Statement s;
String str;
str = "Alice @en";
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, "en"));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, "en"));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
- s = new StatementImpl(vf.createURI("foo:subject"), vf.createURI("foo:predicate"), vf.createLiteral(str, vf.createURI("xsd:string")));
+ s = vf.createStatement(vf.createIRI("foo:subject"), vf.createIRI("foo:predicate"), vf.createLiteral(str, vf.createIRI("xsd:string")));
Assert.assertEquals(s, StatementSerializer.readStatement(StatementSerializer.writeStatement(s)));
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
index 6a3a18a..a6487df 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/AccumuloDocIndexerTest.java
@@ -19,13 +19,16 @@ package org.apache.rya.indexing.accumulo.entity;
* under the License.
*/
-
-import info.aduna.iteration.CloseableIteration;
-
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.mock.MockInstance;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.hadoop.conf.Configuration;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.RyaTableMutationsFactory;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
@@ -35,31 +38,23 @@ import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.resolver.RyaTripleContext;
import org.apache.rya.indexing.accumulo.ConfigUtils;
-
-import org.apache.accumulo.core.client.BatchWriter;
-import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.mock.MockInstance;
-import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
-import org.apache.accumulo.core.client.security.tokens.PasswordToken;
-import org.apache.accumulo.core.data.Mutation;
-import org.apache.hadoop.conf.Configuration;
+import org.eclipse.rdf4j.common.iteration.CloseableIteration;
+import org.eclipse.rdf4j.model.Value;
+import org.eclipse.rdf4j.model.ValueFactory;
+import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.BindingSet;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
-import org.openrdf.model.impl.ValueFactoryImpl;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.QueryBindingSet;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
import com.google.common.collect.Lists;
@@ -68,7 +63,7 @@ public class AccumuloDocIndexerTest {
private MockInstance mockInstance;
private Connector accCon;
AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
- ValueFactory vf = new ValueFactoryImpl();
+ ValueFactory vf = SimpleValueFactory.getInstance();
private String tableName;
@@ -321,11 +316,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createURI("uri:5"));
+// b1.addBinding("X", vf.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createURI("uri:15"));
+// b2.addBinding("X", vf.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createURI("uri:25"));
+// b3.addBinding("X", vf.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
@@ -445,11 +440,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createURI("uri:15"));
+ b2.addBinding("X", vf.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createURI("uri:25"));
+ b3.addBinding("X", vf.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -671,11 +666,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createURI("uri:15"));
+ b2.addBinding("X", vf.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createURI("uri:25"));
+ b3.addBinding("X", vf.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -784,11 +779,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createURI("uri:15"));
+ b2.addBinding("X", vf.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createURI("uri:25"));
+ b3.addBinding("X", vf.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -939,11 +934,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createURI("uri:5"));
+// b1.addBinding("X", vf.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createURI("uri:15"));
+// b2.addBinding("X", vf.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createURI("uri:25"));
+// b3.addBinding("X", vf.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
@@ -1116,11 +1111,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createURI("uri:15"));
+ b2.addBinding("X", vf.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createURI("uri:25"));
+ b3.addBinding("X", vf.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -1653,11 +1648,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = (new QueryBindingSet());
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
QueryBindingSet b2 = (new QueryBindingSet());
- b2.addBinding("X", vf.createURI("uri:15"));
+ b2.addBinding("X", vf.createIRI("uri:15"));
QueryBindingSet b3 = (new QueryBindingSet());
- b3.addBinding("X", vf.createURI("uri:25"));
+ b3.addBinding("X", vf.createIRI("uri:25"));
bsList.add(b1);
bsList.add(b2);
bsList.add(b3);
@@ -1855,10 +1850,10 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
QueryBindingSet b1 = new QueryBindingSet();
- b1.addBinding("X", vf.createURI("uri:5"));
+ b1.addBinding("X", vf.createIRI("uri:5"));
b1.addBinding("Y3", v1);
QueryBindingSet b2 = new QueryBindingSet();
- b2.addBinding("X", vf.createURI("uri:25"));
+ b2.addBinding("X", vf.createIRI("uri:25"));
b2.addBinding("Y3", v2);
bsList.add(b1);
bsList.add(b2);
@@ -2040,11 +2035,11 @@ public class AccumuloDocIndexerTest {
List<BindingSet> bsList = Lists.newArrayList();
// QueryBindingSet b1 = (new QueryBindingSet());
-// b1.addBinding("X", vf.createURI("uri:5"));
+// b1.addBinding("X", vf.createIRI("uri:5"));
// QueryBindingSet b2 = (new QueryBindingSet());
-// b2.addBinding("X", vf.createURI("uri:15"));
+// b2.addBinding("X", vf.createIRI("uri:15"));
// QueryBindingSet b3 = (new QueryBindingSet());
-// b3.addBinding("X", vf.createURI("uri:25"));
+// b3.addBinding("X", vf.createIRI("uri:25"));
// bsList.add(b1);
// bsList.add(b2);
// bsList.add(b3);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
index f738ad1..79fd2c2 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityCentricIndexTest.java
@@ -21,25 +21,24 @@ package org.apache.rya.indexing.accumulo.entity;
import static org.apache.rya.api.RdfCloudTripleStoreConstants.DELIM_BYTES;
+import java.io.IOException;
+import java.util.Collection;
+
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.ColumnVisibility;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-
-import java.io.IOException;
-import java.util.Collection;
-import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
-
-import com.google.common.primitives.Bytes;
-
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaURI;
import org.apache.rya.api.resolver.RyaContext;
import org.apache.rya.api.resolver.RyaTypeResolverException;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.google.common.primitives.Bytes;
public class EntityCentricIndexTest {
private static RyaStatement ryaStatement;
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizerTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizerTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizerTest.java
index 211e822..70394b6 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizerTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/accumulo/entity/EntityOptimizerTest.java
@@ -19,23 +19,12 @@ package org.apache.rya.indexing.accumulo.entity;
* under the License.
*/
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
-import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
-import org.apache.rya.api.persist.RdfEvalStatsDAO;
-import org.apache.rya.indexing.accumulo.ConfigUtils;
-import org.apache.rya.indexing.accumulo.entity.EntityOptimizer;
-import org.apache.rya.indexing.accumulo.entity.EntityTupleSet;
-import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
-import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
@@ -48,19 +37,26 @@ import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
+import org.apache.rya.api.layout.TablePrefixLayoutStrategy;
+import org.apache.rya.api.persist.RdfEvalStatsDAO;
+import org.apache.rya.indexing.accumulo.ConfigUtils;
+import org.apache.rya.joinselect.AccumuloSelectivityEvalDAO;
+import org.apache.rya.prospector.service.ProspectorServiceEvalStatsDAO;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.QueryModelNode;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.evaluation.impl.FilterOptimizer;
+import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.QueryModelNode;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.evaluation.impl.FilterOptimizer;
-import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -1017,11 +1013,11 @@ public class EntityOptimizerTest {
Assert.assertEquals(2, nodes.size());
for (QueryModelNode q : nodes) {
-
- if (((EntityTupleSet) q).getStarQuery().getNodes().size() == 2) {
- Assert.assertEquals("m", ((EntityTupleSet) q).getStarQuery().getCommonVarName());
- } else if (((EntityTupleSet) q).getStarQuery().getNodes().size() == 3) {
- Assert.assertEquals("uri:chickens", ((EntityTupleSet) q).getStarQuery().getCommonVarName());
+ final StarQuery starQuery = ((EntityTupleSet) q).getStarQuery();
+ if (starQuery.getNodes().size() == 2) {
+ Assert.assertEquals("m", starQuery.getCommonVarName());
+ } else if (starQuery.getNodes().size() == 3) {
+ Assert.assertEquals("uri:chickens", starQuery.getCommonVarValue());
} else {
Assert.assertTrue(false);
}
@@ -1121,11 +1117,11 @@ public class EntityOptimizerTest {
Assert.assertEquals(2, nodes.size());
for (QueryModelNode q : nodes) {
-
- if (((EntityTupleSet) q).getStarQuery().getNodes().size() == 2) {
- Assert.assertEquals("m", ((EntityTupleSet) q).getStarQuery().getCommonVarName());
- } else if (((EntityTupleSet) q).getStarQuery().getNodes().size() == 3) {
- Assert.assertEquals("uri:chickens", ((EntityTupleSet) q).getStarQuery().getCommonVarName());
+ final StarQuery starQuery = ((EntityTupleSet) q).getStarQuery();
+ if (starQuery.getNodes().size() == 2) {
+ Assert.assertEquals("m", starQuery.getCommonVarName());
+ } else if (starQuery.getNodes().size() == 3) {
+ Assert.assertEquals("uri:chickens", starQuery.getCommonVarValue());
} else {
Assert.assertTrue(false);
}
@@ -1323,7 +1319,7 @@ public class EntityOptimizerTest {
- private class EntityCentricVisitor extends QueryModelVisitorBase<RuntimeException> {
+ private class EntityCentricVisitor extends AbstractQueryModelVisitor<RuntimeException> {
private Set<QueryModelNode> ccNodes = Sets.newHashSet();
[43/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
index dd1644b..b9e74bc 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/entity/update/mongo/MongoEntityIndexerIT.java
@@ -24,7 +24,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
import org.apache.rya.indexing.entity.model.Type;
@@ -46,18 +46,18 @@ import com.google.common.collect.Sets;
public class MongoEntityIndexerIT extends MongoITBase {
private static final Type PERSON_TYPE =
- new Type(new RyaURI("urn:person"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:age"))
- .add(new RyaURI("urn:eye"))
+ new Type(new RyaIRI("urn:person"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:age"))
+ .add(new RyaIRI("urn:eye"))
.build());
private static final Type EMPLOYEE_TYPE =
- new Type(new RyaURI("urn:employee"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:hoursPerWeek"))
+ new Type(new RyaIRI("urn:employee"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:hoursPerWeek"))
.build());
@Test
@@ -70,16 +70,16 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(PERSON_TYPE);
// Index a RyaStatement that will create an Entity with an explicit type.
- final RyaStatement statement = new RyaStatement(new RyaURI("urn:SSN/111-11-1111"), new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person"));
+ final RyaStatement statement = new RyaStatement(new RyaIRI("urn:SSN/111-11-1111"), new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person"));
indexer.storeStatement(statement);
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
- final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get();
+ final Entity entity = entities.get(new RyaIRI("urn:SSN/111-11-1111")).get();
final Entity expected = Entity.builder()
- .setSubject(new RyaURI("urn:SSN/111-11-1111"))
- .setExplicitType(new RyaURI("urn:person"))
+ .setSubject(new RyaIRI("urn:SSN/111-11-1111"))
+ .setExplicitType(new RyaIRI("urn:person"))
.build();
assertEquals(expected, entity);
@@ -97,17 +97,17 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(EMPLOYEE_TYPE);
// Index a RyaStatement that will create an Entity with two implicit types.
- final RyaStatement statement = new RyaStatement(new RyaURI("urn:SSN/111-11-1111"), new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"));
+ final RyaStatement statement = new RyaStatement(new RyaIRI("urn:SSN/111-11-1111"), new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice"));
indexer.storeStatement(statement);
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
- final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get();
+ final Entity entity = entities.get(new RyaIRI("urn:SSN/111-11-1111")).get();
final Entity expected = Entity.builder()
- .setSubject(new RyaURI("urn:SSN/111-11-1111"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setSubject(new RyaIRI("urn:SSN/111-11-1111"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
.build();
assertEquals(expected, entity);
@@ -125,23 +125,23 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(EMPLOYEE_TYPE);
// Index a bunch of RyaStatements.
- final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111");
- indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")));
- indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")));
- indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")));
- indexer.storeStatement(new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")));
+ final RyaIRI aliceSSN = new RyaIRI("urn:SSN/111-11-1111");
+ indexer.storeStatement(new RyaStatement(aliceSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")));
+ indexer.storeStatement(new RyaStatement(aliceSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")));
+ indexer.storeStatement(new RyaStatement(aliceSSN, new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")));
+ indexer.storeStatement(new RyaStatement(aliceSSN, new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")));
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
- final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get();
+ final Entity entity = entities.get(new RyaIRI("urn:SSN/111-11-1111")).get();
final Entity expected = Entity.builder()
.setSubject(aliceSSN)
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
.setVersion( entity.getVersion() )
.build();
@@ -160,18 +160,18 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(EMPLOYEE_TYPE);
// Index a bunch of RyaStatements.
- final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111");
- final RyaURI bobSSN = new RyaURI("urn:SSN/222-22-2222");
+ final RyaIRI aliceSSN = new RyaIRI("urn:SSN/111-11-1111");
+ final RyaIRI bobSSN = new RyaIRI("urn:SSN/222-22-2222");
indexer.storeStatements(Sets.newHashSet(
- new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
- new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
- new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")),
- new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")),
+ new RyaStatement(aliceSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")),
- new RyaStatement(bobSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")),
- new RyaStatement(bobSSN, new RyaURI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40")),
- new RyaStatement(bobSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:employee"))));
+ new RyaStatement(bobSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")),
+ new RyaStatement(bobSSN, new RyaIRI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40")),
+ new RyaStatement(bobSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:employee"))));
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
@@ -182,19 +182,19 @@ public class MongoEntityIndexerIT extends MongoITBase {
final Entity expectedAlice = Entity.builder()
.setSubject(aliceSSN)
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
.setVersion( alice.getVersion() )
.build();
final Entity expectedBob = Entity.builder()
.setSubject(bobSSN)
- .setExplicitType(new RyaURI("urn:employee"))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
+ .setExplicitType(new RyaIRI("urn:employee"))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:hoursPerWeek"), new RyaType(XMLSchema.INT, "40")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Bob")))
.setVersion( bob.getVersion() )
.build();
final Set<Entity> expected = Sets.newHashSet(expectedAlice, expectedBob);
@@ -214,27 +214,27 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(EMPLOYEE_TYPE);
// Index a bunch of RyaStatements.
- final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111");
+ final RyaIRI aliceSSN = new RyaIRI("urn:SSN/111-11-1111");
indexer.storeStatements(Sets.newHashSet(
- new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
- new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
- new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")),
- new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))));
+ new RyaStatement(aliceSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))));
// Remove the explicit type from Alice.
- indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")));
+ indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")));
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
- final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get();
+ final Entity entity = entities.get(new RyaIRI("urn:SSN/111-11-1111")).get();
final Entity expected = Entity.builder()
.setSubject(aliceSSN)
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
- .setProperty(new RyaURI("urn:employee"), new Property(new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setProperty(new RyaIRI("urn:employee"), new Property(new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")))
.setVersion( entity.getVersion() )
.build();
@@ -253,26 +253,26 @@ public class MongoEntityIndexerIT extends MongoITBase {
types.create(EMPLOYEE_TYPE);
// Index a bunch of RyaStatements.
- final RyaURI aliceSSN = new RyaURI("urn:SSN/111-11-1111");
+ final RyaIRI aliceSSN = new RyaIRI("urn:SSN/111-11-1111");
indexer.storeStatements(Sets.newHashSet(
- new RyaStatement(aliceSSN, new RyaURI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
- new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
- new RyaStatement(aliceSSN, new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")),
- new RyaStatement(aliceSSN, new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))));
+ new RyaStatement(aliceSSN, new RyaIRI( RDF.TYPE.toString() ), new RyaType(XMLSchema.ANYURI, "urn:person")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")),
+ new RyaStatement(aliceSSN, new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue"))));
// Remove the name property from Alice.
- indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaURI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")));
+ indexer.deleteStatement(new RyaStatement(aliceSSN, new RyaIRI("urn:name"), new RyaType(XMLSchema.STRING, "Alice")));
// Fetch the Entity from storage and ensure it looks correct.
final EntityStorage entities = new MongoEntityStorage(getMongoClient(), conf.getRyaInstanceName());
- final Entity entity = entities.get(new RyaURI("urn:SSN/111-11-1111")).get();
+ final Entity entity = entities.get(new RyaIRI("urn:SSN/111-11-1111")).get();
final Entity expected = Entity.builder()
.setSubject(aliceSSN)
- .setExplicitType(new RyaURI("urn:person"))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:age"), new RyaType(XMLSchema.INT, "30")))
- .setProperty(new RyaURI("urn:person"), new Property(new RyaURI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
+ .setExplicitType(new RyaIRI("urn:person"))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:age"), new RyaType(XMLSchema.INT, "30")))
+ .setProperty(new RyaIRI("urn:person"), new Property(new RyaIRI("urn:eye"), new RyaType(XMLSchema.STRING, "blue")))
.setVersion( entity.getVersion() )
.build();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
index 8d86a6d..db599ab 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoDbSmartUriIT.java
@@ -27,7 +27,7 @@ import static org.apache.rya.api.domain.RyaTypeUtils.intRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.longRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.shortRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.stringRyaType;
-import static org.apache.rya.api.domain.RyaTypeUtils.uriRyaType;
+import static org.apache.rya.api.domain.RyaTypeUtils.iriRyaType;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -39,7 +39,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.rya.api.domain.RyaSchema;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.entity.model.Entity;
@@ -79,35 +79,35 @@ public class MongoDbSmartUriIT extends MongoITBase {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
// People
- private static final RyaURI BOB = createRyaUri("Bob");
+ private static final RyaIRI BOB = createRyaIri("Bob");
// Attributes
- private static final RyaURI HAS_WEIGHT = createRyaUri("hasWeight");
- private static final RyaURI HAS_HEIGHT = createRyaUri("hasHeight");
- private static final RyaURI HAS_SSN = createRyaUri("hasSSN");
- private static final RyaURI HAS_AGE = createRyaUri("hasAge");
- private static final RyaURI HAS_INCOME = createRyaUri("hasIncome");
- private static final RyaURI HAS_NUMBER_OF_CHILDREN = createRyaUri("hasNumberOfChildren");
- private static final RyaURI HAS_LICENSE_NUMBER = createRyaUri("hasLicenseNumber");
- private static final RyaURI HAS_EYE_COLOR = createRyaUri("hasEyeColor");
- private static final RyaURI HAS_HAIR_COLOR = createRyaUri("hasHairColor");
- private static final RyaURI HAS_DATE_OF_BIRTH = createRyaUri("hasDateOfBirth");
- private static final RyaURI HAS_EXPIRATION_DATE = createRyaUri("hasExpirationDate");
- private static final RyaURI HAS_GLASSES = createRyaUri("hasGlasses");
- private static final RyaURI HAS_EMAIL_ADDRESS = createRyaUri("hasEmailAddress");
- private static final RyaURI HAS_ATTRIBUTE_SPACE = createRyaUri("has Attribute Space");
- private static final RyaURI HAS_MOTTO = createRyaUri("hasMotto");
- private static final RyaURI HAS_BLOOD_TYPE = createRyaUri("hasBloodType");
- private static final RyaURI HAS_SEX = createRyaUri("hasSex");
- private static final RyaURI HAS_ADDRESS = createRyaUri("hasAddress");
- private static final RyaURI HAS_POSITION_TITLE = createRyaUri("hasPositionTitle");
- private static final RyaURI HAS_WORK_ADDRESS = createRyaUri("hasWorkAddress");
- private static final RyaURI HAS_EXTENSION = createRyaUri("hasExtension");
- private static final RyaURI HAS_OFFICE_ROOM_NUMBER = createRyaUri("hasOfficeRoomNumber");
+ private static final RyaIRI HAS_WEIGHT = createRyaIri("hasWeight");
+ private static final RyaIRI HAS_HEIGHT = createRyaIri("hasHeight");
+ private static final RyaIRI HAS_SSN = createRyaIri("hasSSN");
+ private static final RyaIRI HAS_AGE = createRyaIri("hasAge");
+ private static final RyaIRI HAS_INCOME = createRyaIri("hasIncome");
+ private static final RyaIRI HAS_NUMBER_OF_CHILDREN = createRyaIri("hasNumberOfChildren");
+ private static final RyaIRI HAS_LICENSE_NUMBER = createRyaIri("hasLicenseNumber");
+ private static final RyaIRI HAS_EYE_COLOR = createRyaIri("hasEyeColor");
+ private static final RyaIRI HAS_HAIR_COLOR = createRyaIri("hasHairColor");
+ private static final RyaIRI HAS_DATE_OF_BIRTH = createRyaIri("hasDateOfBirth");
+ private static final RyaIRI HAS_EXPIRATION_DATE = createRyaIri("hasExpirationDate");
+ private static final RyaIRI HAS_GLASSES = createRyaIri("hasGlasses");
+ private static final RyaIRI HAS_EMAIL_ADDRESS = createRyaIri("hasEmailAddress");
+ private static final RyaIRI HAS_ATTRIBUTE_SPACE = createRyaIri("has Attribute Space");
+ private static final RyaIRI HAS_MOTTO = createRyaIri("hasMotto");
+ private static final RyaIRI HAS_BLOOD_TYPE = createRyaIri("hasBloodType");
+ private static final RyaIRI HAS_SEX = createRyaIri("hasSex");
+ private static final RyaIRI HAS_ADDRESS = createRyaIri("hasAddress");
+ private static final RyaIRI HAS_POSITION_TITLE = createRyaIri("hasPositionTitle");
+ private static final RyaIRI HAS_WORK_ADDRESS = createRyaIri("hasWorkAddress");
+ private static final RyaIRI HAS_EXTENSION = createRyaIri("hasExtension");
+ private static final RyaIRI HAS_OFFICE_ROOM_NUMBER = createRyaIri("hasOfficeRoomNumber");
// Type URIs
- private static final RyaURI PERSON_TYPE_URI = new RyaURI("urn:example/person");
- private static final RyaURI EMPLOYEE_TYPE_URI = new RyaURI("urn:example/employee");
+ private static final RyaIRI PERSON_TYPE_URI = new RyaIRI("urn:example/person");
+ private static final RyaIRI EMPLOYEE_TYPE_URI = new RyaIRI("urn:example/employee");
// Entities
private static final Entity BOB_ENTITY = createBobEntity();
@@ -124,22 +124,22 @@ public class MongoDbSmartUriIT extends MongoITBase {
}
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- private static RyaURI createRyaUri(final String localName) {
- return createRyaUri(NAMESPACE, localName);
+ private static RyaIRI createRyaIri(final String localName) {
+ return createRyaIri(NAMESPACE, localName);
}
/**
- * Creates a {@link RyaURI} for the specified local name.
+ * Creates a {@link RyaIRI} for the specified local name.
* @param namespace the namespace.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- private static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VF.createIRI(namespace, localName));
+ private static RyaIRI createRyaIri(final String namespace, final String localName) {
+ return RdfToRyaConversions.convertIRI(VF.createIRI(namespace, localName));
}
private static Entity createBobEntity() {
@@ -159,7 +159,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime().minusYears(40))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date())))
.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)))
- .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
+ .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_ATTRIBUTE_SPACE, stringRyaType("attribute space")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_MOTTO, stringRyaType("!@#*\\&%20^ smörgåsbord")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_BLOOD_TYPE, stringRyaType("A+ blood type")))
@@ -176,7 +176,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
private static Type createPersonType() {
final Type personType = new Type(PERSON_TYPE_URI,
- ImmutableSet.<RyaURI>builder()
+ ImmutableSet.<RyaIRI>builder()
.add(HAS_WEIGHT)
.add(HAS_HEIGHT)
.add(HAS_SSN)
@@ -201,7 +201,7 @@ public class MongoDbSmartUriIT extends MongoITBase {
private static Type createEmployeeType() {
final Type employeeType = new Type(EMPLOYEE_TYPE_URI,
- ImmutableSet.<RyaURI>builder()
+ ImmutableSet.<RyaIRI>builder()
.add(HAS_POSITION_TITLE)
.add(HAS_WORK_ADDRESS)
.add(HAS_EXTENSION)
@@ -210,8 +210,8 @@ public class MongoDbSmartUriIT extends MongoITBase {
return employeeType;
}
- private static String getRyaUriLocalName(final RyaURI ryaUri) {
- return VF.createIRI(ryaUri.getData()).getLocalName();
+ private static String getRyaIriLocalName(final RyaIRI ryaIri) {
+ return VF.createIRI(ryaIri.getData()).getLocalName();
}
@Test
@@ -258,8 +258,8 @@ public class MongoDbSmartUriIT extends MongoITBase {
smartUriConverter.storeEntity(BOB_ENTITY);
// New properties to add
- final RyaURI hasNickName = createRyaUri("hasNickName");
- final RyaURI hasWindowOffice = createRyaUri("hasWindowOffice");
+ final RyaIRI hasNickName = createRyaIri("hasNickName");
+ final RyaIRI hasWindowOffice = createRyaIri("hasWindowOffice");
final Entity.Builder builder = Entity.builder(BOB_ENTITY);
builder.setProperty(PERSON_TYPE_URI, new Property(HAS_AGE, shortRyaType((short) 41)));
@@ -281,8 +281,8 @@ public class MongoDbSmartUriIT extends MongoITBase {
assertEquals(newBobEntity.lookupTypeProperty(EMPLOYEE_TYPE, hasWindowOffice), resultEntity.lookupTypeProperty(EMPLOYEE_TYPE, hasWindowOffice));
assertEquals(newBobEntity.getSmartUri(), resultEntity.getSmartUri());
final String resultUriString = resultEntity.getSmartUri().stringValue();
- assertTrue(resultUriString.contains(getRyaUriLocalName(hasWindowOffice)));
- assertTrue(resultUriString.contains(getRyaUriLocalName(hasNickName)));
+ assertTrue(resultUriString.contains(getRyaIriLocalName(hasWindowOffice)));
+ assertTrue(resultUriString.contains(getRyaIriLocalName(hasNickName)));
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
index 3a38923..78da9cd 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndex2IT.java
@@ -21,7 +21,7 @@ package org.apache.rya.indexing.mongo;
import java.util.List;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.entity.EntityIndexOptimizer;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Property;
@@ -46,13 +46,13 @@ import com.google.common.collect.ImmutableSet;
public class MongoEntityIndex2IT extends MongoITBase {
private static final Type PERSON_TYPE =
- new Type(new RyaURI("urn:person"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:age"))
- .add(new RyaURI("urn:eye"))
+ new Type(new RyaIRI("urn:person"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:age"))
+ .add(new RyaIRI("urn:eye"))
.build());
- private static final RyaURI RYA_PERSON_TYPE = new RyaURI("urn:person");
+ private static final RyaIRI RYA_PERSON_TYPE = new RyaIRI("urn:person");
private EntityIndexOptimizer optimizer;
private EntityStorage entityStorage;
@@ -66,11 +66,11 @@ public class MongoEntityIndex2IT extends MongoITBase {
typeStorage.create(PERSON_TYPE);
final Entity entity = Entity.builder()
- .setSubject(new RyaURI("urn:SSN:111-11-1111"))
+ .setSubject(new RyaIRI("urn:SSN:111-11-1111"))
.setExplicitType(RYA_PERSON_TYPE)
- .setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:age"), new RyaType("25")))
- .setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:eye"), new RyaType("blue")))
- .setProperty(RYA_PERSON_TYPE, new Property(new RyaURI("urn:name"), new RyaType("bob")))
+ .setProperty(RYA_PERSON_TYPE, new Property(new RyaIRI("urn:age"), new RyaType("25")))
+ .setProperty(RYA_PERSON_TYPE, new Property(new RyaIRI("urn:eye"), new RyaType("blue")))
+ .setProperty(RYA_PERSON_TYPE, new Property(new RyaIRI("urn:name"), new RyaType("bob")))
.build();
entityStorage = optimizer.getEntityStorage();
entityStorage.create(entity);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
index f49f274..3636448 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoEntityIndexIT.java
@@ -26,7 +26,7 @@ import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Type;
@@ -75,7 +75,7 @@ public class MongoEntityIndexIT extends MongoITBase {
addStatements(conn);
final EntityStorage entities = indexer.getEntityStorage();
- final RyaURI subject = new RyaURI("urn:alice");
+ final RyaIRI subject = new RyaIRI("urn:alice");
final Optional<Entity> alice = entities.get(subject);
assertTrue(alice.isPresent());
} finally {
@@ -161,32 +161,32 @@ public class MongoEntityIndexIT extends MongoITBase {
private void setupTypes(MongoEntityIndexer indexer) throws Exception {
final TypeStorage typeStore = indexer.getTypeStorage();
// Add some Types to the storage.
- final Type cat = new Type(new RyaURI("urn:cat"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:numLegs"))
- .add(new RyaURI("urn:eye"))
- .add(new RyaURI("urn:species"))
+ final Type cat = new Type(new RyaIRI("urn:cat"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:numLegs"))
+ .add(new RyaIRI("urn:eye"))
+ .add(new RyaIRI("urn:species"))
.build());
- final Type dog = new Type(new RyaURI("urn:dog"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:numLegs"))
- .add(new RyaURI("urn:eye"))
- .add(new RyaURI("urn:species"))
+ final Type dog = new Type(new RyaIRI("urn:dog"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:numLegs"))
+ .add(new RyaIRI("urn:eye"))
+ .add(new RyaIRI("urn:species"))
.build());
- final Type icecream = new Type(new RyaURI("urn:icecream"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:brand"))
- .add(new RyaURI("urn:flavor"))
- .add(new RyaURI("urn:cost"))
+ final Type icecream = new Type(new RyaIRI("urn:icecream"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:brand"))
+ .add(new RyaIRI("urn:flavor"))
+ .add(new RyaIRI("urn:cost"))
.build());
- final Type person = new Type(new RyaURI("urn:person"),
- ImmutableSet.<RyaURI>builder()
- .add(new RyaURI("urn:name"))
- .add(new RyaURI("urn:age"))
- .add(new RyaURI("urn:eye"))
+ final Type person = new Type(new RyaIRI("urn:person"),
+ ImmutableSet.<RyaIRI>builder()
+ .add(new RyaIRI("urn:name"))
+ .add(new RyaIRI("urn:age"))
+ .add(new RyaIRI("urn:eye"))
.build());
typeStore.create(cat);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
index d827f78..4d2c6ce 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/mongo/MongoFreeTextIndexerIT.java
@@ -26,7 +26,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.StatementConstraints;
@@ -126,20 +126,20 @@ public class MongoFreeTextIndexerIT extends MongoITBase {
f.init();
// These should not be stored because they are not in the predicate list
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj1"), new RyaURI(RDFS.LABEL.toString()), new RyaType("invalid")));
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj2"), new RyaURI(RDFS.COMMENT.toString()), new RyaType("invalid")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj1"), new RyaIRI(RDFS.LABEL.toString()), new RyaType("invalid")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj2"), new RyaIRI(RDFS.COMMENT.toString()), new RyaType("invalid")));
- final RyaURI pred1 = new RyaURI("pred:1");
- final RyaURI pred2 = new RyaURI("pred:2");
+ final RyaIRI pred1 = new RyaIRI("pred:1");
+ final RyaIRI pred2 = new RyaIRI("pred:2");
// These should be stored because they are in the predicate list
- final RyaStatement s3 = new RyaStatement(new RyaURI("foo:subj3"), pred1, new RyaType("valid"));
- final RyaStatement s4 = new RyaStatement(new RyaURI("foo:subj4"), pred2, new RyaType("valid"));
+ final RyaStatement s3 = new RyaStatement(new RyaIRI("foo:subj3"), pred1, new RyaType("valid"));
+ final RyaStatement s4 = new RyaStatement(new RyaIRI("foo:subj4"), pred2, new RyaType("valid"));
f.storeStatement(s3);
f.storeStatement(s4);
// This should not be stored because the object is not a literal
- f.storeStatement(new RyaStatement(new RyaURI("foo:subj5"), pred1, new RyaURI("in:validURI")));
+ f.storeStatement(new RyaStatement(new RyaIRI("foo:subj5"), pred1, new RyaIRI("in:validURI")));
f.flush();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
index fa55df4..9d26914 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/smarturi/duplication/DuplicateDataDetectorIT.java
@@ -28,7 +28,7 @@ import static org.apache.rya.api.domain.RyaTypeUtils.intRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.longRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.shortRyaType;
import static org.apache.rya.api.domain.RyaTypeUtils.stringRyaType;
-import static org.apache.rya.api.domain.RyaTypeUtils.uriRyaType;
+import static org.apache.rya.api.domain.RyaTypeUtils.iriRyaType;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -47,7 +47,7 @@ import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.rya.api.domain.RyaSchema;
import org.apache.rya.api.domain.RyaType;
import org.apache.rya.api.domain.RyaTypeUtils;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.entity.model.Entity;
import org.apache.rya.indexing.entity.model.Entity.Builder;
@@ -82,55 +82,55 @@ public class DuplicateDataDetectorIT extends MongoITBase {
private static final ValueFactory VF = SimpleValueFactory.getInstance();
// People
- private static final RyaURI BOB = createRyaUri("Bob");
+ private static final RyaIRI BOB = createRyaIri("Bob");
// Attributes
- private static final RyaURI HAS_WEIGHT = createRyaUri("hasWeight");
- private static final RyaURI HAS_HEIGHT = createRyaUri("hasHeight");
- private static final RyaURI HAS_SSN = createRyaUri("hasSSN");
- private static final RyaURI HAS_AGE = createRyaUri("hasAge");
- private static final RyaURI HAS_INCOME = createRyaUri("hasIncome");
- private static final RyaURI HAS_NUMBER_OF_CHILDREN = createRyaUri("hasNumberOfChildren");
- private static final RyaURI HAS_LICENSE_NUMBER = createRyaUri("hasLicenseNumber");
- private static final RyaURI HAS_EYE_COLOR = createRyaUri("hasEyeColor");
- private static final RyaURI HAS_HAIR_COLOR = createRyaUri("hasHairColor");
- private static final RyaURI HAS_DATE_OF_BIRTH = createRyaUri("hasDateOfBirth");
- private static final RyaURI HAS_EXPIRATION_DATE = createRyaUri("hasExpirationDate");
- private static final RyaURI HAS_GLASSES = createRyaUri("hasGlasses");
- private static final RyaURI HAS_EMAIL_ADDRESS = createRyaUri("hasEmailAddress");
- private static final RyaURI HAS_ATTRIBUTE_SPACE = createRyaUri("has Attribute Space");
- private static final RyaURI HAS_MOTTO = createRyaUri("hasMotto");
- private static final RyaURI HAS_BLOOD_TYPE = createRyaUri("hasBloodType");
- private static final RyaURI HAS_SEX = createRyaUri("hasSex");
- private static final RyaURI HAS_ADDRESS = createRyaUri("hasAddress");
- private static final RyaURI HAS_POSITION_TITLE = createRyaUri("hasPositionTitle");
- private static final RyaURI HAS_WORK_ADDRESS = createRyaUri("hasWorkAddress");
- private static final RyaURI HAS_EXTENSION = createRyaUri("hasExtension");
- private static final RyaURI HAS_OFFICE_ROOM_NUMBER = createRyaUri("hasOfficeRoomNumber");
+ private static final RyaIRI HAS_WEIGHT = createRyaIri("hasWeight");
+ private static final RyaIRI HAS_HEIGHT = createRyaIri("hasHeight");
+ private static final RyaIRI HAS_SSN = createRyaIri("hasSSN");
+ private static final RyaIRI HAS_AGE = createRyaIri("hasAge");
+ private static final RyaIRI HAS_INCOME = createRyaIri("hasIncome");
+ private static final RyaIRI HAS_NUMBER_OF_CHILDREN = createRyaIri("hasNumberOfChildren");
+ private static final RyaIRI HAS_LICENSE_NUMBER = createRyaIri("hasLicenseNumber");
+ private static final RyaIRI HAS_EYE_COLOR = createRyaIri("hasEyeColor");
+ private static final RyaIRI HAS_HAIR_COLOR = createRyaIri("hasHairColor");
+ private static final RyaIRI HAS_DATE_OF_BIRTH = createRyaIri("hasDateOfBirth");
+ private static final RyaIRI HAS_EXPIRATION_DATE = createRyaIri("hasExpirationDate");
+ private static final RyaIRI HAS_GLASSES = createRyaIri("hasGlasses");
+ private static final RyaIRI HAS_EMAIL_ADDRESS = createRyaIri("hasEmailAddress");
+ private static final RyaIRI HAS_ATTRIBUTE_SPACE = createRyaIri("has Attribute Space");
+ private static final RyaIRI HAS_MOTTO = createRyaIri("hasMotto");
+ private static final RyaIRI HAS_BLOOD_TYPE = createRyaIri("hasBloodType");
+ private static final RyaIRI HAS_SEX = createRyaIri("hasSex");
+ private static final RyaIRI HAS_ADDRESS = createRyaIri("hasAddress");
+ private static final RyaIRI HAS_POSITION_TITLE = createRyaIri("hasPositionTitle");
+ private static final RyaIRI HAS_WORK_ADDRESS = createRyaIri("hasWorkAddress");
+ private static final RyaIRI HAS_EXTENSION = createRyaIri("hasExtension");
+ private static final RyaIRI HAS_OFFICE_ROOM_NUMBER = createRyaIri("hasOfficeRoomNumber");
// Type URIs
- private static final RyaURI PERSON_TYPE_URI = new RyaURI("urn:example/person");
- private static final RyaURI EMPLOYEE_TYPE_URI = new RyaURI("urn:example/employee");
+ private static final RyaIRI PERSON_TYPE_URI = new RyaIRI("urn:example/person");
+ private static final RyaIRI EMPLOYEE_TYPE_URI = new RyaIRI("urn:example/employee");
private static final Date NOW = new Date();
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- private static RyaURI createRyaUri(final String localName) {
- return createRyaUri(NAMESPACE, localName);
+ private static RyaIRI createRyaIri(final String localName) {
+ return createRyaIri(NAMESPACE, localName);
}
/**
- * Creates a {@link RyaURI} for the specified local name.
+ * Creates a {@link RyaIRI} for the specified local name.
* @param namespace the namespace.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- private static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VF.createIRI(namespace, localName));
+ private static RyaIRI createRyaIri(final String namespace, final String localName) {
+ return RdfToRyaConversions.convertIRI(VF.createIRI(namespace, localName));
}
private static Entity createBobEntity() {
@@ -150,7 +150,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime()).minusYears(40))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(NOW)))
.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)))
- .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
+ .setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bob.smitch00@gmail.com"))))
.setProperty(PERSON_TYPE_URI, new Property(HAS_ATTRIBUTE_SPACE, stringRyaType("attribute space")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_MOTTO, stringRyaType("!@#*\\&%20^ smörgåsbord")))
.setProperty(PERSON_TYPE_URI, new Property(HAS_BLOOD_TYPE, stringRyaType("A+ blood type")))
@@ -169,7 +169,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
final Type personType =
new Type(
PERSON_TYPE_URI,
- ImmutableSet.<RyaURI>builder()
+ ImmutableSet.<RyaIRI>builder()
.add(HAS_WEIGHT)
.add(HAS_HEIGHT)
.add(HAS_SSN)
@@ -197,7 +197,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
final Type employeeType =
new Type(
EMPLOYEE_TYPE_URI,
- ImmutableSet.<RyaURI>builder()
+ ImmutableSet.<RyaIRI>builder()
.add(HAS_POSITION_TITLE)
.add(HAS_WORK_ADDRESS)
.add(HAS_EXTENSION)
@@ -236,7 +236,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
public void testEntitySubjectsDifferent() throws SmartUriException, ConfigurationException {
final Entity entity1 = createBobEntity();
final Builder builder = new Builder(entity1);
- builder.setSubject(createRyaUri("Susan"));
+ builder.setSubject(createRyaIri("Susan"));
final Entity entity2 = builder.build();
final DuplicateDataDetector duplicateDataDetector = new DuplicateDataDetector();
@@ -248,7 +248,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
public void testEntityMissingType() throws SmartUriException, ConfigurationException {
final Entity entity1 = createBobEntity();
final Builder builder = new Builder(entity1);
- builder.setExplicitType(new RyaURI("urn:example/manager"));
+ builder.setExplicitType(new RyaIRI("urn:example/manager"));
final Entity entity2 = builder.build();
final DuplicateDataDetector duplicateDataDetector = new DuplicateDataDetector();
@@ -1801,7 +1801,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
assertTrue(entityStorage.get(bobEntity.getSubject()).isPresent());
final Builder duplicateBobBuilder = Entity.builder(createBobEntity());
- duplicateBobBuilder.setSubject(createRyaUri("Robert"));
+ duplicateBobBuilder.setSubject(createRyaIri("Robert"));
// Modify a property for each type that is within tolerance
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_AGE, shortRyaType((short) 41)));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_WEIGHT, floatRyaType(250.76f)));
@@ -1812,7 +1812,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 1).minusYears(40))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 1))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)));
- duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
+ duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("124 Fake St. Washington, DC 20024")));
duplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 556)));
final Entity duplicateBobEntity = duplicateBobBuilder.build();
@@ -1829,7 +1829,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
assertFalse(entityStorage.get(duplicateBobEntity.getSubject()).isPresent());
final Builder notDuplicateBobBuilder = Entity.builder(createBobEntity());
- notDuplicateBobBuilder.setSubject(createRyaUri("Not Bob"));
+ notDuplicateBobBuilder.setSubject(createRyaIri("Not Bob"));
// Modify a property for each type that is within tolerance
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_AGE, shortRyaType((short) 50)));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_WEIGHT, floatRyaType(300.0f)));
@@ -1840,7 +1840,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 10000000L).minusYears(40))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 10000000L))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(false)));
- notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
+ notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("123456789 Fake St. Washington, DC 20024")));
notDuplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 1000)));
final Entity notDuplicateBobEntity = notDuplicateBobBuilder.build();
@@ -1892,7 +1892,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
assertTrue(entityStorage.get(bobEntity.getSubject()).isPresent());
final Builder duplicateBobBuilder = Entity.builder(createBobEntity());
- duplicateBobBuilder.setSubject(createRyaUri("Robert"));
+ duplicateBobBuilder.setSubject(createRyaIri("Robert"));
// Modify a property for each type that is within tolerance
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_AGE, shortRyaType((short) 41)));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_WEIGHT, floatRyaType(250.76f)));
@@ -1903,7 +1903,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 1).minusYears(40))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 1))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(true)));
- duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
+ duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bob.smitch01@gmail.com"))));
duplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("124 Fake St. Washington, DC 20024")));
duplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 556)));
final Entity duplicateBobEntity = duplicateBobBuilder.build();
@@ -1918,7 +1918,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
assertTrue(entityStorage.get(duplicateBobEntity.getSubject()).isPresent());
final Builder notDuplicateBobBuilder = Entity.builder(createBobEntity());
- notDuplicateBobBuilder.setSubject(createRyaUri("Not Bob"));
+ notDuplicateBobBuilder.setSubject(createRyaIri("Not Bob"));
// Modify a property for each type that is within tolerance
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_AGE, shortRyaType((short) 50)));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_WEIGHT, floatRyaType(300.0f)));
@@ -1929,7 +1929,7 @@ public class DuplicateDataDetectorIT extends MongoITBase {
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_DATE_OF_BIRTH, dateRyaType(new DateTime(NOW.getTime() - 10000000L).minusYears(40))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EXPIRATION_DATE, dateRyaType(new Date(NOW.getTime() - 10000000L))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_GLASSES, booleanRyaType(false)));
- notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, uriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
+ notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_EMAIL_ADDRESS, iriRyaType(VF.createIRI("mailto:bad.email.address@gmail.com"))));
notDuplicateBobBuilder.setProperty(PERSON_TYPE_URI, new Property(HAS_ADDRESS, stringRyaType("123456789 Fake St. Washington, DC 20024")));
notDuplicateBobBuilder.setProperty(EMPLOYEE_TYPE_URI, new Property(HAS_EXTENSION, shortRyaType((short) 1000)));
final Entity notDuplicateBobEntity = notDuplicateBobBuilder.build();
@@ -1950,13 +1950,13 @@ public class DuplicateDataDetectorIT extends MongoITBase {
* {@code testInputs}.
* @param testInputs the {@link List} of {@link TestInput} to insert into
* the property.
- * @param typeIdUri the type ID {@link RyaURI} that the property falls
+ * @param typeIdUri the type ID {@link RyaIRI} that the property falls
* under. (not {@code null})
- * @param propertyNameUri the property name {@link RyaURI}.
+ * @param propertyNameUri the property name {@link RyaIRI}.
* (not {@code null})
* @throws SmartUriException
*/
- private static void testProperty(final List<TestInput> testInputs, final RyaURI typeIdUri, final RyaURI propertyNameUri) throws SmartUriException {
+ private static void testProperty(final List<TestInput> testInputs, final RyaIRI typeIdUri, final RyaIRI propertyNameUri) throws SmartUriException {
testProperty(testInputs, typeIdUri, propertyNameUri, new LinkedHashMap<>());
}
@@ -1966,15 +1966,15 @@ public class DuplicateDataDetectorIT extends MongoITBase {
* {@code testInputs}.
* @param testInputs the {@link List} of {@link TestInput} to insert into
* the property.
- * @param typeIdUri the type ID {@link RyaURI} that the property falls
+ * @param typeIdUri the type ID {@link RyaIRI} that the property falls
* under. (not {@code null})
- * @param propertyNameUri the property name {@link RyaURI}.
+ * @param propertyNameUri the property name {@link RyaIRI}.
* (not {@code null})
* @param equivalentTermsMap the {@link Map} of terms that are considered
* equivalent to each other.
* @throws SmartUriException
*/
- private static void testProperty(final List<TestInput> testInputs, final RyaURI typeIdUri, final RyaURI propertyNameUri, final Map<String, List<String>> equivalentTermsMap) throws SmartUriException {
+ private static void testProperty(final List<TestInput> testInputs, final RyaIRI typeIdUri, final RyaIRI propertyNameUri, final Map<String, List<String>> equivalentTermsMap) throws SmartUriException {
requireNonNull(typeIdUri);
requireNonNull(propertyNameUri);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
index a353de8..9f6b784 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataNodeTest.java
@@ -28,7 +28,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -78,11 +78,11 @@ public class AccumuloStatementMetadataNodeTest {
public void simpleQueryWithoutBindingSet()
throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SPARQLParser parser = new SPARQLParser();
@@ -121,11 +121,11 @@ public class AccumuloStatementMetadataNodeTest {
public void simpleQueryWithoutBindingSetInvalidProperty()
throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Doug"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Doug"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
SPARQLParser parser = new SPARQLParser();
@@ -146,13 +146,13 @@ public class AccumuloStatementMetadataNodeTest {
public void simpleQueryWithBindingSet() throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -202,13 +202,13 @@ public class AccumuloStatementMetadataNodeTest {
throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -264,11 +264,11 @@ public class AccumuloStatementMetadataNodeTest {
throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
SPARQLParser parser = new SPARQLParser();
@@ -307,13 +307,13 @@ public class AccumuloStatementMetadataNodeTest {
throws MalformedQueryException, QueryEvaluationException, RyaDAOException {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -385,13 +385,13 @@ public class AccumuloStatementMetadataNodeTest {
+ "owl:annotatedProperty <http://worksAt>; owl:annotatedTarget ?x; <http://createdBy> ?y; <http://createdOn> \'2017-01-04\'^^xsd:date }}";
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context_1"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context_2"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context_1"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context_2"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -457,13 +457,13 @@ public class AccumuloStatementMetadataNodeTest {
+ "owl:annotatedProperty <http://worksAt>; owl:annotatedTarget ?x; <http://createdBy> ?y; <http://createdOn> \'2017-01-04\'^^xsd:date }}";
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context_1"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context_2"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context_1"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context_2"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -538,13 +538,13 @@ public class AccumuloStatementMetadataNodeTest {
+ "owl:annotatedProperty <http://worksAt>; owl:annotatedTarget ?x; <http://createdBy> ?y; <http://createdOn> \'2017-01-04\'^^xsd:date }}";
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context_1"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context_2"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context_1"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context_2"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -580,11 +580,11 @@ public class AccumuloStatementMetadataNodeTest {
bsCollection.add(bsConstraint4);
// AccumuloRyaQueryEngine engine = dao.getQueryEngine();
-//// CloseableIteration<RyaStatement, RyaDAOException> iter = engine.query(new RyaStatement(new RyaURI("http://Joe"),
-//// new RyaURI("http://worksAt"), new RyaType("HardwareStore"), new RyaURI("http://context_2")), conf);
+//// CloseableIteration<RyaStatement, RyaDAOException> iter = engine.query(new RyaStatement(new RyaIRI("http://Joe"),
+//// new RyaIRI("http://worksAt"), new RyaType("HardwareStore"), new RyaIRI("http://context_2")), conf);
// CloseableIteration<? extends Map.Entry<RyaStatement,BindingSet>, RyaDAOException> iter = engine.queryWithBindingSet(Arrays.asList(new RdfCloudTripleStoreUtils.CustomEntry<RyaStatement, BindingSet>(
-// new RyaStatement(new RyaURI("http://Joe"),
-// new RyaURI("http://worksAt"), new RyaType("HardwareStore"), new RyaURI("http://context_2")), bsConstraint4)), conf);
+// new RyaStatement(new RyaIRI("http://Joe"),
+// new RyaIRI("http://worksAt"), new RyaType("HardwareStore"), new RyaIRI("http://context_2")), bsConstraint4)), conf);
// while (iter.hasNext()) {
// System.out.println(iter.next());
// }
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
index d887bc6..ebf22f0 100644
--- a/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
+++ b/extras/indexing/src/test/java/org/apache/rya/indexing/statement/metadata/AccumuloStatementMetadataOptimizerIT.java
@@ -30,7 +30,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.StatementMetadata;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -92,11 +92,11 @@ public class AccumuloStatementMetadataOptimizerIT {
@Test
public void simpleQueryWithoutBindingSet() throws Exception {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
TupleQueryResult result = conn.prepareTupleQuery(QueryLanguage.SPARQL, query1).evaluate();
@@ -128,11 +128,11 @@ public class AccumuloStatementMetadataOptimizerIT {
@Test
public void simpleQueryWithoutBindingSetInvalidProperty() throws Exception {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Doug"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Doug"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-15"));
- RyaStatement statement = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
dao.add(statement);
TupleQueryResult result = conn.prepareTupleQuery(QueryLanguage.SPARQL, query1).evaluate();
@@ -150,13 +150,13 @@ public class AccumuloStatementMetadataOptimizerIT {
public void simpleQueryWithBindingSet() throws Exception {
StatementMetadata metadata = new StatementMetadata();
- metadata.addMetadata(new RyaURI("http://createdBy"), new RyaType("Joe"));
- metadata.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata.addMetadata(new RyaIRI("http://createdBy"), new RyaType("Joe"));
+ metadata.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("CoffeeShop"), new RyaURI("http://context"), "", metadata);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaType("HardwareStore"), new RyaURI("http://context"), "", metadata);
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("CoffeeShop"), new RyaIRI("http://context"), "", metadata);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaType("HardwareStore"), new RyaIRI("http://context"), "", metadata);
dao.add(statement1);
dao.add(statement2);
@@ -200,20 +200,20 @@ public class AccumuloStatementMetadataOptimizerIT {
public void simpleQueryWithBindingSetJoinPropertyToSubject() throws Exception {
StatementMetadata metadata1 = new StatementMetadata();
- metadata1.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Doug"));
- metadata1.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
+ metadata1.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Doug"));
+ metadata1.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-01-04"));
StatementMetadata metadata2 = new StatementMetadata();
- metadata2.addMetadata(new RyaURI("http://createdBy"), new RyaURI("http://Bob"));
- metadata2.addMetadata(new RyaURI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
-
- RyaStatement statement1 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://worksAt"),
- new RyaURI("http://BurgerShack"), new RyaURI("http://context"), "", metadata1);
- RyaStatement statement2 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://talksTo"),
- new RyaURI("http://Betty"), new RyaURI("http://context"), "", metadata1);
- RyaStatement statement3 = new RyaStatement(new RyaURI("http://Fred"), new RyaURI("http://talksTo"),
- new RyaType("http://Amanda"), new RyaURI("http://context"), "", metadata1);
- RyaStatement statement4 = new RyaStatement(new RyaURI("http://Joe"), new RyaURI("http://talksTo"),
- new RyaType("http://Wanda"), new RyaURI("http://context"), "", metadata2);
+ metadata2.addMetadata(new RyaIRI("http://createdBy"), new RyaIRI("http://Bob"));
+ metadata2.addMetadata(new RyaIRI("http://createdOn"), new RyaType(XMLSchema.DATE, "2017-02-04"));
+
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://worksAt"),
+ new RyaIRI("http://BurgerShack"), new RyaIRI("http://context"), "", metadata1);
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://talksTo"),
+ new RyaIRI("http://Betty"), new RyaIRI("http://context"), "", metadata1);
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("http://Fred"), new RyaIRI("http://talksTo"),
+ new RyaType("http://Amanda"), new RyaIRI("http://context"), "", metadata1);
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("http://Joe"), new RyaIRI("http://talksTo"),
+ new RyaType("http://Wanda"), new RyaIRI("http://context"), "", metadata2);
dao.add(statement1);
dao.add(statement2);
dao.add(statement3);
@@ -244,8 +244,8 @@ public class AccumuloStatementMetadataOptimizerIT {
private static RdfCloudTripleStoreConfiguration getConf() {
RdfCloudTripleStoreConfiguration conf;
- Set<RyaURI> propertySet = new HashSet<RyaURI>(
- Arrays.asList(new RyaURI("http://createdBy"), new RyaURI("http://createdOn")));
+ Set<RyaIRI> propertySet = new HashSet<RyaIRI>(
+ Arrays.asList(new RyaIRI("http://createdBy"), new RyaIRI("http://createdOn")));
conf = new AccumuloRdfConfiguration();
conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true);
conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya_");
[27/48] incubator-rya git commit: RYA-405 Migration of OpenRDF Sesame
libraries to RDF4J
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/81b99327/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
----------------------------------------------------------------------
diff --git a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
index a237118..7108ae6 100644
--- a/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
+++ b/extras/indexing/src/test/java/org/apache/rya/accumulo/documentIndex/DocumentIndexIntersectingIteratorTest.java
@@ -23,18 +23,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
-import org.apache.rya.accumulo.AccumuloRdfConfiguration;
-import org.apache.rya.accumulo.RyaTableMutationsFactory;
-import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
-import org.apache.rya.api.resolver.RdfToRyaConversions;
-import org.apache.rya.api.resolver.RyaContext;
-import org.apache.rya.api.resolver.RyaToRdfConversions;
-import org.apache.rya.api.resolver.RyaTripleContext;
-import org.apache.rya.indexing.accumulo.entity.EntityCentricIndex;
-
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
@@ -49,29 +37,40 @@ import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;
+import org.apache.rya.accumulo.AccumuloRdfConfiguration;
+import org.apache.rya.accumulo.RyaTableMutationsFactory;
+import org.apache.rya.api.domain.RyaStatement;
+import org.apache.rya.api.domain.RyaType;
+import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.resolver.RdfToRyaConversions;
+import org.apache.rya.api.resolver.RyaContext;
+import org.apache.rya.api.resolver.RyaToRdfConversions;
+import org.apache.rya.api.resolver.RyaTripleContext;
+import org.apache.rya.indexing.accumulo.entity.EntityCentricIndex;
+import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
+import org.eclipse.rdf4j.query.MalformedQueryException;
+import org.eclipse.rdf4j.query.QueryEvaluationException;
+import org.eclipse.rdf4j.query.TupleQueryResultHandlerException;
+import org.eclipse.rdf4j.query.algebra.StatementPattern;
+import org.eclipse.rdf4j.query.algebra.TupleExpr;
+import org.eclipse.rdf4j.query.algebra.helpers.StatementPatternCollector;
+import org.eclipse.rdf4j.query.parser.ParsedQuery;
+import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
+import org.eclipse.rdf4j.repository.RepositoryException;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.openrdf.model.vocabulary.XMLSchema;
-import org.openrdf.query.MalformedQueryException;
-import org.openrdf.query.QueryEvaluationException;
-import org.openrdf.query.TupleQueryResultHandlerException;
-import org.openrdf.query.algebra.StatementPattern;
-import org.openrdf.query.algebra.TupleExpr;
-import org.openrdf.query.algebra.helpers.StatementPatternCollector;
-import org.openrdf.query.parser.ParsedQuery;
-import org.openrdf.query.parser.sparql.SPARQLParser;
-import org.openrdf.repository.RepositoryException;
import com.google.common.primitives.Bytes;
public class DocumentIndexIntersectingIteratorTest {
-
-
+
+
private Connector accCon;
String tablename = "table";
-
+
@Before
public void init() throws RepositoryException, TupleQueryResultHandlerException, QueryEvaluationException,
@@ -81,1813 +80,1809 @@ public class DocumentIndexIntersectingIteratorTest {
accCon.tableOperations().create(tablename);
}
-
-
-
-
-
-
-
-@Test
+
+ @Test
public void testBasicColumnObj() throws Exception {
BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
- m.put(new Text("cf"), new Text(null + "\u0000" + "obj" + "\u0000" + "cq"), new Value(new byte[0]));
- m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
+ Mutation m = new Mutation(new Text("" + i));
+ m.put(new Text("cf"), new Text(null + "\u0000" + "obj" + "\u0000" + "cq"), new Value(new byte[0]));
+ m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
- if (i == 30 || i == 60) {
- m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ"), new Value(new byte[0]));
- }
+ if (i == 30 || i == 60) {
+ m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ"), new Value(new byte[0]));
+ }
- bw.addMutation(m);
+ bw.addMutation(m);
- }
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" ));
- TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ" ));
- TextColumn tc3 = new TextColumn(new Text("CF"), new Text("obj" + "\u0000" + "CQ" ));
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" ));
+ TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ" ));
+ TextColumn tc3 = new TextColumn(new Text("CF"), new Text("obj" + "\u0000" + "CQ" ));
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- dii.setColumnFamilies(is, tc);
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 1****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(2, results);
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
- int results = 0;
- System.out.println("************************Test 1****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(2, results);
-
-
}
-
-
-
-
-
-
-
-@Test
+
+
+
+
+
+
+
+ @Test
public void testBasicColumnObjPrefix() throws Exception {
BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+ m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" ), new Value(new byte[0]));
+ m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
- for (int i = 0; i < 100; i++) {
+ if (i == 30 || i == 60) {
+ m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ" ), new Value(new byte[0]));
+ }
- Mutation m = new Mutation(new Text("" + i));
- m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" ), new Value(new byte[0]));
- m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
- if (i == 30 || i == 60) {
- m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ" ), new Value(new byte[0]));
- }
-
-
- bw.addMutation(m);
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq"));
+ TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ"));
+ TextColumn tc3 = new TextColumn(new Text("CF"), new Text("obj"));
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ tc3.setIsPrefix(true);
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 2****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(2, results);
+
- }
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq"));
- TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ"));
- TextColumn tc3 = new TextColumn(new Text("CF"), new Text("obj"));
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
- tc3.setIsPrefix(true);
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 2****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(2, results);
-
-
}
-
-
-
-
-@Test
- public void testBasicColumnSubjObjPrefix() throws Exception {
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
- m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq"), new Value(new byte[0]));
- m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
+ @Test
+ public void testBasicColumnSubjObjPrefix() throws Exception {
- if (i == 30 ) {
- m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ"), new Value(new byte[0]));
- }
-
- if (i == 60) {
- m.put(new Text("CF"), new Text(null + "\u0000" +"subj" + "\u0000" + "CQ"), new Value(new byte[0]));
- }
-
-
-
+ BatchWriter bw = null;
- bw.addMutation(m);
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+ m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq"), new Value(new byte[0]));
+ m.put(new Text("cF"), new Text(null + "\u0000" +"obj" + "\u0000" + "cQ"), new Value(new byte[0]));
+ if (i == 30 ) {
+ m.put(new Text("CF"), new Text(null + "\u0000" +"obj" + "\u0000" + "CQ"), new Value(new byte[0]));
}
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" ));
- TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ"));
- TextColumn tc3 = new TextColumn(new Text("CF"), new Text("subj"));
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
- tc3.setIsPrefix(true);
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 3****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
+
+ if (i == 60) {
+ m.put(new Text("CF"), new Text(null + "\u0000" +"subj" + "\u0000" + "CQ"), new Value(new byte[0]));
}
-
-
- Assert.assertEquals(1, results);
-
-
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" ));
+ TextColumn tc2 = new TextColumn(new Text("cF"), new Text("obj" + "\u0000" + "cQ"));
+ TextColumn tc3 = new TextColumn(new Text("CF"), new Text("subj"));
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ tc3.setIsPrefix(true);
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 3****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(1, results);
+
+
+
}
-
-
-
-
-@Test
+
+
+
+
+ @Test
public void testOneHundredColumnSubjObj() throws Exception {
BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
- }
-
- if (i == 30 ) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 100), new Value(new byte[0]));
- }
-
- if (i == 60) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 100), new Value(new byte[0]));
- }
-
-
-
+ Mutation m = new Mutation(new Text("" + i));
- bw.addMutation(m);
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
+ }
+
+ if (i == 30 ) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 100), new Value(new byte[0]));
+ }
+ if (i == 60) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 100), new Value(new byte[0]));
}
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
- TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj" + "\u0000" + "cq" + 100));
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- dii.setColumnFamilies(is, tc);
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj" + "\u0000" + "cq" + 100));
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 4****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(1, results);
+
- int results = 0;
- System.out.println("************************Test 4****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(1, results);
-
-
}
-
-
-
-
-@Test
+
+
+
+
+ @Test
public void testOneHundredColumnObjPrefix() throws Exception {
BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
- for (int i = 0; i < 100; i++) {
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j ), new Value(new byte[0]));
- }
-
- if (i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
- }
-
-
-
-
-
+ for (int i = 0; i < 100; i++) {
- bw.addMutation(m);
+ Mutation m = new Mutation(new Text("" + i));
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j ), new Value(new byte[0]));
}
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
- TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj"));
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
- tc3.setIsPrefix(true);
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 5****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
+
+ if (i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
}
-
-
- Assert.assertEquals(4, results);
-
-
+
+
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj"));
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ tc3.setIsPrefix(true);
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 5****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(4, results);
+
+
+
}
-
-
-
-
-
-
-
-@Test
+
+
+
+
+
+
+
+ @Test
public void testOneHundredColumnMultipleEntriesPerSubject() throws Exception {
BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j ), new Value(new byte[0]));
+ }
+
+ if (i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
+ }
+
+
+
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20 ));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 6****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(8, results);
+
+
+
+
+ }
+
+
+
+
+
+ @Test
+ public void testOneHundredColumnSubjObjPrefix() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
+ }
+
+ if (i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
+ }
+
+
+
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("subj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 7****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(4, results);
+
+
+
+
+ }
+
+
+
+
+
+
+ @Test
+ public void testOneHundredColumnSubjObjPrefixFourTerms() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
+ }
+
+ if (i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
+ m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
+ }
+
+
+
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("subj"));
+ TextColumn tc4 = new TextColumn(new Text("cf" + 100), new Text("obj"));
+
+ tc3.setIsPrefix(true);
+ tc4.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[4];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+ tc[3] = tc4;
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 8****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(4, results);
+
+
+
+
+ }
+
+
+
+
+
+
+ //@Test
+ public void testOneHundredColumnSameCf() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ for(int j= 0; j < 100; j++) {
+ m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
+ }
+
+
+
+ bw.addMutation(m);
+
+ }
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" ), new Text("obj" + "\u0000" + "cq" + 20));
+ TextColumn tc2 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" + 50));
+ TextColumn tc3 = new TextColumn(new Text("cf" ), new Text("obj" + "\u0000" + "cq" + 80));
+ TextColumn tc4 = new TextColumn(new Text("cf"), new Text("obj"));
+
+ tc4.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[4];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+ tc[3] = tc4;
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 9****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ //System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(10000, results);
+
+
+
+
+ }
+
+
+
+
+
+ @Test
+ public void testGeneralStarQuery() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+
+
+
+ if(i == 30 || i == 60 ) {
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3));
+
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 10****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(2, results);
+
+
+
+
+ }
+
+
+
+
+
+
+
+ @Test
+ public void testGeneralStarQuerySubjPrefix() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+ DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ dii.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 11****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(4, results);
+
+
+
+
+ }
+
+
+
+
+
+ @Test
+ public void testGeneralStarQueryMultipleSubjPrefix() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 12****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(12, results);
+
+
+
+
+ }
+
+
+
+
+ @Test
+ public void testFixedRangeColumnValidateExact() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3));
+ TextColumn tc4 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 4));
+ TextColumn tc5 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 5));
+
+
+
+ TextColumn[] tc = new TextColumn[5];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+ tc[3] = tc4;
+ tc[4] = tc5;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.setRange(Range.exact(new Text("" + 30)));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 14****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(1, results);
+
+
+
+
+ }
+
+
+
+
+
+
+ @Test
+ public void testLubmLikeTest() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m1 = new Mutation(new Text("ProfessorA" + i));
+ Mutation m2= new Mutation(new Text("ProfessorB" + i));
+
+ m1.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom"),
+ new Text(null + "\u0000" +"object" + "\u0000" + "http://www.University" + i + ".edu"), new Value(new byte[0]));
+ m2.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom"),
+ new Text(null + "\u0000" +"object" + "\u0000" + "http://www.University" + i + ".edu"), new Value(new byte[0]));
+ m1.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
+ new Text(null + "\u0000" +"object" + "\u0000" + "http://Course" + i), new Value(new byte[0]));
+ m2.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
+ new Text(null + "\u0000" +"object" + "\u0000" + "http://Course" + i), new Value(new byte[0]));
+
+
+ bw.addMutation(m1);
+ bw.addMutation(m2);
+
+ }
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom" ),
+ new Text("object" + "\u0000" + "http://www.University" + 30 + ".edu"));
+ TextColumn tc2 = new TextColumn(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
+ new Text("object" + "\u0000" + "http://Course" + 30));
+
+
+
+
+ TextColumn[] tc = new TextColumn[2];
+ tc[0] = tc1;
+ tc[1] = tc2;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 15****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(2, results);
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Test
+ public void testFixedRangeColumnValidateSubjPrefix() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.setRange(Range.exact(new Text("" + 30)));
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 13****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(3, results);
+
+
+
+
+ }
+
+
+
+
+
+ //@Test
+ //public void testRangeBound() {
+ //
+ // BatchWriter bw = null;
+ //
+ // try {
+ //
+ //
+ //
+ //
+ // for (int i = 0; i < 100; i++) {
+ //
+ // Mutation m = new Mutation(new Text("" + i));
+ //
+ // m.put(new Text("cf" + 1), new Text("obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ // m.put(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ // m.put(new Text("cf" + 1), new Text("subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ // m.put(new Text("cf" + 2), new Text("subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ //
+ //
+ //
+ // if(i == 30 || i == 60 || i == 90 || i == 99) {
+ // m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ // m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ // m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ // m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
+ // m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ // m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
+ // }
+ //
+ // bw.addMutation(m);
+ //
+ // }
+ //
+ //
+ //
+ // Text cf = new Text("cf" + 3);
+ // Text cq = new Text("obj" + "\u0000" + "cq" + 3);
+ //
+ // Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ // scan.fetchColumn(cf, cq );
+ // scan.setRange(new Range());
+ //
+ //
+ // int results = 0;
+ // System.out.println("************************Test 14****************************");
+ // for (Map.Entry<Key, Value> e : scan) {
+ // System.out.println(e);
+ // results++;
+ // }
+ //
+ //
+ //
+ //
+ //
+ //
+ // } catch (MutationsRejectedException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // } catch (TableNotFoundException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // }
+ //
+ //}
+
+
+
+
+
+ @Test
+ public void testContext1() throws Exception {
+
+ BatchWriter bw = null;
+
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
+
+ for (int i = 0; i < 100; i++) {
+
+ Mutation m = new Mutation(new Text("" + i));
+
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 4 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
+
+ }
+
+ bw.addMutation(m);
+
+ }
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("obj"));
+
+ tc3.setIsPrefix(true);
+
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
+
+
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setContext(is, "context1");
+
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+
+ scan.addScanIterator(is);
+
+ int results = 0;
+ System.out.println("************************Test 14****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
+
+
+ Assert.assertEquals(8, results);
+
+
+
+
+ }
- for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j ), new Value(new byte[0]));
- }
-
- if (i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
- }
-
-
-
-
-
- bw.addMutation(m);
- }
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20 ));
- TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("obj"));
-
- tc3.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 6****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(8, results);
-
-
- }
-
-
-
-
-@Test
-public void testOneHundredColumnSubjObjPrefix() throws Exception {
+ @Test
+ public void testContext2() throws Exception {
- BatchWriter bw = null;
+ BatchWriter bw = null;
bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
for (int i = 0; i < 100; i++) {
Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
- }
-
- if (i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
+
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 4 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context3" + "\u0000" +"obj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
+
}
-
-
-
-
-
bw.addMutation(m);
}
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
- TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("subj"));
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("obj"));
tc3.setIsPrefix(true);
-
+
TextColumn[] tc = new TextColumn[3];
tc[0] = tc1;
tc[1] = tc2;
tc[2] = tc3;
+
IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- dii.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setContext(is, "context2");
Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+
scan.addScanIterator(is);
int results = 0;
- System.out.println("************************Test 7****************************");
+ System.out.println("************************Test 15****************************");
for (Map.Entry<Key, Value> e : scan) {
System.out.println(e);
results++;
}
-
-
- Assert.assertEquals(4, results);
-
-
-}
+ Assert.assertEquals(0, results);
+
+
+
+
+ }
-@Test
-public void testOneHundredColumnSubjObjPrefixFourTerms() throws Exception {
- BatchWriter bw = null;
+
+ @Test
+ public void testContext3() throws Exception {
+
+ BatchWriter bw = null;
bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+
+
for (int i = 0; i < 100; i++) {
Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf" + j), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
- }
-
- if (i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + (100 + i)), new Value(new byte[0]));
- m.put(new Text("cf" + 100), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + (100 + i + 1)), new Value(new byte[0]));
+
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 1 + "\u0000" + "context1"), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 2 + "\u0000" + "context1"), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 1 + "\u0000" + "context2"), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 2 + "\u0000" + "context2"), new Value(new byte[0]));
+
+
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 4 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context3" + "\u0000" +"obj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
+
}
-
-
-
-
-
bw.addMutation(m);
}
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 20), new Text("obj" + "\u0000" + "cq" + 20));
- TextColumn tc2 = new TextColumn(new Text("cf" + 50), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" + 100), new Text("subj"));
- TextColumn tc4 = new TextColumn(new Text("cf" + 100), new Text("obj"));
+
+
+
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("obj"));
tc3.setIsPrefix(true);
- tc4.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[4];
+
+ TextColumn[] tc = new TextColumn[3];
tc[0] = tc1;
tc[1] = tc2;
tc[2] = tc3;
- tc[3] = tc4;
+
IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- dii.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setContext(is, "context2");
Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+
scan.addScanIterator(is);
int results = 0;
- System.out.println("************************Test 8****************************");
+ System.out.println("************************Test 16****************************");
for (Map.Entry<Key, Value> e : scan) {
System.out.println(e);
results++;
}
-
-
+
+
Assert.assertEquals(4, results);
-
-
-}
+ }
-//@Test
-public void testOneHundredColumnSameCf() throws Exception {
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
-
- for(int j= 0; j < 100; j++) {
- m.put(new Text("cf"), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + j), new Value(new byte[0]));
- }
-
-
- bw.addMutation(m);
+ @Test
+ public void testContext4() throws Exception {
- }
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" ), new Text("obj" + "\u0000" + "cq" + 20));
- TextColumn tc2 = new TextColumn(new Text("cf"), new Text("obj" + "\u0000" + "cq" + 50));
- TextColumn tc3 = new TextColumn(new Text("cf" ), new Text("obj" + "\u0000" + "cq" + 80));
- TextColumn tc4 = new TextColumn(new Text("cf"), new Text("obj"));
+ BatchWriter bw = null;
- tc4.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[4];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
- tc[3] = tc4;
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- dii.setColumnFamilies(is, tc);
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
+ for (int i = 0; i < 100; i++) {
- int results = 0;
- System.out.println("************************Test 9****************************");
- for (Map.Entry<Key, Value> e : scan) {
- //System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(10000, results);
+ Mutation m = new Mutation(new Text("" + i));
-
-
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-}
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context2" + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ }
+ bw.addMutation(m);
-@Test
-public void testGeneralStarQuery() throws Exception {
+ }
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
- for (int i = 0; i < 100; i++) {
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("obj"));
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
-
-
+ tc3.setIsPrefix(true);
- if(i == 30 || i == 60 ) {
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- }
-
- bw.addMutation(m);
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
- }
-
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
- TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
- TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3));
-
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 10****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(2, results);
-
-
-
-}
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+ int results = 0;
+ System.out.println("************************Test 17****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
-@Test
-public void testGeneralStarQuerySubjPrefix() throws Exception {
+ Assert.assertEquals(8, results);
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
- for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-
-
- if(i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- }
-
- bw.addMutation(m);
+ }
- }
-
-
- DocumentIndexIntersectingIterator dii = new DocumentIndexIntersectingIterator();
- TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
- TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
- TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
-
- tc3.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- dii.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 11****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(4, results);
-
-
-
-}
+ @Test
+ public void testContext5() throws Exception {
+ BatchWriter bw = null;
-@Test
-public void testGeneralStarQueryMultipleSubjPrefix() throws Exception {
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100; i++) {
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-
-
+ Mutation m = new Mutation(new Text("" + i));
- if(i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
- }
-
- bw.addMutation(m);
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text("context2" + "\u0000" + "obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context2" + "\u0000" + "obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text(null + "\u0000" + "obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text(null + "\u0000" + "obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
- }
-
-
-
- TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
- TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
- TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
-
- tc3.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 12****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(12, results);
-
-
-
-}
+ if(i == 30 || i == 60 || i == 90 || i == 99) {
+ m.put(new Text("cf" + 3), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text("context2" + "\u0000" + "obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ m.put(new Text("cf" + 3), new Text(null + "\u0000" + "obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
+ }
+ bw.addMutation(m);
-@Test
-public void testFixedRangeColumnValidateExact() throws Exception {
+ }
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
- for (int i = 0; i < 100; i++) {
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
+ TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("obj"));
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-
-
+ tc3.setIsPrefix(true);
- if(i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
- }
-
- bw.addMutation(m);
+ TextColumn[] tc = new TextColumn[3];
+ tc[0] = tc1;
+ tc[1] = tc2;
+ tc[2] = tc3;
- }
-
-
-
- TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
- TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
- TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3));
- TextColumn tc4 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 4));
- TextColumn tc5 = new TextColumn(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 5));
-
-
-
- TextColumn[] tc = new TextColumn[5];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
- tc[3] = tc4;
- tc[4] = tc5;
-
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.setRange(Range.exact(new Text("" + 30)));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 14****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(1, results);
-
-
-
-}
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
+ scan.addScanIterator(is);
+ int results = 0;
+ System.out.println("************************Test 18****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
-@Test
-public void testLubmLikeTest() throws Exception {
- BatchWriter bw = null;
+ Assert.assertEquals(12, results);
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
- for (int i = 0; i < 100; i++) {
- Mutation m1 = new Mutation(new Text("ProfessorA" + i));
- Mutation m2= new Mutation(new Text("ProfessorB" + i));
-
- m1.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom"),
- new Text(null + "\u0000" +"object" + "\u0000" + "http://www.University" + i + ".edu"), new Value(new byte[0]));
- m2.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom"),
- new Text(null + "\u0000" +"object" + "\u0000" + "http://www.University" + i + ".edu"), new Value(new byte[0]));
- m1.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
- new Text(null + "\u0000" +"object" + "\u0000" + "http://Course" + i), new Value(new byte[0]));
- m2.put(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
- new Text(null + "\u0000" +"object" + "\u0000" + "http://Course" + i), new Value(new byte[0]));
-
-
- bw.addMutation(m1);
- bw.addMutation(m2);
- }
-
-
-
- TextColumn tc1 = new TextColumn(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#doctoralDegreeFrom" ),
- new Text("object" + "\u0000" + "http://www.University" + 30 + ".edu"));
- TextColumn tc2 = new TextColumn(new Text("http://swat.cse.lehigh.edu/onto/univ-bench.owl#teacherOf"),
- new Text("object" + "\u0000" + "http://Course" + 30));
-
+ }
-
- TextColumn[] tc = new TextColumn[2];
- tc[0] = tc1;
- tc[1] = tc2;
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
- DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.addScanIterator(is);
- int results = 0;
- System.out.println("************************Test 15****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(2, results);
+ @Test
+ public void testContext6() throws Exception {
-
-
+ BatchWriter bw = null;
-}
+ bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ for (int i = 0; i < 100; i++) {
+ Mutation m = new Mutation(new Text("row" + i));
+ m.put(new Text("cf" + 1), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + i), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context1" + "\u0000" + "subj" + "\u0000" + "cq" + i), new Value(new byte[0]));
+ m.put(new Text("cf" + 1), new Text("context2" + "\u0000" + "obj" + "\u0000" + "cq" + i), new Value(new byte[0]));
+ m.put(new Text("cf" + 2), new Text("context2" + "\u0000" + "subj" + "\u0000" + "cq" + i), new Value(new byte[0]));
+ bw.addMutation(m);
+ }
+ TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" ));
+ TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("subj" ));
+ tc1.setIsPrefix(true);
+ tc2.setIsPrefix(true);
+ TextColumn[] tc = new TextColumn[2];
+ tc[0] = tc1;
+ tc[1] = tc2;
-@Test
-public void testFixedRangeColumnValidateSubjPrefix() throws Exception {
- BatchWriter bw = null;
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
+ IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
-
- for (int i = 0; i < 100; i++) {
+ DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
+ DocumentIndexIntersectingIterator.setContext(is, "context2");
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
- m.put(new Text("cf" + 1), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
-
-
+ Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- if(i == 30 || i == 60 || i == 90 || i == 99) {
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 3 ), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 4 ), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"obj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
- m.put(new Text("cf" + 3), new Text(null + "\u0000" +"subj" + "\u0000" + "cq" + 5 ), new Value(new byte[0]));
- }
-
- bw.addMutation(m);
+ scan.addScanIterator(is);
- }
-
-
-
- TextColumn tc1 = new TextColumn(new Text("cf" + 1 ), new Text("obj" + "\u0000" + "cq" + 1));
- TextColumn tc2 = new TextColumn(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2));
- TextColumn tc3 = new TextColumn(new Text("cf" + 3), new Text("subj"));
-
- tc3.setIsPrefix(true);
-
- TextColumn[] tc = new TextColumn[3];
- tc[0] = tc1;
- tc[1] = tc2;
- tc[2] = tc3;
-
-
- IteratorSetting is = new IteratorSetting(30, "fii", DocumentIndexIntersectingIterator.class);
-
- DocumentIndexIntersectingIterator.setColumnFamilies(is, tc);
-
- Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
- scan.setRange(Range.exact(new Text("" + 30)));
- scan.addScanIterator(is);
-
- int results = 0;
- System.out.println("************************Test 13****************************");
- for (Map.Entry<Key, Value> e : scan) {
- System.out.println(e);
- results++;
- }
-
-
- Assert.assertEquals(3, results);
-
-
-
+ int results = 0;
+ System.out.println("************************Test 19****************************");
+ for (Map.Entry<Key, Value> e : scan) {
+ System.out.println(e);
+ results++;
+ }
-}
+ Assert.assertEquals(100, results);
-//@Test
-//public void testRangeBound() {
-//
-// BatchWriter bw = null;
-//
-// try {
-//
-//
-//
-//
-// for (int i = 0; i < 100; i++) {
-//
-// Mutation m = new Mutation(new Text("" + i));
-//
-// m.put(new Text("cf" + 1), new Text("obj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
-// m.put(new Text("cf" + 2), new Text("obj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-// m.put(new Text("cf" + 1), new Text("subj" + "\u0000" + "cq" + 1), new Value(new byte[0]));
-// m.put(new Text("cf" + 2), new Text("subj" + "\u0000" + "cq" + 2), new Value(new byte[0]));
-//
-//
-//
-// if(i == 30 || i == 60 || i == 90 || i == 99) {
-// m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
-// m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 3), new Value(new byte[0]));
-// m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
-// m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 4), new Value(new byte[0]));
-// m.put(new Text("cf" + 3), new Text("obj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
-// m.put(new Text("cf" + 3), new Text("subj" + "\u0000" + "cq" + 5), new Value(new byte[0]));
-// }
-//
-// bw.addMutation(m);
-//
-// }
-//
-//
-//
-// Text cf = new Text("cf" + 3);
-// Text cq = new Text("obj" + "\u0000" + "cq" + 3);
-//
-// Scanner scan = accCon.createScanner(tablename, new Authorizations("auths"));
-// scan.fetchColumn(cf, cq );
-// scan.setRange(new Range());
-//
-//
-// int results = 0;
-// System.out.println("************************Test 14****************************");
-// for (Map.Entry<Key, Value> e : scan) {
-// System.out.println(e);
-// results++;
-// }
-//
-//
-//
-//
-//
-//
-// } catch (MutationsRejectedException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// } catch (TableNotFoundException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-//
-//}
-
-
-
-
-
-@Test
-public void testContext1() throws Exception {
-
- BatchWriter bw = null;
-
- bw = accCon.createBatchWriter(tablename, 500L * 1024L * 1024L, Long.MAX_VALUE, 30);
-
-
-
- for (int i = 0; i < 100; i++) {
-
- Mutation m = new Mutation(new Text("" + i));
-
- m.put(new Text("cf" + 1), new Text("context1" + "\u0000" + "obj" + "\u0000" + "cq" + 1 ), new Value(new byte[0]));
- m.put(new Text("cf" + 2), new Text("context1" + "\u0000" +"obj" + "\u0000" + "cq" + 2 ), new Value(new byte[0]));
-
-
-
<TRUNCATED>
[41/48] incubator-rya git commit: Rya-405 Refactor RyaURI to RyaIRI
to match RDF4J. Closes #291
Posted by pu...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
----------------------------------------------------------------------
diff --git a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
index 4cf54dc..4647b8b 100644
--- a/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
+++ b/extras/rya.indexing.pcj/src/main/java/org/apache/rya/indexing/pcj/storage/accumulo/BindingSetStringConverter.java
@@ -123,10 +123,10 @@ public class BindingSetStringConverter implements BindingSetConverter<String> {
final String typeString = valueAndType[1];
// Convert the String Type into a IRI that describes the type.
- final IRI typeURI = VF.createIRI(typeString);
+ final IRI typeIRI = VF.createIRI(typeString);
// Convert the String Value into a Value.
- final Value value = typeURI.equals(XMLSchema.ANYURI) ?
+ final Value value = typeIRI.equals(XMLSchema.ANYURI) ?
VF.createIRI(dataString) :
VF.createLiteral(dataString, VF.createIRI(typeString));
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
index 8a02672..12e4098 100644
--- a/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
+++ b/extras/rya.merger/src/main/java/org/apache/rya/accumulo/mr/merge/util/AccumuloRyaUtils.java
@@ -56,7 +56,7 @@ import org.apache.rya.accumulo.mr.MRUtils;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -85,10 +85,10 @@ public final class AccumuloRyaUtils {
private static final String NAMESPACE = RdfCloudTripleStoreConstants.NAMESPACE;
private static final ValueFactory VALUE_FACTORY = RdfCloudTripleStoreConstants.VALUE_FACTORY;
- public static RyaURI RTS_SUBJECT_RYA = RdfCloudTripleStoreConstants.RTS_SUBJECT_RYA;
- public static RyaURI RTS_COPY_TOOL_RUN_TIME_PREDICATE_RYA = createRyaUri(COPY_TOOL_RUN_TIME_LOCAL_NAME);
- public static RyaURI RTS_COPY_TOOL_SPLIT_TIME_PREDICATE_RYA = createRyaUri(COPY_TOOL_SPLIT_TIME_LOCAL_NAME);
- public static RyaURI RTS_TIME_OFFSET_PREDICATE_RYA = createRyaUri(COPY_TOOL_TIME_OFFSET_LOCAL_NAME);
+ public static RyaIRI RTS_SUBJECT_RYA = RdfCloudTripleStoreConstants.RTS_SUBJECT_RYA;
+ public static RyaIRI RTS_COPY_TOOL_RUN_TIME_PREDICATE_RYA = createRyaIri(COPY_TOOL_RUN_TIME_LOCAL_NAME);
+ public static RyaIRI RTS_COPY_TOOL_SPLIT_TIME_PREDICATE_RYA = createRyaIri(COPY_TOOL_SPLIT_TIME_LOCAL_NAME);
+ public static RyaIRI RTS_TIME_OFFSET_PREDICATE_RYA = createRyaIri(COPY_TOOL_TIME_OFFSET_LOCAL_NAME);
/**
* Ignore the meta statements indicating the Rya version and copy time values.
@@ -107,22 +107,22 @@ public final class AccumuloRyaUtils {
}
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String localName) {
- return createRyaUri(NAMESPACE, localName);
+ public static RyaIRI createRyaIri(final String localName) {
+ return createRyaIri(NAMESPACE, localName);
}
/**
- * Creates a {@link RyaURI} for the specified local name.
+ * Creates a {@link RyaIRI} for the specified local name.
* @param namespace the namespace.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String namespace, final String localName) {
- return RdfToRyaConversions.convertURI(VALUE_FACTORY.createIRI(namespace, localName));
+ public static RyaIRI createRyaIri(final String namespace, final String localName) {
+ return RdfToRyaConversions.convertIRI(VALUE_FACTORY.createIRI(namespace, localName));
}
/**
@@ -207,13 +207,13 @@ public final class AccumuloRyaUtils {
/**
* Gets the metadata key from the table.
- * @param ryaStatement the {@link RyaStatement} for the metadata key to query.
+ * @param predicateRyaIri the predicate {@link RyaIRI}.
* @param dao the {@link AccumuloRyaDAO}.
* @return the string value of the object from the metadata key.
* @throws RyaDAOException
*/
- private static String getMetadata(final RyaURI predicateRyaUri, final AccumuloRyaDAO dao) throws RyaDAOException {
- final RyaStatement ryaStatement = new RyaStatement(RTS_SUBJECT_RYA, predicateRyaUri, null);
+ private static String getMetadata(final RyaIRI predicateRyaIri, final AccumuloRyaDAO dao) throws RyaDAOException {
+ final RyaStatement ryaStatement = new RyaStatement(RTS_SUBJECT_RYA, predicateRyaIri, null);
return getMetadata(ryaStatement, dao);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
index a1c731a..24902e0 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/MergeToolTest.java
@@ -212,7 +212,7 @@ public class MergeToolTest {
// (1 updated row, 1 row left alone because it was unchanged, 1 row outside time range,
// 1 row deleted, 1 new row added, 1 modified visibility, 1 deleted by child, 1 added by child).
// There should be 5 rows in the child instance (4 which will be scanned over from the start time).
- ryaStatementUpdatedByChild.setObject(TestUtils.createRyaUri("football"));
+ ryaStatementUpdatedByChild.setObject(TestUtils.createRyaIri("football"));
ryaStatementUpdatedByChild.setTimestamp(TODAY.getTime());
ryaStatementVisibilityDifferent.setColumnVisibility(CHILD_COLUMN_VISIBILITY.getExpression());
childDao.add(ryaStatementOutOfTimeRange);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
index 6a6a53c..dae21f9 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/RulesetCopyIT.java
@@ -44,7 +44,7 @@ import org.apache.rya.accumulo.mr.merge.util.TestUtils;
import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.indexing.accumulo.ConfigUtils;
@@ -121,13 +121,13 @@ public class RulesetCopyIT {
QUERY_PREFIXES = sb.toString();
}
- private static RyaURI substitute(final String uri) {
+ private static RyaIRI substitute(final String uri) {
for (final String prefix : prefixes.keySet()) {
if (uri.startsWith(prefix)) {
- return new RyaURI(uri.replace(prefix, prefixes.get(prefix)));
+ return new RyaIRI(uri.replace(prefix, prefixes.get(prefix)));
}
}
- return new RyaURI(uri);
+ return new RyaIRI(uri);
}
private static RyaStatement statement(final String s, final String p, final RyaType o) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
index 6cc59f0..d456335 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/demo/MergeToolDemo.java
@@ -245,11 +245,11 @@ public class MergeToolDemo {
// Change statements that were updated by the parent or child after the start time.
final RyaStatement ryaStatementCase7Updated = TestUtils.copyRyaStatement(ryaStatementCase7);
- ryaStatementCase7Updated.setSubject(TestUtils.createRyaUri("c7 BOB"));
+ ryaStatementCase7Updated.setSubject(TestUtils.createRyaIri("c7 BOB"));
ryaStatementCase7Updated.setTimestamp(TODAY.getTime());
final RyaStatement ryaStatementCase8Updated = TestUtils.copyRyaStatement(ryaStatementCase8);
- ryaStatementCase8Updated.setSubject(TestUtils.createRyaUri("c8 SUSAN"));
+ ryaStatementCase8Updated.setSubject(TestUtils.createRyaIri("c8 SUSAN"));
ryaStatementCase8Updated.setTimestamp(TODAY.getTime());
final RyaStatement ryaStatementVisibilityDifferentUpdated = TestUtils.copyRyaStatement(ryaStatementVisibilityDifferent);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
index a42b561..bd61fc8 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/driver/MiniAccumuloClusterDriver.java
@@ -111,7 +111,7 @@ public class MiniAccumuloClusterDriver extends AccumuloDualInstanceDriver {
// (1 updated row, 1 row left alone because it was unchanged, 1 row outside time range,
// 1 row deleted, 1 new row added, 1 modified visibility, 1 deleted by child, 1 added by child).
// There should be 5 rows in the child instance (4 which will be scanned over from the start time).
- ryaStatementUpdatedByChild.setObject(TestUtils.createRyaUri("football"));
+ ryaStatementUpdatedByChild.setObject(TestUtils.createRyaIri("football"));
ryaStatementUpdatedByChild.setTimestamp(TODAY.getTime());
ryaStatementVisibilityDifferent.setColumnVisibility(CHILD_COLUMN_VISIBILITY.getExpression());
childStatements.add(ryaStatementOutOfTimeRange);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
index 3b4358b..23e35a2 100644
--- a/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
+++ b/extras/rya.merger/src/test/java/org/apache/rya/accumulo/mr/merge/util/TestUtils.java
@@ -26,7 +26,7 @@ import java.util.Date;
import org.apache.rya.accumulo.AccumuloRdfConfiguration;
import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
@@ -210,12 +210,12 @@ public final class TestUtils {
}
/**
- * Creates a {@link RyaURI} for the specified local name.
- * @param localName the URI's local name.
- * @return the {@link RyraURI}.
+ * Creates a {@link RyaIRI} for the specified local name.
+ * @param localName the IRI's local name.
+ * @return the {@link RyaIRI}.
*/
- public static RyaURI createRyaUri(final String localName) {
- return AccumuloRyaUtils.createRyaUri(NAMESPACE, localName);
+ public static RyaIRI createRyaIri(final String localName) {
+ return AccumuloRyaUtils.createRyaIri(NAMESPACE, localName);
}
/**
@@ -227,10 +227,10 @@ public final class TestUtils {
* @return the {@link RyaStatement}.
*/
public static RyaStatement createRyaStatement(final String subject, final String predicate, final String object, final Date date) {
- final RyaURI subjectUri = createRyaUri(subject);
- final RyaURI predicateUri = createRyaUri(predicate);
- final RyaURI objectUri = createRyaUri(object);
- final RyaStatement ryaStatement = new RyaStatement(subjectUri, predicateUri, objectUri);
+ final RyaIRI subjectIri = createRyaIri(subject);
+ final RyaIRI predicateIri = createRyaIri(predicate);
+ final RyaIRI objectIri = createRyaIri(object);
+ final RyaStatement ryaStatement = new RyaStatement(subjectIri, predicateIri, objectIri);
if (date != null) {
ryaStatement.setTimestamp(date.getTime());
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
index 731952a..220b7fa 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.api/src/main/java/org/apache/rya/indexing/pcj/fluo/api/CreateFluoPcj.java
@@ -41,7 +41,7 @@ import org.apache.rya.api.client.CreatePCJ.ExportStrategy;
import org.apache.rya.api.client.CreatePCJ.QueryType;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.persist.query.BatchRyaQuery;
import org.apache.rya.api.resolver.RdfToRyaConversions;
@@ -418,29 +418,29 @@ public class CreateFluoPcj {
final Value predVal = sp.getPredicateVar().getValue();
final Value objVal = sp.getObjectVar().getValue();
- RyaURI subjURI = null;
- RyaURI predURI = null;
+ RyaIRI subjIRI = null;
+ RyaIRI predIRI = null;
RyaType objType = null;
if(subjVal != null) {
if(!(subjVal instanceof Resource)) {
throw new AssertionError("Subject must be a Resource.");
}
- subjURI = RdfToRyaConversions.convertResource((Resource) subjVal);
+ subjIRI = RdfToRyaConversions.convertResource((Resource) subjVal);
}
if (predVal != null) {
if(!(predVal instanceof IRI)) {
- throw new AssertionError("Predicate must be a URI.");
+ throw new AssertionError("Predicate must be a IRI.");
}
- predURI = RdfToRyaConversions.convertURI((IRI) predVal);
+ predIRI = RdfToRyaConversions.convertIRI((IRI) predVal);
}
if (objVal != null ) {
objType = RdfToRyaConversions.convertValue(objVal);
}
- return new RyaStatement(subjURI, predURI, objType);
+ return new RyaStatement(subjIRI, predIRI, objType);
}
private String[] getAuths(final Connector accumulo) {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
index fbf95fc..8196955 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjection.java
@@ -27,7 +27,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
@@ -205,8 +205,8 @@ public class ConstructProjection {
Preconditions.checkArgument(subj instanceof Resource);
Preconditions.checkArgument(pred instanceof IRI);
- RyaURI subjType = RdfToRyaConversions.convertResource((Resource) subj);
- RyaURI predType = RdfToRyaConversions.convertURI((IRI) pred);
+ RyaIRI subjType = RdfToRyaConversions.convertResource((Resource) subj);
+ RyaIRI predType = RdfToRyaConversions.convertIRI((IRI) pred);
RyaType objectType = RdfToRyaConversions.convertValue(obj);
RyaStatement statement = new RyaStatement(subjType, predType, objectType);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
index c52a72a..e70993a 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTest.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
@@ -61,8 +61,8 @@ public class ConstructGraphTest {
VisibilityBindingSet vBs = new VisibilityBindingSet(bs,"FOUO");
Set<RyaStatement> statements = graph.createGraphFromBindingSet(vBs);
- RyaStatement statement1 = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"), new RyaURI("uri:Bob"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("uri:Bob"), new RyaURI("uri:worksAt"), new RyaURI("uri:BurgerShack"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"), new RyaIRI("uri:Bob"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("uri:Bob"), new RyaIRI("uri:worksAt"), new RyaIRI("uri:BurgerShack"));
Set<RyaStatement> expected = Sets.newHashSet(Arrays.asList(statement1, statement2));
expected.forEach(x-> x.setColumnVisibility("FOUO".getBytes()));
ConstructGraphTestUtils.ryaStatementSetsEqualIgnoresTimestamp(expected, statements);
@@ -84,18 +84,18 @@ public class ConstructGraphTest {
Set<RyaStatement> statements = graph.createGraphFromBindingSet(vBs);
Set<RyaStatement> statements2 = graph.createGraphFromBindingSet(vBs);
- RyaURI subject = null;
+ RyaIRI subject = null;
for(RyaStatement statement: statements) {
- RyaURI subjURI = statement.getSubject();
+ RyaIRI subjURI = statement.getSubject();
if(subject == null) {
subject = subjURI;
} else {
assertEquals(subjURI, subject);
}
}
- RyaURI subject2 = null;
+ RyaIRI subject2 = null;
for(RyaStatement statement: statements2) {
- RyaURI subjURI = statement.getSubject();
+ RyaIRI subjURI = statement.getSubject();
if(subject2 == null) {
subject2 = subjURI;
} else {
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
index d505b33..ac21cdf 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructGraphTestUtils.java
@@ -25,7 +25,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.eclipse.rdf4j.model.Statement;
import org.junit.Assert;
@@ -61,7 +61,7 @@ public class ConstructGraphTestUtils {
}
public static void ryaStatementsEqualIgnoresBlankNode(Set<RyaStatement> statements1, Set<RyaStatement> statements2) {
- Map<String, RyaURI> bNodeMap = new HashMap<>();
+ Map<String, RyaIRI> bNodeMap = new HashMap<>();
statements1.forEach(x-> bNodeMap.put(x.getPredicate().getData(), x.getSubject()));
statements2.forEach(x -> x.setSubject(bNodeMap.get(x.getPredicate().getData())));
ryaStatementSetsEqualIgnoresTimestamp(statements1, statements2);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
index f884b7b..a541575 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/ConstructProjectionTest.java
@@ -27,7 +27,7 @@ import java.util.List;
import java.util.Map;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.domain.VarNameUtils;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.api.resolver.RdfToRyaConversions;
@@ -60,7 +60,7 @@ public class ConstructProjectionTest {
VisibilityBindingSet vBs = new VisibilityBindingSet(bs, "FOUO");
RyaStatement statement = projection.projectBindingSet(vBs, new HashMap<>());
- RyaStatement expected = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:talksTo"), new RyaURI("uri:Bob"));
+ RyaStatement expected = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:talksTo"), new RyaIRI("uri:Bob"));
expected.setColumnVisibility("FOUO".getBytes("UTF-8"));
expected.setTimestamp(statement.getTimestamp());
@@ -81,7 +81,7 @@ public class ConstructProjectionTest {
VisibilityBindingSet vBs = new VisibilityBindingSet(bs);
RyaStatement statement = projection.projectBindingSet(vBs, new HashMap<>());
- RyaStatement expected = new RyaStatement(new RyaURI("uri:Joe"), new RyaURI("uri:worksWith"), new RyaURI("uri:Bob"));
+ RyaStatement expected = new RyaStatement(new RyaIRI("uri:Joe"), new RyaIRI("uri:worksWith"), new RyaIRI("uri:Bob"));
expected.setTimestamp(statement.getTimestamp());
expected.setColumnVisibility(new byte[0]);
@@ -105,7 +105,7 @@ public class ConstructProjectionTest {
bNodeMap.put(VarNameUtils.prependAnonymous("1"), bNode);
RyaStatement statement = projection.projectBindingSet(vBs,bNodeMap);
- RyaStatement expected = new RyaStatement(RdfToRyaConversions.convertResource(bNode), new RyaURI("uri:talksTo"), new RyaURI("uri:Bob"));
+ RyaStatement expected = new RyaStatement(RdfToRyaConversions.convertResource(bNode), new RyaIRI("uri:talksTo"), new RyaIRI("uri:Bob"));
expected.setTimestamp(statement.getTimestamp());
expected.setColumnVisibility(new byte[0]);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
index 9a9feef..d19883b 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/RyaSubGraphKafkaSerDeTest.java
@@ -25,7 +25,7 @@ import java.util.UUID;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.pcj.fluo.app.export.kafka.RyaSubGraphKafkaSerDe;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.junit.Test;
@@ -37,8 +37,8 @@ public class RyaSubGraphKafkaSerDeTest {
@Test
public void serializationTestWithURI() {
RyaSubGraph bundle = new RyaSubGraph(UUID.randomUUID().toString());
- bundle.addStatement(new RyaStatement(new RyaURI("uri:123"), new RyaURI("uri:234"), new RyaURI("uri:345")));
- bundle.addStatement(new RyaStatement(new RyaURI("uri:345"), new RyaURI("uri:567"), new RyaURI("uri:789")));
+ bundle.addStatement(new RyaStatement(new RyaIRI("uri:123"), new RyaIRI("uri:234"), new RyaIRI("uri:345")));
+ bundle.addStatement(new RyaStatement(new RyaIRI("uri:345"), new RyaIRI("uri:567"), new RyaIRI("uri:789")));
byte[] bundleBytes = serializer.toBytes(bundle);
RyaSubGraph deserializedBundle = serializer.fromBytes(bundleBytes);
assertEquals(bundle, deserializedBundle);
@@ -48,8 +48,8 @@ public class RyaSubGraphKafkaSerDeTest {
@Test
public void serializationTestWithLiteral() {
RyaSubGraph bundle = new RyaSubGraph(UUID.randomUUID().toString());
- bundle.addStatement(new RyaStatement(new RyaURI("uri:123"), new RyaURI("uri:234"), new RyaType(XMLSchema.INTEGER, "345")));
- bundle.addStatement(new RyaStatement(new RyaURI("uri:345"), new RyaURI("uri:567"), new RyaType(XMLSchema.INTEGER, "789")));
+ bundle.addStatement(new RyaStatement(new RyaIRI("uri:123"), new RyaIRI("uri:234"), new RyaType(XMLSchema.INTEGER, "345")));
+ bundle.addStatement(new RyaStatement(new RyaIRI("uri:345"), new RyaIRI("uri:567"), new RyaType(XMLSchema.INTEGER, "789")));
byte[] bundleBytes = serializer.toBytes(bundle);
RyaSubGraph deserializedBundle = serializer.fromBytes(bundleBytes);
assertEquals(bundle, deserializedBundle);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
index 8ef6db3..b12dc9e 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.demo/src/main/java/org/apache/rya/indexing/pcj/fluo/demo/FluoAndHistoricPcjsDemo.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.persist.RyaDAOException;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.apache.rya.api.utils.CloseableIterator;
@@ -61,38 +61,38 @@ public class FluoAndHistoricPcjsDemo implements Demo {
private static final Logger log = Logger.getLogger(FluoAndHistoricPcjsDemo.class);
// Employees
- private static final RyaURI alice = new RyaURI("http://Alice");
- private static final RyaURI bob = new RyaURI("http://Bob");
- private static final RyaURI charlie = new RyaURI("http://Charlie");
- private static final RyaURI frank = new RyaURI("http://Frank");
+ private static final RyaIRI alice = new RyaIRI("http://Alice");
+ private static final RyaIRI bob = new RyaIRI("http://Bob");
+ private static final RyaIRI charlie = new RyaIRI("http://Charlie");
+ private static final RyaIRI frank = new RyaIRI("http://Frank");
// Patrons
- private static final RyaURI david = new RyaURI("http://David");
- private static final RyaURI eve = new RyaURI("http://Eve");
- private static final RyaURI george = new RyaURI("http://George");
+ private static final RyaIRI david = new RyaIRI("http://David");
+ private static final RyaIRI eve = new RyaIRI("http://Eve");
+ private static final RyaIRI george = new RyaIRI("http://George");
// Other People
- private static final RyaURI henry = new RyaURI("http://Henry");
- private static final RyaURI irene = new RyaURI("http://Irene");
- private static final RyaURI justin = new RyaURI("http://Justin");
- private static final RyaURI kristi = new RyaURI("http://Kristi");
- private static final RyaURI luke = new RyaURI("http://Luke");
- private static final RyaURI manny = new RyaURI("http://Manny");
- private static final RyaURI nate = new RyaURI("http://Nate");
- private static final RyaURI olivia = new RyaURI("http://Olivia");
- private static final RyaURI paul = new RyaURI("http://Paul");
- private static final RyaURI ross = new RyaURI("http://Ross");
- private static final RyaURI sally = new RyaURI("http://Sally");
- private static final RyaURI tim = new RyaURI("http://Tim");
+ private static final RyaIRI henry = new RyaIRI("http://Henry");
+ private static final RyaIRI irene = new RyaIRI("http://Irene");
+ private static final RyaIRI justin = new RyaIRI("http://Justin");
+ private static final RyaIRI kristi = new RyaIRI("http://Kristi");
+ private static final RyaIRI luke = new RyaIRI("http://Luke");
+ private static final RyaIRI manny = new RyaIRI("http://Manny");
+ private static final RyaIRI nate = new RyaIRI("http://Nate");
+ private static final RyaIRI olivia = new RyaIRI("http://Olivia");
+ private static final RyaIRI paul = new RyaIRI("http://Paul");
+ private static final RyaIRI ross = new RyaIRI("http://Ross");
+ private static final RyaIRI sally = new RyaIRI("http://Sally");
+ private static final RyaIRI tim = new RyaIRI("http://Tim");
// Places
- private static final RyaURI coffeeShop = new RyaURI("http://CoffeeShop");
- private static final RyaURI burgerShop = new RyaURI("http://BurgerShop");
- private static final RyaURI cupcakeShop= new RyaURI("http://cupcakeShop");
+ private static final RyaIRI coffeeShop = new RyaIRI("http://CoffeeShop");
+ private static final RyaIRI burgerShop = new RyaIRI("http://BurgerShop");
+ private static final RyaIRI cupcakeShop= new RyaIRI("http://cupcakeShop");
// Verbs
- private static final RyaURI talksTo = new RyaURI("http://talksTo");
- private static final RyaURI worksAt = new RyaURI("http://worksAt");
+ private static final RyaIRI talksTo = new RyaIRI("http://talksTo");
+ private static final RyaIRI worksAt = new RyaIRI("http://worksAt");
/**
* Used to pause the demo waiting for the presenter to hit the Enter key.
@@ -292,8 +292,8 @@ public class FluoAndHistoricPcjsDemo implements Demo {
}
private static String prettyFormat(final RyaStatement statement) {
- final RyaURI s = statement.getSubject();
- final RyaURI p = statement.getPredicate();
+ final RyaIRI s = statement.getSubject();
+ final RyaIRI p = statement.getPredicate();
final RyaType o = statement.getObject();
return "<" + s.getData() + "> <"+ p.getData() + "> <" + o.getData() + ">";
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
index ca00934..0f15a5d 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/ConstructGraphTestUtils.java
@@ -25,7 +25,7 @@ import java.util.Set;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RyaToRdfConversions;
import org.eclipse.rdf4j.model.Statement;
import org.junit.Assert;
@@ -72,7 +72,7 @@ public class ConstructGraphTestUtils {
}
public static void ryaStatementsEqualIgnoresBlankNode(Set<RyaStatement> statements1, Set<RyaStatement> statements2) {
- Map<String, RyaURI> bNodeMap = new HashMap<>();
+ Map<String, RyaIRI> bNodeMap = new HashMap<>();
statements1.forEach(x-> bNodeMap.put(x.getPredicate().getData(), x.getSubject()));
statements2.forEach(x -> x.setSubject(bNodeMap.get(x.getPredicate().getData())));
ryaStatementSetsEqualIgnoresTimestamp(statements1, statements2);
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/CountStatementsIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/CountStatementsIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/CountStatementsIT.java
index cb34d06..6ca87e5 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/CountStatementsIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/CountStatementsIT.java
@@ -28,7 +28,7 @@ import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.fluo.api.config.ObserverSpecification;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.pcj.fluo.test.base.RyaExportITBase;
import org.junit.Test;
@@ -56,11 +56,11 @@ public class CountStatementsIT extends RyaExportITBase {
public void countStatements() {
// Insert some Triples into the Fluo app.
final List<RyaStatement> triples = new ArrayList<>();
- triples.add( RyaStatement.builder().setSubject(new RyaURI("http://Alice")).setPredicate(new RyaURI("http://talksTo")).setObject(new RyaURI("http://Bob")).build() );
- triples.add( RyaStatement.builder().setSubject(new RyaURI("http://Bob")).setPredicate(new RyaURI("http://talksTo")).setObject(new RyaURI("http://Alice")).build() );
- triples.add( RyaStatement.builder().setSubject(new RyaURI("http://Charlie")).setPredicate(new RyaURI("http://talksTo")).setObject(new RyaURI("http://Bob")).build() );
- triples.add( RyaStatement.builder().setSubject(new RyaURI("http://David")).setPredicate(new RyaURI("http://talksTo")).setObject(new RyaURI("http://Bob")).build() );
- triples.add( RyaStatement.builder().setSubject(new RyaURI("http://Eve")).setPredicate(new RyaURI("http://talksTo")).setObject(new RyaURI("http://Bob")).build() );
+ triples.add( RyaStatement.builder().setSubject(new RyaIRI("http://Alice")).setPredicate(new RyaIRI("http://talksTo")).setObject(new RyaIRI("http://Bob")).build() );
+ triples.add( RyaStatement.builder().setSubject(new RyaIRI("http://Bob")).setPredicate(new RyaIRI("http://talksTo")).setObject(new RyaIRI("http://Alice")).build() );
+ triples.add( RyaStatement.builder().setSubject(new RyaIRI("http://Charlie")).setPredicate(new RyaIRI("http://talksTo")).setObject(new RyaIRI("http://Bob")).build() );
+ triples.add( RyaStatement.builder().setSubject(new RyaIRI("http://David")).setPredicate(new RyaIRI("http://talksTo")).setObject(new RyaIRI("http://Bob")).build() );
+ triples.add( RyaStatement.builder().setSubject(new RyaIRI("http://Eve")).setPredicate(new RyaIRI("http://talksTo")).setObject(new RyaIRI("http://Bob")).build() );
try(FluoClient fluoClient = FluoFactory.newClient(super.getFluoConfiguration())) {
new InsertTriples().insert(fluoClient, triples, Optional.<String>absent());
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetQueryReportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetQueryReportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetQueryReportIT.java
index c0f0f16..9b82fe6 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetQueryReportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/api/GetQueryReportIT.java
@@ -30,7 +30,7 @@ import org.apache.accumulo.core.client.Connector;
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.pcj.fluo.api.GetQueryReport.QueryReport;
import org.apache.rya.indexing.pcj.fluo.app.query.FluoQuery;
import org.apache.rya.indexing.pcj.fluo.app.query.StatementPatternMetadata;
@@ -60,22 +60,22 @@ public class GetQueryReportIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://worksAt"), new RyaURI("http://Taco Shop")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://worksAt"), new RyaURI("http://Burger Join")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://worksAt"), new RyaURI("http://Pastery Shop")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://livesIn"), new RyaURI("http://Lost County")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://livesIn"), new RyaURI("http://Big City")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://livesIn"), new RyaURI("http://Big City")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://livesIn"), new RyaURI("http://Big City")),
- new RyaStatement(new RyaURI("http://David"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://David"), new RyaURI("http://livesIn"), new RyaURI("http://Lost County")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://livesIn"), new RyaURI("http://Big City")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://worksAt"), new RyaURI("http://Burrito Place")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://livesIn"), new RyaURI("http://Lost County")));
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://worksAt"), new RyaIRI("http://Taco Shop")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burger Join")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://worksAt"), new RyaIRI("http://Pastery Shop")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://livesIn"), new RyaIRI("http://Lost County")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://livesIn"), new RyaIRI("http://Big City")),
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://livesIn"), new RyaIRI("http://Big City")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://livesIn"), new RyaIRI("http://Big City")),
+ new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://livesIn"), new RyaIRI("http://Lost County")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://livesIn"), new RyaIRI("http://Big City")),
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://worksAt"), new RyaIRI("http://Burrito Place")),
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://livesIn"), new RyaIRI("http://Lost County")));
// Create the PCJ table.
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
index 8ebc9fc..63c7bbe 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/BatchIT.java
@@ -38,7 +38,7 @@ import org.apache.fluo.api.data.Span;
import org.apache.fluo.core.client.FluoClientImpl;
import org.apache.log4j.Logger;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.function.join.LazyJoiningIterator.Side;
import org.apache.rya.api.model.VisibilityBindingSet;
import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
@@ -82,9 +82,9 @@ public class BatchIT extends RyaExportITBase {
+ " <urn:predicate_2> ?object2 } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj = new RyaURI("urn:subject_1");
- RyaStatement statement1 = new RyaStatement(subj, new RyaURI("urn:predicate_1"), null);
- RyaStatement statement2 = new RyaStatement(subj, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj = new RyaIRI("urn:subject_1");
+ RyaStatement statement1 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
+ RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
Set<RyaStatement> statements1 = getRyaStatements(statement1, 10);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 10);
@@ -122,9 +122,9 @@ public class BatchIT extends RyaExportITBase {
+ " <urn:predicate_2> ?object2 } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj = new RyaURI("urn:subject_1");
- RyaStatement statement1 = new RyaStatement(subj, new RyaURI("urn:predicate_1"), null);
- RyaStatement statement2 = new RyaStatement(subj, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj = new RyaIRI("urn:subject_1");
+ RyaStatement statement1 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
+ RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
Set<RyaStatement> statements1 = getRyaStatements(statement1, 5);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 5);
@@ -174,8 +174,8 @@ public class BatchIT extends RyaExportITBase {
+ " <urn:predicate_2> ?object2 } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj = new RyaURI("urn:subject_1");
- RyaStatement statement2 = new RyaStatement(subj, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj = new RyaIRI("urn:subject_1");
+ RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 5);
// Create the PCJ table.
@@ -222,9 +222,9 @@ public class BatchIT extends RyaExportITBase {
+ " <urn:predicate_2> ?object2 } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj = new RyaURI("urn:subject_1");
- RyaStatement statement1 = new RyaStatement(subj, new RyaURI("urn:predicate_1"), null);
- RyaStatement statement2 = new RyaStatement(subj, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj = new RyaIRI("urn:subject_1");
+ RyaStatement statement1 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
+ RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
Set<RyaStatement> statements1 = getRyaStatements(statement1, 15);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 15);
@@ -256,12 +256,12 @@ public class BatchIT extends RyaExportITBase {
+ "OPTIONAL{ ?subject <urn:predicate_2> ?object2} } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj = new RyaURI("urn:subject_1");
- RyaStatement statement1 = new RyaStatement(subj, new RyaURI("urn:predicate_1"), null);
- RyaStatement statement2 = new RyaStatement(subj, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj = new RyaIRI("urn:subject_1");
+ RyaStatement statement1 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
+ RyaStatement statement2 = new RyaStatement(subj, new RyaIRI("urn:predicate_2"), null);
- subj = new RyaURI("urn:subject_2");
- RyaStatement statement3 = new RyaStatement(subj, new RyaURI("urn:predicate_1"), null);
+ subj = new RyaIRI("urn:subject_2");
+ RyaStatement statement3 = new RyaStatement(subj, new RyaIRI("urn:predicate_1"), null);
Set<RyaStatement> statements1 = getRyaStatements(statement1, 10);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 10);
@@ -295,15 +295,15 @@ public class BatchIT extends RyaExportITBase {
+ " <urn:predicate_2> ?object2 ." + " ?subject2 <urn:predicate_3> ?object2 } ";
try (FluoClient fluoClient = new FluoClientImpl(getFluoConfiguration())) {
- RyaURI subj1 = new RyaURI("urn:subject_1");
- RyaStatement statement1 = new RyaStatement(subj1, new RyaURI("urn:predicate_1"), null);
- RyaStatement statement2 = new RyaStatement(subj1, new RyaURI("urn:predicate_2"), null);
+ RyaIRI subj1 = new RyaIRI("urn:subject_1");
+ RyaStatement statement1 = new RyaStatement(subj1, new RyaIRI("urn:predicate_1"), null);
+ RyaStatement statement2 = new RyaStatement(subj1, new RyaIRI("urn:predicate_2"), null);
Set<RyaStatement> statements1 = getRyaStatements(statement1, 10);
Set<RyaStatement> statements2 = getRyaStatements(statement2, 10);
- RyaURI subj2 = new RyaURI("urn:subject_2");
- RyaStatement statement3 = new RyaStatement(subj2, new RyaURI("urn:predicate_3"), null);
+ RyaIRI subj2 = new RyaIRI("urn:subject_2");
+ RyaStatement statement3 = new RyaStatement(subj2, new RyaIRI("urn:predicate_3"), null);
Set<RyaStatement> statements3 = getRyaStatements(statement3, 10);
// Create the PCJ table.
@@ -338,13 +338,13 @@ public class BatchIT extends RyaExportITBase {
for (int i = 0; i < numTriples; i++) {
RyaStatement stmnt = new RyaStatement(statement.getSubject(), statement.getPredicate(), statement.getObject());
if (stmnt.getSubject() == null) {
- stmnt.setSubject(new RyaURI(subject + i));
+ stmnt.setSubject(new RyaIRI(subject + i));
}
if (stmnt.getPredicate() == null) {
- stmnt.setPredicate(new RyaURI(predicate + i));
+ stmnt.setPredicate(new RyaIRI(predicate + i));
}
if (stmnt.getObject() == null) {
- stmnt.setObject(new RyaURI(object + i));
+ stmnt.setObject(new RyaIRI(object + i));
}
statements.add(stmnt);
}
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
index ff2dc28..56fc7df 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/InputIT.java
@@ -28,7 +28,7 @@ import org.apache.accumulo.core.client.Connector;
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
@@ -132,16 +132,16 @@ public class InputIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://helps"), new RyaURI("http://Kevin")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://helps"), new RyaIRI("http://Kevin")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://David"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")));
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")));
// The expected results of the SPARQL query once the PCJ has been computed.
final ValueFactory vf = SimpleValueFactory.getInstance();
@@ -211,8 +211,8 @@ public class InputIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")));
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")));
// Load the historic data into Rya.
final SailRepositoryConnection ryaConn = super.getRyaSailRepository().getConnection();
@@ -293,8 +293,8 @@ public class InputIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")));
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")));
// The expected final result.
final Set<BindingSet> expected = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
index 309d1ca..990a69c 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaRyaSubGraphExportIT.java
@@ -43,7 +43,7 @@ import org.apache.rya.accumulo.AccumuloRyaDAO;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaSubGraph;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.RdfToRyaConversions;
import org.apache.rya.indexing.pcj.fluo.ConstructGraphTestUtils;
import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
@@ -128,8 +128,8 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
final Set<RyaSubGraph> expectedResults = new HashSet<>();
RyaSubGraph subGraph = new RyaSubGraph(pcjId);
- RyaStatement statement1 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:travelsTo"), new RyaURI("urn:London"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Bob"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:London"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Bob"));
// if no visibility indicated, then visibilities set to empty byte in
// Fluo - they are null by default in RyaStatement
// need to set visibility to empty byte so that RyaStatement's equals
@@ -151,9 +151,9 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
+ "?customer <urn:talksTo> ?worker. " + "?worker <urn:livesIn> ?city. " + "?worker <urn:worksAt> <urn:burgerShack>. " + "}";
// Create the Statements that will be loaded into Rya.
- RyaStatement statement1 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:talksTo"), new RyaURI("urn:Bob"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:livesIn"), new RyaURI("urn:London"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:worksAt"), new RyaURI("urn:burgerShack"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:talksTo"), new RyaIRI("urn:Bob"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:livesIn"), new RyaIRI("urn:London"));
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:worksAt"), new RyaIRI("urn:burgerShack"));
statement1.setColumnVisibility("U&W".getBytes("UTF-8"));
statement2.setColumnVisibility("V".getBytes("UTF-8"));
statement3.setColumnVisibility("W".getBytes("UTF-8"));
@@ -167,8 +167,8 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
// computed.
final Set<RyaSubGraph> expectedResults = new HashSet<>();
RyaSubGraph subGraph = new RyaSubGraph(pcjId);
- RyaStatement statement4 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:travelsTo"), new RyaURI("urn:London"));
- RyaStatement statement5 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Bob"));
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:London"));
+ RyaStatement statement5 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Bob"));
// if no visibility indicated, then visibilities set to empty byte in
// Fluo - they are null by default in RyaStatement
// need to set visibility to empty byte so that RyaStatement's equals
@@ -191,12 +191,12 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
+ "?customer <urn:talksTo> ?worker. " + "?worker <urn:livesIn> ?city. " + "?worker <urn:worksAt> <urn:burgerShack>. " + "}";
// Create the Statements that will be loaded into Rya.
- RyaStatement statement1 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:talksTo"), new RyaURI("urn:Bob"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:livesIn"), new RyaURI("urn:London"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:worksAt"), new RyaURI("urn:burgerShack"));
- RyaStatement statement4 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:talksTo"), new RyaURI("urn:Evan"));
- RyaStatement statement5 = new RyaStatement(new RyaURI("urn:Evan"), new RyaURI("urn:livesIn"), new RyaURI("urn:SanFrancisco"));
- RyaStatement statement6 = new RyaStatement(new RyaURI("urn:Evan"), new RyaURI("urn:worksAt"), new RyaURI("urn:burgerShack"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:talksTo"), new RyaIRI("urn:Bob"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:livesIn"), new RyaIRI("urn:London"));
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:worksAt"), new RyaIRI("urn:burgerShack"));
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:talksTo"), new RyaIRI("urn:Evan"));
+ RyaStatement statement5 = new RyaStatement(new RyaIRI("urn:Evan"), new RyaIRI("urn:livesIn"), new RyaIRI("urn:SanFrancisco"));
+ RyaStatement statement6 = new RyaStatement(new RyaIRI("urn:Evan"), new RyaIRI("urn:worksAt"), new RyaIRI("urn:burgerShack"));
statement1.setColumnVisibility("U&W".getBytes("UTF-8"));
statement2.setColumnVisibility("V".getBytes("UTF-8"));
statement3.setColumnVisibility("W".getBytes("UTF-8"));
@@ -211,10 +211,10 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
final Set<RyaSubGraph> results = readAllResults(pcjId);
// Create the expected results of the SPARQL query once the PCJ has been
// computed.
- RyaStatement statement7 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:travelsTo"), new RyaURI("urn:London"));
- RyaStatement statement8 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Bob"));
- RyaStatement statement9 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:travelsTo"), new RyaURI("urn:SanFrancisco"));
- RyaStatement statement10 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Evan"));
+ RyaStatement statement7 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:London"));
+ RyaStatement statement8 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Bob"));
+ RyaStatement statement9 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:SanFrancisco"));
+ RyaStatement statement10 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Evan"));
statement7.setColumnVisibility("U&V&W".getBytes("UTF-8"));
statement8.setColumnVisibility("U&V&W".getBytes("UTF-8"));
statement9.setColumnVisibility("A&B&C".getBytes("UTF-8"));
@@ -242,12 +242,12 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
+ "?customer <urn:talksTo> ?worker. " + "?worker <urn:livesIn> ?city. " + "?worker <urn:worksAt> <urn:burgerShack>. " + "}";
// Create the Statements that will be loaded into Rya.
- RyaStatement statement1 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:talksTo"), new RyaURI("urn:Bob"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:livesIn"), new RyaURI("urn:London"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("urn:Bob"), new RyaURI("urn:worksAt"), new RyaURI("urn:burgerShack"));
- RyaStatement statement4 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:talksTo"), new RyaURI("urn:Evan"));
- RyaStatement statement5 = new RyaStatement(new RyaURI("urn:Evan"), new RyaURI("urn:livesIn"), new RyaURI("urn:SanFrancisco"));
- RyaStatement statement6 = new RyaStatement(new RyaURI("urn:Evan"), new RyaURI("urn:worksAt"), new RyaURI("urn:burgerShack"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:talksTo"), new RyaIRI("urn:Bob"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:livesIn"), new RyaIRI("urn:London"));
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("urn:Bob"), new RyaIRI("urn:worksAt"), new RyaIRI("urn:burgerShack"));
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:talksTo"), new RyaIRI("urn:Evan"));
+ RyaStatement statement5 = new RyaStatement(new RyaIRI("urn:Evan"), new RyaIRI("urn:livesIn"), new RyaIRI("urn:SanFrancisco"));
+ RyaStatement statement6 = new RyaStatement(new RyaIRI("urn:Evan"), new RyaIRI("urn:worksAt"), new RyaIRI("urn:burgerShack"));
statement1.setColumnVisibility("U&W".getBytes("UTF-8"));
statement2.setColumnVisibility("V".getBytes("UTF-8"));
statement3.setColumnVisibility("W".getBytes("UTF-8"));
@@ -262,10 +262,10 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
final Set<RyaSubGraph> results = readAllResults(pcjId);
// Create the expected results of the SPARQL query once the PCJ has been
// computed.
- RyaStatement statement7 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:travelsTo"), new RyaURI("urn:London"));
- RyaStatement statement8 = new RyaStatement(new RyaURI("urn:Joe"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Bob"));
- RyaStatement statement9 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:travelsTo"), new RyaURI("urn:SanFrancisco"));
- RyaStatement statement10 = new RyaStatement(new RyaURI("urn:John"), new RyaURI("urn:friendsWith"), new RyaURI("urn:Evan"));
+ RyaStatement statement7 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:London"));
+ RyaStatement statement8 = new RyaStatement(new RyaIRI("urn:Joe"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Bob"));
+ RyaStatement statement9 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:travelsTo"), new RyaIRI("urn:SanFrancisco"));
+ RyaStatement statement10 = new RyaStatement(new RyaIRI("urn:John"), new RyaIRI("urn:friendsWith"), new RyaIRI("urn:Evan"));
statement7.setColumnVisibility("U&V&W".getBytes("UTF-8"));
statement8.setColumnVisibility("U&V&W".getBytes("UTF-8"));
statement9.setColumnVisibility("A&B&C".getBytes("UTF-8"));
@@ -331,14 +331,14 @@ public class KafkaRyaSubGraphExportIT extends KafkaExportITBase {
// Verify the end results of the query match the expected results.
final Set<RyaSubGraph> results = readAllResults(pcjId);
- RyaStatement statement1 = new RyaStatement(new RyaURI("urn:obs1"), new RyaURI("urn:hasCount"), new RyaType(XMLSchema.INTEGER, "2"));
- RyaStatement statement2 = new RyaStatement(new RyaURI("urn:obs1"), new RyaURI("urn:hasAverageVelocity"), new RyaType(XMLSchema.DECIMAL, "84"));
- RyaStatement statement3 = new RyaStatement(new RyaURI("urn:obs1"), new RyaURI("urn:hasLocation"), new RyaType("Rosslyn"));
- RyaStatement statement4 = new RyaStatement(new RyaURI("urn:obs1"), new RyaURI(RDF.TYPE.toString()), new RyaURI("urn:highSpeedTrafficArea"));
- RyaStatement statement5 = new RyaStatement(new RyaURI("urn:obs2"), new RyaURI("urn:hasCount"), new RyaType(XMLSchema.INTEGER, "2"));
- RyaStatement statement6 = new RyaStatement(new RyaURI("urn:obs2"), new RyaURI("urn:hasAverageVelocity"), new RyaType(XMLSchema.DECIMAL, "79"));
- RyaStatement statement7 = new RyaStatement(new RyaURI("urn:obs2"), new RyaURI("urn:hasLocation"), new RyaType("OldTown"));
- RyaStatement statement8 = new RyaStatement(new RyaURI("urn:obs2"), new RyaURI(RDF.TYPE.toString()), new RyaURI("urn:highSpeedTrafficArea"));
+ RyaStatement statement1 = new RyaStatement(new RyaIRI("urn:obs1"), new RyaIRI("urn:hasCount"), new RyaType(XMLSchema.INTEGER, "2"));
+ RyaStatement statement2 = new RyaStatement(new RyaIRI("urn:obs1"), new RyaIRI("urn:hasAverageVelocity"), new RyaType(XMLSchema.DECIMAL, "84"));
+ RyaStatement statement3 = new RyaStatement(new RyaIRI("urn:obs1"), new RyaIRI("urn:hasLocation"), new RyaType("Rosslyn"));
+ RyaStatement statement4 = new RyaStatement(new RyaIRI("urn:obs1"), new RyaIRI(RDF.TYPE.toString()), new RyaIRI("urn:highSpeedTrafficArea"));
+ RyaStatement statement5 = new RyaStatement(new RyaIRI("urn:obs2"), new RyaIRI("urn:hasCount"), new RyaType(XMLSchema.INTEGER, "2"));
+ RyaStatement statement6 = new RyaStatement(new RyaIRI("urn:obs2"), new RyaIRI("urn:hasAverageVelocity"), new RyaType(XMLSchema.DECIMAL, "79"));
+ RyaStatement statement7 = new RyaStatement(new RyaIRI("urn:obs2"), new RyaIRI("urn:hasLocation"), new RyaType("OldTown"));
+ RyaStatement statement8 = new RyaStatement(new RyaIRI("urn:obs2"), new RyaIRI(RDF.TYPE.toString()), new RyaIRI("urn:highSpeedTrafficArea"));
final Set<RyaSubGraph> expectedResults = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
index eabcd57..912f787 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/RyaExportIT.java
@@ -27,7 +27,7 @@ import org.apache.accumulo.core.client.Connector;
import org.apache.fluo.api.client.FluoClient;
import org.apache.fluo.api.client.FluoFactory;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.indexing.pcj.fluo.api.CreateFluoPcj;
import org.apache.rya.indexing.pcj.fluo.api.InsertTriples;
import org.apache.rya.indexing.pcj.storage.PrecomputedJoinStorage;
@@ -62,25 +62,25 @@ public class RyaExportIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final ValueFactory vf = SimpleValueFactory.getInstance();
final Set<RyaStatement> streamedTriples = Sets.newHashSet(
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Bob")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://livesIn"), new RyaURI("http://London")),
- new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://Bob")),
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://livesIn"), new RyaIRI("http://London")),
+ new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Charlie")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://livesIn"), new RyaURI("http://London")),
- new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://Charlie")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://livesIn"), new RyaIRI("http://London")),
+ new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://David")),
- new RyaStatement(new RyaURI("http://David"), new RyaURI("http://livesIn"), new RyaURI("http://London")),
- new RyaStatement(new RyaURI("http://David"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://David")),
+ new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://livesIn"), new RyaIRI("http://London")),
+ new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"), new RyaURI("http://Eve")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://livesIn"), new RyaURI("http://Leeds")),
- new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")),
+ new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"), new RyaIRI("http://Eve")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://livesIn"), new RyaIRI("http://Leeds")),
+ new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://talksTo"), new RyaURI("http://Alice")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://livesIn"), new RyaURI("http://London")),
- new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://worksAt"), new RyaURI("http://Chipotle")));
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://talksTo"), new RyaIRI("http://Alice")),
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://livesIn"), new RyaIRI("http://London")),
+ new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://worksAt"), new RyaIRI("http://Chipotle")));
// The expected results of the SPARQL query once the PCJ has been computed.
final Set<BindingSet> expected = new HashSet<>();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
----------------------------------------------------------------------
diff --git a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
index 60df148..bb89995 100644
--- a/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
+++ b/extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/visibility/PcjVisibilityIT.java
@@ -46,7 +46,7 @@ import org.apache.rya.api.RdfCloudTripleStoreConfiguration;
import org.apache.rya.api.client.RyaClient;
import org.apache.rya.api.client.accumulo.AccumuloRyaClientFactory;
import org.apache.rya.api.domain.RyaStatement;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.utils.CloseableIterator;
import org.apache.rya.indexing.accumulo.ConfigUtils;
import org.apache.rya.indexing.external.PrecomputedJoinIndexerConfig;
@@ -191,25 +191,25 @@ public class PcjVisibilityIT extends RyaExportITBase {
// Triples that will be streamed into Fluo after the PCJ has been created.
final Map<RyaStatement, String> streamedTriples = new HashMap<>();
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"),new RyaURI("http://Bob")), "A&B");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://livesIn"),new RyaURI("http://London")), "A");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Bob"), new RyaURI("http://worksAt"),new RyaURI("http://Chipotle")), "B");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"),new RyaIRI("http://Bob")), "A&B");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://livesIn"),new RyaIRI("http://London")), "A");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Bob"), new RyaIRI("http://worksAt"),new RyaIRI("http://Chipotle")), "B");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"),new RyaURI("http://Charlie")), "B&C");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://livesIn"),new RyaURI("http://London")), "B");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Charlie"), new RyaURI("http://worksAt"),new RyaURI("http://Chipotle")), "C");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"),new RyaIRI("http://Charlie")), "B&C");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://livesIn"),new RyaIRI("http://London")), "B");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Charlie"), new RyaIRI("http://worksAt"),new RyaIRI("http://Chipotle")), "C");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"),new RyaURI("http://David")), "C&D");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://David"), new RyaURI("http://livesIn"),new RyaURI("http://London")), "C");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://David"), new RyaURI("http://worksAt"),new RyaURI("http://Chipotle")), "D");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"),new RyaIRI("http://David")), "C&D");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://livesIn"),new RyaIRI("http://London")), "C");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://David"), new RyaIRI("http://worksAt"),new RyaIRI("http://Chipotle")), "D");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Alice"), new RyaURI("http://talksTo"),new RyaURI("http://Eve")), "D&E");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://livesIn"),new RyaURI("http://Leeds")), "D");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Eve"), new RyaURI("http://worksAt"),new RyaURI("http://Chipotle")), "E");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Alice"), new RyaIRI("http://talksTo"),new RyaIRI("http://Eve")), "D&E");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://livesIn"),new RyaIRI("http://Leeds")), "D");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Eve"), new RyaIRI("http://worksAt"),new RyaIRI("http://Chipotle")), "E");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://talksTo"),new RyaURI("http://Alice")), "");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://livesIn"),new RyaURI("http://London")), "");
- addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaURI("http://Frank"), new RyaURI("http://worksAt"),new RyaURI("http://Chipotle")), "");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://talksTo"),new RyaIRI("http://Alice")), "");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://livesIn"),new RyaIRI("http://London")), "");
+ addStatementVisibilityEntry(streamedTriples, new RyaStatement(new RyaIRI("http://Frank"), new RyaIRI("http://worksAt"),new RyaIRI("http://Chipotle")), "");
final Connector accumuloConn = super.getAccumuloConnector();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
index 251c784..f25b67d 100644
--- a/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
+++ b/extras/rya.prospector/src/main/java/org/apache/rya/prospector/plans/impl/CountPlan.java
@@ -46,7 +46,7 @@ import org.apache.hadoop.mapreduce.Reducer;
import org.apache.rya.api.RdfCloudTripleStoreConstants;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.prospector.domain.IndexEntry;
import org.apache.rya.prospector.domain.IntermediateProspect;
import org.apache.rya.prospector.domain.TripleValueType;
@@ -64,8 +64,8 @@ public class CountPlan implements IndexWorkPlan {
@Override
public Collection<Map.Entry<IntermediateProspect, LongWritable>> map(final RyaStatement ryaStatement) {
- final RyaURI subject = ryaStatement.getSubject();
- final RyaURI predicate = ryaStatement.getPredicate();
+ final RyaIRI subject = ryaStatement.getSubject();
+ final RyaIRI predicate = ryaStatement.getPredicate();
final String subjpred = ryaStatement.getSubject().getData() + DELIM + ryaStatement.getPredicate().getData();
final String predobj = ryaStatement.getPredicate().getData() + DELIM + ryaStatement.getObject().getData();
final String subjobj = ryaStatement.getSubject().getData() + DELIM + ryaStatement.getObject().getData();
http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/9c2bad66/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectMapperTest.java
----------------------------------------------------------------------
diff --git a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectMapperTest.java b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectMapperTest.java
index 8b428a5..126dbc4 100644
--- a/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectMapperTest.java
+++ b/extras/rya.prospector/src/test/java/org/apache/rya/joinselect/mr/JoinSelectMapperTest.java
@@ -31,7 +31,7 @@ import org.apache.rya.joinselect.mr.utils.TripleEntry;
import org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT;
import org.apache.rya.api.domain.RyaStatement;
import org.apache.rya.api.domain.RyaType;
-import org.apache.rya.api.domain.RyaURI;
+import org.apache.rya.api.domain.RyaIRI;
import org.apache.rya.api.resolver.triple.TripleRow;
import org.apache.rya.api.resolver.triple.TripleRowResolver;
import org.apache.rya.api.resolver.triple.TripleRowResolverException;
@@ -51,7 +51,7 @@ public class JoinSelectMapperTest {
@Test
public void testOutput() throws TripleRowResolverException, IOException {
- RyaStatement rya = new RyaStatement(new RyaURI("urn:gem:etype#1234"), new RyaURI("urn:gem#pred"), new RyaType("mydata1"));
+ RyaStatement rya = new RyaStatement(new RyaIRI("urn:gem:etype#1234"), new RyaIRI("urn:gem#pred"), new RyaType("mydata1"));
Text s = new Text(rya.getSubject().getData());
Text p = new Text(rya.getPredicate().getData());
Text o = new Text(rya.getObject().getData());