Search in sources :

Example 1 with TypeQLUpdate

use of com.vaticle.typeql.lang.query.TypeQLUpdate in project grakn by graknlabs.

the class TypeQLSteps method typeql_update.

@Given("typeql update")
public void typeql_update(String updateQueryStatements) {
    TypeQLUpdate typeQLQuery = TypeQL.parseQuery(String.join("\n", updateQueryStatements)).asUpdate();
    tx().query().update(typeQLQuery);
}
Also used : TypeQLUpdate(com.vaticle.typeql.lang.query.TypeQLUpdate) Given(io.cucumber.java.en.Given)

Example 2 with TypeQLUpdate

use of com.vaticle.typeql.lang.query.TypeQLUpdate in project grakn by graknlabs.

the class QueryService method update.

private void update(String queryStr, Options.Query options, UUID reqID) {
    TypeQLUpdate query = TypeQL.parseQuery(queryStr).asUpdate();
    Context.Query context = new Context.Query(transactionSvc.context(), options.query(query), query);
    FunctionalIterator<ConceptMap> answers = queryMgr.update(query, context);
    transactionSvc.stream(answers, reqID, context.options(), a -> updateResPart(reqID, a));
}
Also used : Context(com.vaticle.typedb.core.common.parameters.Context) ConceptMap(com.vaticle.typedb.core.concept.answer.ConceptMap) TypeQLUpdate(com.vaticle.typeql.lang.query.TypeQLUpdate)

Aggregations

TypeQLUpdate (com.vaticle.typeql.lang.query.TypeQLUpdate)2 Context (com.vaticle.typedb.core.common.parameters.Context)1 ConceptMap (com.vaticle.typedb.core.concept.answer.ConceptMap)1 Given (io.cucumber.java.en.Given)1