use of ai.grakn.kb.admin.GraknAdmin in project grakn by graknlabs.
the class GraqlCompleter method create.
public static GraqlCompleter create(GraknSession session) {
ImmutableSet<Label> labels;
try (GraknAdmin tx = session.open(GraknTxType.READ).admin()) {
Stream<SchemaConcept> metaConcepts = Stream.of(tx.getMetaConcept(), tx.getMetaRole(), tx.getMetaRule()).flatMap(SchemaConcept::subs);
labels = metaConcepts.map(SchemaConcept::getLabel).collect(toImmutableSet());
}
return new GraqlCompleter(labels);
}
Aggregations