Search in sources :

Example 1 with PutRule

use of ai.grakn.rpc.generated.GrpcGrakn.PutRule in project grakn by graknlabs.

the class TxObserver method putRule.

private void putRule(PutRule putRule) {
    Label label = GrpcUtil.convert(putRule.getLabel());
    Pattern when = GrpcUtil.convert(putRule.getWhen());
    Pattern then = GrpcUtil.convert(putRule.getThen());
    Rule rule = tx().putRule(label, when, then);
    responseObserver.onNext(GrpcUtil.conceptResponse(rule));
}
Also used : Pattern(ai.grakn.graql.Pattern) Label(ai.grakn.concept.Label) Rule(ai.grakn.concept.Rule) PutRule(ai.grakn.rpc.generated.GrpcGrakn.PutRule)

Aggregations

Label (ai.grakn.concept.Label)1 Rule (ai.grakn.concept.Rule)1 Pattern (ai.grakn.graql.Pattern)1 PutRule (ai.grakn.rpc.generated.GrpcGrakn.PutRule)1