Search in sources :

Example 1 with Materialiser

use of com.vaticle.typedb.core.test.behaviour.reasoner.verification.Materialiser in project grakn by graknlabs.

the class MaterialiserTest method testDeduplicationOfInferredConcepts.

@Test
public void testDeduplicationOfInferredConcepts() {
    loadTransitivityExample(databaseMgr);
    try (CoreSession session = databaseMgr.session(database, Arguments.Session.Type.DATA)) {
        Materialiser materialiser = Materialiser.materialise(session);
        TypeQLMatch inferredAnswersQuery = TypeQL.match(TypeQL.var("lh").isa("location-hierarchy"));
        List<ConceptMap> inferredAnswers = iterate(materialiser.query(inferredAnswersQuery).entrySet()).flatMap(Map.Entry::getValue).toList();
        assertEquals(6, inferredAnswers.size());
    }
}
Also used : Materialiser(com.vaticle.typedb.core.test.behaviour.reasoner.verification.Materialiser) CoreSession(com.vaticle.typedb.core.database.CoreSession) TypeQLMatch(com.vaticle.typeql.lang.query.TypeQLMatch) ConceptMap(com.vaticle.typedb.core.concept.answer.ConceptMap) Map(java.util.Map) ConceptMap(com.vaticle.typedb.core.concept.answer.ConceptMap) Test(org.junit.Test)

Aggregations

ConceptMap (com.vaticle.typedb.core.concept.answer.ConceptMap)1 CoreSession (com.vaticle.typedb.core.database.CoreSession)1 Materialiser (com.vaticle.typedb.core.test.behaviour.reasoner.verification.Materialiser)1 TypeQLMatch (com.vaticle.typeql.lang.query.TypeQLMatch)1 Map (java.util.Map)1 Test (org.junit.Test)1