@Test public void basicShortMixLiteralBsTest() throws BindingSetConversionException { final QueryBindingSet bs = new QueryBindingSet(); bs.addBinding("X",VF.createLiteral("literal1")); bs.addBinding("Y",VF.createLiteral("5", VF.createIRI("http: 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); }
@Override public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException { checkNotNull(bindingSet); checkNotNull(varOrder); final List<byte[]> byteSegments = new LinkedList<>(); try { for(final String varName: varOrder) { if(bindingSet.hasBinding(varName)) { final RyaType rt = RdfToRyaConversions.convertValue(bindingSet.getBinding(varName).getValue()); final byte[][] serializedVal = RyaContext.getInstance().serializeType(rt); byteSegments.add(serializedVal[0]); byteSegments.add(serializedVal[1]); } byteSegments.add(DELIM_BYTES); } return concat(byteSegments); } catch (RyaTypeResolverException e) { throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e); } }
AccumuloPcjSerializer implements BindingSetConverter<byte[]> { @Override public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException { checkNotNull(bindingSet); checkNotNull(varOrder); final List<byte[]> byteSegments = new LinkedList<>(); try { for(final String varName: varOrder) { if(bindingSet.hasBinding(varName)) { final RyaType rt = RdfToRyaConversions.convertValue(bindingSet.getBinding(varName).getValue()); final byte[][] serializedVal = RyaContext.getInstance().serializeType(rt); byteSegments.add(serializedVal[0]); byteSegments.add(serializedVal[1]); } byteSegments.add(DELIM_BYTES); } return concat(byteSegments); } catch (RyaTypeResolverException e) { throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e); } } }
AccumuloPcjSerializer implements BindingSetConverter<byte[]> { @Override public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException { checkNotNull(bindingSet); checkNotNull(varOrder); final List<byte[]> byteSegments = new LinkedList<>(); try { for(final String varName: varOrder) { if(bindingSet.hasBinding(varName)) { final RyaType rt = RdfToRyaConversions.convertValue(bindingSet.getBinding(varName).getValue()); final byte[][] serializedVal = RyaContext.getInstance().serializeType(rt); byteSegments.add(serializedVal[0]); byteSegments.add(serializedVal[1]); } byteSegments.add(DELIM_BYTES); } return concat(byteSegments); } catch (RyaTypeResolverException e) { throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e); } }  }
AccumuloPcjSerializer implements BindingSetConverter<byte[]> { @Override public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException { checkNotNull(bindingSet); checkNotNull(varOrder); final List<byte[]> byteSegments = new LinkedList<>(); try { for(final String varName: varOrder) { if(bindingSet.hasBinding(varName)) { final RyaType rt = RdfToRyaConversions.convertValue(bindingSet.getBinding(varName).getValue()); final byte[][] serializedVal = RyaContext.getInstance().serializeType(rt); byteSegments.add(serializedVal[0]); byteSegments.add(serializedVal[1]); } byteSegments.add(DELIM_BYTES); } return concat(byteSegments); } catch (RyaTypeResolverException e) { throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e); } }  @Override byte[] convert(BindingSet bindingSet, VariableOrder varOrder); @Override BindingSet convert(byte[] bindingSetBytes, VariableOrder varOrder); }
AccumuloPcjSerializer implements BindingSetConverter<byte[]> { @Override public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException { checkNotNull(bindingSet); checkNotNull(varOrder); final List<byte[]> byteSegments = new LinkedList<>(); try { for(final String varName: varOrder) { if(bindingSet.hasBinding(varName)) { final RyaType rt = RdfToRyaConversions.convertValue(bindingSet.getBinding(varName).getValue()); final byte[][] serializedVal = RyaContext.getInstance().serializeType(rt); byteSegments.add(serializedVal[0]); byteSegments.add(serializedVal[1]); } byteSegments.add(DELIM_BYTES); } return concat(byteSegments); } catch (RyaTypeResolverException e) { throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e); } }  @Override byte[] convert(BindingSet bindingSet, VariableOrder varOrder); @Override BindingSet convert(byte[] bindingSetBytes, VariableOrder varOrder);  }