Search in sources :

Example 1 with TypeDBCheckedException

use of com.vaticle.typedb.core.common.exception.TypeDBCheckedException in project grakn by graknlabs.

the class EncodingTest method expectedAttributeIID.

private ByteArray expectedAttributeIID(GraphManager graphMgr, Label attributeTypeLabel, String attributeValue) {
    TypeVertex type = graphMgr.schema().getType(attributeTypeLabel);
    assertTrue(type.isAttributeType());
    try {
        return ByteArray.join(ATTRIBUTE.prefix().bytes(), type.iid().bytes(), Encoding.ValueType.STRING.bytes(), encodeStringAsSorted(attributeValue, STRING_ENCODING));
    } catch (TypeDBCheckedException e) {
        throw TypeDBException.of(e);
    }
}
Also used : TypeDBCheckedException(com.vaticle.typedb.core.common.exception.TypeDBCheckedException) TypeVertex(com.vaticle.typedb.core.graph.vertex.TypeVertex)

Aggregations

TypeDBCheckedException (com.vaticle.typedb.core.common.exception.TypeDBCheckedException)1 TypeVertex (com.vaticle.typedb.core.graph.vertex.TypeVertex)1