Search in sources :

Example 1 with MockRdfCloudConfiguration

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));
}
Also used : RyaURI(org.apache.rya.api.domain.RyaURI) TABLE_LAYOUT(org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT) TripleRow(org.apache.rya.api.resolver.triple.TripleRow) RyaStatement(org.apache.rya.api.domain.RyaStatement) RyaType(org.apache.rya.api.domain.RyaType) MockRdfCloudConfiguration(org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration)

Example 2 with MockRdfCloudConfiguration

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));
}
Also used : RyaURI(org.apache.rya.api.domain.RyaURI) TABLE_LAYOUT(org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT) TripleRow(org.apache.rya.api.resolver.triple.TripleRow) RyaStatement(org.apache.rya.api.domain.RyaStatement) RyaType(org.apache.rya.api.domain.RyaType) MockRdfCloudConfiguration(org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration)

Aggregations

TABLE_LAYOUT (org.apache.rya.api.RdfCloudTripleStoreConstants.TABLE_LAYOUT)2 RyaStatement (org.apache.rya.api.domain.RyaStatement)2 RyaType (org.apache.rya.api.domain.RyaType)2 RyaURI (org.apache.rya.api.domain.RyaURI)2 MockRdfCloudConfiguration (org.apache.rya.api.query.strategy.wholerow.MockRdfCloudConfiguration)2 TripleRow (org.apache.rya.api.resolver.triple.TripleRow)2