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);
