use of org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration in project incubator-rya by apache.
the class RyaContextTest method testTripleRowSerialization.
public void testTripleRowSerialization() throws Exception {
RyaURI subj = new RyaURI("urn:test#subj");
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());
Map<TABLE_LAYOUT, TripleRow> map = instance.serializeTriple(statement);
TripleRow tripleRow = map.get(TABLE_LAYOUT.SPO);
assertEquals(statement, instance.deserializeTriple(TABLE_LAYOUT.SPO, tripleRow));
}
use of org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration in project incubator-rya by apache.
the class RyaContextTest method testHashedTripleRowSerialization.
public void testHashedTripleRowSerialization() throws Exception {
RyaURI subj = new RyaURI("urn:test#subj");
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());
RyaTripleContext instance = RyaTripleContext.getInstance(config);
Map<TABLE_LAYOUT, TripleRow> map = instance.serializeTriple(statement);
TripleRow tripleRow = map.get(TABLE_LAYOUT.SPO);
assertEquals(statement, instance.deserializeTriple(TABLE_LAYOUT.SPO, tripleRow));
}
Aggregations