Search in sources :

Example 1 with DataTypeProperty

use of ai.grakn.graql.internal.pattern.property.DataTypeProperty in project grakn by graknlabs.

the class QueryParserTest method testParseBooleanType.

@Test
public void testParseBooleanType() {
    GetQuery query = parse("match $x datatype boolean; get;");
    VarPatternAdmin var = query.match().admin().getPattern().varPatterns().iterator().next();
    // noinspection OptionalGetWithoutIsPresent
    DataTypeProperty property = var.getProperty(DataTypeProperty.class).get();
    Assert.assertEquals(AttributeType.DataType.BOOLEAN, property.dataType());
}
Also used : VarPatternAdmin(ai.grakn.graql.admin.VarPatternAdmin) GetQuery(ai.grakn.graql.GetQuery) DataTypeProperty(ai.grakn.graql.internal.pattern.property.DataTypeProperty) Test(org.junit.Test)

Aggregations

GetQuery (ai.grakn.graql.GetQuery)1 VarPatternAdmin (ai.grakn.graql.admin.VarPatternAdmin)1 DataTypeProperty (ai.grakn.graql.internal.pattern.property.DataTypeProperty)1 Test (org.junit.Test)1