Search in sources :

Example 1 with TypeQLException

use of com.vaticle.typeql.lang.common.exception.TypeQLException in project grakn by graknlabs.

the class TypeQLSteps method typeql_match.

@When("get answers of typeql match")
public void typeql_match(String typeQLQueryStatements) {
    try {
        TypeQLMatch typeQLQuery = TypeQL.parseQuery(String.join("\n", typeQLQueryStatements)).asMatch();
        clearAnswers();
        answers = tx().query().match(typeQLQuery).toList();
    } catch (TypeQLException e) {
        // NOTE: We manually close transaction here, because we want to align with all non-java clients,
        // where parsing happens at server-side which closes transaction if they fail
        tx().close();
        throw e;
    }
}
Also used : TypeQLException(com.vaticle.typeql.lang.common.exception.TypeQLException) TypeQLMatch(com.vaticle.typeql.lang.query.TypeQLMatch) When(io.cucumber.java.en.When)

Aggregations

TypeQLException (com.vaticle.typeql.lang.common.exception.TypeQLException)1 TypeQLMatch (com.vaticle.typeql.lang.query.TypeQLMatch)1 When (io.cucumber.java.en.When)1