Search in sources :

Example 41 with QueryBindingSet

use of org.openrdf.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class AccumuloPcjSerializerTest method basicShortStringLiteralBsTest.

@Test
public void basicShortStringLiteralBsTest() throws BindingSetConversionException {
    final QueryBindingSet bs = new QueryBindingSet();
    bs.addBinding("X", new LiteralImpl("literal1"));
    bs.addBinding("Y", new LiteralImpl("literal2"));
    final VariableOrder varOrder = new VariableOrder("X", "Y");
    BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
    final byte[] byteVal = converter.convert(bs, varOrder);
    final BindingSet newBs = converter.convert(byteVal, varOrder);
    assertEquals(bs, newBs);
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) BindingSet(org.openrdf.query.BindingSet) MapBindingSet(org.openrdf.query.impl.MapBindingSet) AccumuloPcjSerializer(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 42 with QueryBindingSet

use of org.openrdf.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class AccumuloPcjSerializerTest method basicShortMixLiteralBsTest.

@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")));
    final VariableOrder varOrder = new VariableOrder("X", "Y");
    BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
    final byte[] byteVal = converter.convert(bs, varOrder);
    final BindingSet newBs = converter.convert(byteVal, varOrder);
    assertEquals(bs, newBs);
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) BindingSet(org.openrdf.query.BindingSet) MapBindingSet(org.openrdf.query.impl.MapBindingSet) AccumuloPcjSerializer(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) URIImpl(org.openrdf.model.impl.URIImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 43 with QueryBindingSet

use of org.openrdf.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class AccumuloPcjSerializerTest method basicShortUriBsTest.

@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"));
    final VariableOrder varOrder = new VariableOrder("X", "Y");
    BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
    final byte[] byteVal = converter.convert(bs, varOrder);
    final BindingSet newBs = converter.convert(byteVal, varOrder);
    assertEquals(bs, newBs);
}
Also used : QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) BindingSet(org.openrdf.query.BindingSet) MapBindingSet(org.openrdf.query.impl.MapBindingSet) AccumuloPcjSerializer(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) URIImpl(org.openrdf.model.impl.URIImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 44 with QueryBindingSet

use of org.openrdf.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class AccumuloPcjSerializerTest method basicLongUriBsTest.

@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"));
    final VariableOrder varOrder = new VariableOrder("X", "Y", "Z", "A", "B");
    BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
    final byte[] byteVal = converter.convert(bs, varOrder);
    final BindingSet newBs = converter.convert(byteVal, varOrder);
    assertEquals(bs, newBs);
}
Also used : QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) BindingSet(org.openrdf.query.BindingSet) MapBindingSet(org.openrdf.query.impl.MapBindingSet) AccumuloPcjSerializer(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) URIImpl(org.openrdf.model.impl.URIImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 45 with QueryBindingSet

use of org.openrdf.query.algebra.evaluation.QueryBindingSet in project incubator-rya by apache.

the class AccumuloPcjSerializerTest method basicMixUriLiteralBsTest.

@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"));
    final VariableOrder varOrder = new VariableOrder("A", "W", "X", "Y", "Z", "B", "C");
    BindingSetConverter<byte[]> converter = new AccumuloPcjSerializer();
    final byte[] byteVal = converter.convert(bs, varOrder);
    final BindingSet newBs = converter.convert(byteVal, varOrder);
    assertEquals(bs, newBs);
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) BindingSet(org.openrdf.query.BindingSet) MapBindingSet(org.openrdf.query.impl.MapBindingSet) AccumuloPcjSerializer(org.apache.rya.indexing.pcj.storage.accumulo.AccumuloPcjSerializer) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) URIImpl(org.openrdf.model.impl.URIImpl) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Aggregations

QueryBindingSet (org.openrdf.query.algebra.evaluation.QueryBindingSet)107 Test (org.junit.Test)84 BindingSet (org.openrdf.query.BindingSet)79 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)52 RyaURI (org.apache.rya.api.domain.RyaURI)46 RyaStatement (org.apache.rya.api.domain.RyaStatement)45 SPARQLParser (org.openrdf.query.parser.sparql.SPARQLParser)42 StatementPattern (org.openrdf.query.algebra.StatementPattern)41 ParsedQuery (org.openrdf.query.parser.ParsedQuery)41 RyaType (org.apache.rya.api.domain.RyaType)39 LiteralImpl (org.openrdf.model.impl.LiteralImpl)32 ArrayList (java.util.ArrayList)30 HashSet (java.util.HashSet)28 URIImpl (org.openrdf.model.impl.URIImpl)27 StatementMetadata (org.apache.rya.api.domain.StatementMetadata)26 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)20 StatementMetadataNode (org.apache.rya.indexing.statement.metadata.matching.StatementMetadataNode)15 Statement (org.openrdf.model.Statement)15 TupleExpr (org.openrdf.query.algebra.TupleExpr)14 Collection (java.util.Collection)13