use of ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl in project grakn by graknlabs.
the class QueryTest method testQueryReiterationCondition_AcyclicalRuleGraph.
@Test
public void testQueryReiterationCondition_AcyclicalRuleGraph() {
EmbeddedGraknTx<?> graph = snbGraph.tx();
String patternString = "{($x, $y) isa recommendation;}";
ReasonerQueryImpl query = ReasonerQueries.create(conjunction(patternString, graph), graph);
assertFalse(query.requiresReiteration());
}
use of ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl in project grakn by graknlabs.
the class ReasonerTest method testParsingQueryWithResourceVariable_BoundWithNonSpecificVP.
@Test
public void testParsingQueryWithResourceVariable_BoundWithNonSpecificVP() {
String patternString = "{$x isa person;$x has age <10;}";
String patternString2 = "{$x isa person;$x has age $y;$y val <10;}";
ReasonerQueryImpl query = ReasonerQueries.atomic(conjunction(patternString, snbKB.tx()), snbKB.tx());
ReasonerQueryImpl query2 = ReasonerQueries.atomic(conjunction(patternString2, snbKB.tx()), snbKB.tx());
assertEquals(query, query2);
}
use of ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl in project grakn by graknlabs.
the class ReasonerTest method testParsingQueryWithResourceVariable_BoundWithSpecificVP.
@Test
public void testParsingQueryWithResourceVariable_BoundWithSpecificVP() {
EmbeddedGraknTx<?> graph = snbKB.tx();
String patternString = "{$x has firstname 'Bob', has lastname 'Geldof';}";
String patternString2 = "{$x has firstname 'Bob';$x has lastname 'Geldof';}";
String patternString3 = "{$x has firstname $x1;$x has lastname $x2;$x1 val 'Bob';$x2 val 'Geldof';}";
String patternString4 = "{$x has firstname $x2;$x has lastname $x1;$x2 val 'Bob';$x1 val 'Geldof';}";
ReasonerQueryImpl query = ReasonerQueries.create(conjunction(patternString, graph), graph);
ReasonerQueryImpl query2 = ReasonerQueries.create(conjunction(patternString2, graph), graph);
ReasonerQueryImpl query3 = ReasonerQueries.create(conjunction(patternString3, graph), graph);
ReasonerQueryImpl query4 = ReasonerQueries.create(conjunction(patternString4, graph), graph);
assertEquals(query, query3);
assertEquals(query, query4);
assertEquals(query2, query3);
assertEquals(query2, query4);
}
Aggregations