use of org.apache.rya.api.resolver.triple.TripleRowResolverException in project incubator-rya by apache.
the class KeyValueToRyaStatementFunction method apply.
@Override
public RyaStatement apply(Map.Entry<Key, Value> input) {
Key key = input.getKey();
Value value = input.getValue();
RyaStatement statement = null;
try {
statement = context.deserializeTriple(tableLayout, new TripleRow(key.getRowData().toArray(), key.getColumnFamilyData().toArray(), key.getColumnQualifierData().toArray(), key.getTimestamp(), key.getColumnVisibilityData().toArray(), (value != null) ? value.get() : null));
} catch (TripleRowResolverException e) {
throw new RuntimeException(e);
}
return statement;
}
use of org.apache.rya.api.resolver.triple.TripleRowResolverException in project incubator-rya by apache.
the class MRReasoningUtils method getStatement.
/**
* Convert an Accumulo row to a RyaStatement.
*/
static RyaStatement getStatement(Key row, Value data, Configuration conf) {
try {
RyaTripleContext ryaContext = RyaTripleContext.getInstance(new AccumuloRdfConfiguration(conf));
RyaStatement ryaStatement = ryaContext.deserializeTriple(RdfCloudTripleStoreConstants.TABLE_LAYOUT.SPO, new TripleRow(row.getRow().getBytes(), row.getColumnFamily().getBytes(), row.getColumnQualifier().getBytes(), row.getTimestamp(), row.getColumnVisibility().getBytes(), data.get()));
return ryaStatement;
} catch (TripleRowResolverException e) {
e.printStackTrace();
System.err.println("row: " + row);
return null;
} catch (IllegalArgumentException e) {
e.printStackTrace();
System.err.println("row: " + row);
throw e;
}
}
Aggregations