Search in sources :

Example 6 with DeleteQuery

use of ai.grakn.graql.DeleteQuery in project grakn by graknlabs.

the class DeleteQueryImplTest method deleteQueriesWithDifferentVarsAreDifferent.

@Test
public void deleteQueriesWithDifferentVarsAreDifferent() {
    DeleteQuery query1 = DeleteQueryImpl.of(vars1, match1);
    DeleteQuery query2 = DeleteQueryImpl.of(vars2, match1);
    assertNotEquals(query1, query2);
}
Also used : DeleteQuery(ai.grakn.graql.DeleteQuery) Test(org.junit.Test)

Example 7 with DeleteQuery

use of ai.grakn.graql.DeleteQuery in project grakn by graknlabs.

the class AdminTest method testDeleteQueryPattern.

@Test
public void testDeleteQueryPattern() {
    DeleteQuery query = qb.match(var("x").isa("movie")).delete("x");
    assertEquals("match $x isa movie;", query.admin().match().toString());
    query = qb.match(var("x").directIsa("movie")).delete("x");
    assertEquals("match $x isa! movie;", query.admin().match().toString());
}
Also used : DeleteQuery(ai.grakn.graql.DeleteQuery) Test(org.junit.Test)

Aggregations

DeleteQuery (ai.grakn.graql.DeleteQuery)7 Test (org.junit.Test)7 Var (ai.grakn.graql.Var)1