Search in sources :

Example 91 with Concept

use of ai.grakn.concept.Concept in project grakn by graknlabs.

the class QueryErrorTest method testGetNonExistentVariable.

@Test
public void testGetNonExistentVariable() {
    Match match = qb.match(var("x").isa("movie"));
    Stream<Concept> concepts = match.get("y");
    exception.expect(GraqlQueryException.class);
    exception.expectMessage(ErrorMessage.VARIABLE_NOT_IN_QUERY.getMessage(Graql.var("y")));
    // noinspection ResultOfMethodCallIgnored
    concepts.count();
}
Also used : Concept(ai.grakn.concept.Concept) Match(ai.grakn.graql.Match) Test(org.junit.Test)

Aggregations

Concept (ai.grakn.concept.Concept)91 Test (org.junit.Test)56 ConceptId (ai.grakn.concept.ConceptId)26 GraknTx (ai.grakn.GraknTx)25 Answer (ai.grakn.graql.admin.Answer)25 SchemaConcept (ai.grakn.concept.SchemaConcept)19 Label (ai.grakn.concept.Label)18 GrpcConcept (ai.grakn.rpc.generated.GrpcConcept)18 QueryBuilder (ai.grakn.graql.QueryBuilder)17 Var (ai.grakn.graql.Var)15 Set (java.util.Set)15 Role (ai.grakn.concept.Role)14 QueryAnswer (ai.grakn.graql.internal.query.QueryAnswer)14 HashSet (java.util.HashSet)13 List (java.util.List)12 AttributeType (ai.grakn.concept.AttributeType)11 EntityType (ai.grakn.concept.EntityType)11 Schema (ai.grakn.util.Schema)10 Collectors (java.util.stream.Collectors)10 Stream (java.util.stream.Stream)10