Mentions légales du service

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rules/integraal
  • ulliana/integraal
2 results
Show changes
Showing
with 18596 additions and 3 deletions
package fr.boreal.test.explanation.unit_tests.explainer.kb_gri_baseline_marco;
import fr.boreal.explanation.kb_gri.explainers.static_gri.KBSupportExplainer_KBGRI;
import fr.boreal.explanation.kb_gri.explainers.static_gri_baseline.KBSupportExplainer_Baseline;
import fr.boreal.explanation.kb_gri.rule_transformation.GRIRuleTransformer;
import fr.boreal.model.kb.api.FactBase;
import fr.boreal.model.kb.api.KnowledgeBase;
import fr.boreal.model.kb.api.RuleBase;
import fr.boreal.model.kb.impl.KnowledgeBaseImpl;
import fr.boreal.model.kb.impl.RuleBaseImpl;
import fr.boreal.model.logicalElements.api.Atom;
import fr.boreal.model.logicalElements.api.Predicate;
import fr.boreal.storage.natives.SimpleInMemoryGraphStore;
import fr.boreal.test.explanation.TestData;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Set;
public class KBSupportExplainerTest {
KBSupportExplainer_Baseline explainer;
GRIRuleTransformer griRuleTransformer = GRIRuleTransformer.instance();
Predicate REL = GRIRuleTransformer.REL;
@BeforeEach
public void setUp() {
}
@Test
public void KBSupportExplainerTestCyclic3() {
Atom query = TestData.ta;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r10_qx_tx, TestData.r11_tx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase1 = new SimpleInMemoryGraphStore(Set.of(TestData.pa));
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx, TestData.r10_qx_tx));
KnowledgeBase expectedExpl1 = new KnowledgeBaseImpl(expectedFactBase1, expectedRuleBase1);
Assertions.assertTrue(explanations.contains(expectedExpl1), "(Completeness issue) Explanation missing: " + expectedExpl1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTestCyclic2() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r10_qx_tx, TestData.r11_tx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase1 = new SimpleInMemoryGraphStore(Set.of(TestData.pa));
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
KnowledgeBase expectedExpl1 = new KnowledgeBaseImpl(expectedFactBase1, expectedRuleBase1);
Assertions.assertTrue(explanations.contains(expectedExpl1), "(Completeness issue) Explanation missing: " + expectedExpl1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTestCyclic1() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r9_qx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase1 = new SimpleInMemoryGraphStore(Set.of(TestData.pa));
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
KnowledgeBase expectedExpl1 = new KnowledgeBaseImpl(expectedFactBase1, expectedRuleBase1);
Assertions.assertTrue(explanations.contains(expectedExpl1), "(Completeness issue) Explanation missing: " + expectedExpl1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTest4() {
Atom query = TestData.pa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px,TestData.r7_sxx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase1 = new SimpleInMemoryGraphStore(Set.of(TestData.saa));
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r6_sxy_px));
KnowledgeBase expectedExpl1 = new KnowledgeBaseImpl(expectedFactBase1, expectedRuleBase1);
FactBase expectedFactBase2 = new SimpleInMemoryGraphStore(Set.of(TestData.sab));
RuleBase expectedRuleBase2 = new RuleBaseImpl(Set.of(TestData.r6_sxy_px));
KnowledgeBase expectedExpl2 = new KnowledgeBaseImpl(expectedFactBase2, expectedRuleBase2);
FactBase expectedFactBase3 = new SimpleInMemoryGraphStore(Set.of(TestData.saa));
RuleBase expectedRuleBase3 = new RuleBaseImpl(Set.of(TestData.r7_sxx_px));
KnowledgeBase expectedExpl3 = new KnowledgeBaseImpl(expectedFactBase3, expectedRuleBase3);
Assertions.assertTrue(explanations.contains(expectedExpl1), "(Completeness issue) Explanation missing: " + expectedExpl1);
Assertions.assertTrue(explanations.contains(expectedExpl2), "(Completeness issue) Explanation missing: " + expectedExpl2);
Assertions.assertTrue(explanations.contains(expectedExpl3), "(Completeness issue) Explanation missing: " + expectedExpl3);
Assertions.assertEquals(3, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTest3() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px, TestData.r7_sxx_px, TestData.r8_pxpytxy_qx));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase = new SimpleInMemoryGraphStore(Set.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r6_sxy_px,TestData.r8_pxpytxy_qx));
KnowledgeBase expectedExpl = new KnowledgeBaseImpl(expectedFactBase, expectedRuleBase);
Assertions.assertTrue(explanations.contains(expectedExpl), "(Completeness issue) Explanation missing: " + expectedExpl);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTest2() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px, TestData.r7_sxx_px, TestData.r8_pxpytxy_qx));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase = new SimpleInMemoryGraphStore(Set.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r6_sxy_px,TestData.r8_pxpytxy_qx));
KnowledgeBase expectedExpl = new KnowledgeBaseImpl(expectedFactBase, expectedRuleBase);
Assertions.assertTrue(explanations.contains(expectedExpl), "(Completeness issue) Explanation missing: " + expectedExpl);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void KBSupportExplainerTest1() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase = new SimpleInMemoryGraphStore(Set.of(TestData.pa));
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
KnowledgeBase expectedExpl = new KnowledgeBaseImpl(expectedFactBase, expectedRuleBase);
Assertions.assertTrue(explanations.contains(expectedExpl), "(Completeness issue) Explanation missing: " + expectedExpl);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void QueryNotEntailedTest() {
Atom query = TestData.sa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
Assertions.assertEquals(0, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void QueryInFactBaseTest() {
Atom query = TestData.pa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new KBSupportExplainer_Baseline(kb);
Set<KnowledgeBase> explanations = explainer.getAllExplanations(query);
FactBase expectedFactBase = new SimpleInMemoryGraphStore(Set.of(TestData.pa));
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of());
KnowledgeBase expectedExpl = new KnowledgeBaseImpl(expectedFactBase, expectedRuleBase);
Assertions.assertTrue(explanations.contains(expectedExpl), "(Completeness issue) Explanation missing: " + expectedExpl);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
}
package fr.boreal.test.explanation.unit_tests.explainer.kb_gri_baseline_marco;
import fr.boreal.explanation.kb_gri.explainers.static_gri.RuleSupportExplainer_KBGRI;
import fr.boreal.explanation.kb_gri.explainers.static_gri_baseline.RuleSupportExplainer_Baseline;
import fr.boreal.explanation.kb_gri.rule_transformation.GRIRuleTransformer;
import fr.boreal.model.kb.api.FactBase;
import fr.boreal.model.kb.api.KnowledgeBase;
import fr.boreal.model.kb.api.RuleBase;
import fr.boreal.model.kb.impl.KnowledgeBaseImpl;
import fr.boreal.model.kb.impl.RuleBaseImpl;
import fr.boreal.model.logicalElements.api.Atom;
import fr.boreal.model.logicalElements.api.Predicate;
import fr.boreal.storage.natives.SimpleInMemoryGraphStore;
import fr.boreal.test.explanation.TestData;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Set;
public class RuleSupportExplainerTest {
RuleSupportExplainer_Baseline explainer;
GRIRuleTransformer griRuleTransformer = GRIRuleTransformer.instance();
Predicate REL = GRIRuleTransformer.REL;
@BeforeEach
public void setUp() {
}
@Test
public void RuleSupportExplainerTest4() {
Atom query = TestData.pa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px,TestData.r7_sxx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r6_sxy_px));
RuleBase expectedRuleBase2 = new RuleBaseImpl(Set.of(TestData.r7_sxx_px));
Assertions.assertTrue(explanations.contains(expectedRuleBase1), "(Completeness issue) Explanation missing: " + expectedRuleBase1);
Assertions.assertTrue(explanations.contains(expectedRuleBase1), "(Completeness issue) Explanation missing: " + expectedRuleBase1);
Assertions.assertEquals(2, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTest3() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px, TestData.r7_sxx_px, TestData.r8_pxpytxy_qx));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r6_sxy_px,TestData.r8_pxpytxy_qx));
Assertions.assertTrue(explanations.contains(expectedRuleBase), "(Completeness issue) Explanation missing: " + expectedRuleBase);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTest2() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.saa, TestData.sbc, TestData.tab));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r6_sxy_px, TestData.r7_sxx_px, TestData.r8_pxpytxy_qx));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r6_sxy_px,TestData.r8_pxpytxy_qx));
Assertions.assertTrue(explanations.contains(expectedRuleBase), "(Completeness issue) Explanation missing: " + expectedRuleBase);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTest1() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
Assertions.assertTrue(explanations.contains(expectedRuleBase), "(Completeness issue) Explanation missing: " + expectedRuleBase);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void QueryNotEntailedTest() {
Atom query = TestData.sa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
Assertions.assertEquals(0, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void QueryInFactBaseTest() {
Atom query = TestData.pa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa, TestData.ta));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx, TestData.r4_qx_txy));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase = new RuleBaseImpl(Set.of());
Assertions.assertTrue(explanations.contains(expectedRuleBase), "(Completeness issue) Explanation missing: " + expectedRuleBase);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTestCyclic3() {
Atom query = TestData.ta;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r10_qx_tx, TestData.r11_tx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx, TestData.r10_qx_tx));
Assertions.assertTrue(explanations.contains(expectedRuleBase1), "(Completeness issue) Explanation missing: " + expectedRuleBase1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTestCyclic2() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r10_qx_tx, TestData.r11_tx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
Assertions.assertTrue(explanations.contains(expectedRuleBase1), "(Completeness issue) Explanation missing: " + expectedRuleBase1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
@Test
public void RuleSupportExplainerTestCyclic1() {
Atom query = TestData.qa;
FactBase factBase = new SimpleInMemoryGraphStore(List.of(TestData.pa));
RuleBase ruleBase = new RuleBaseImpl(List.of(TestData.r1_px_qx,TestData.r9_qx_px));
KnowledgeBase kb = new KnowledgeBaseImpl(factBase, ruleBase);
explainer = new RuleSupportExplainer_Baseline(kb);
Set<RuleBase> explanations = explainer.getAllExplanations(query);
RuleBase expectedRuleBase1 = new RuleBaseImpl(Set.of(TestData.r1_px_qx));
Assertions.assertTrue(explanations.contains(expectedRuleBase1), "(Completeness issue) Explanation missing: " + expectedRuleBase1);
Assertions.assertEquals(1, explanations.size(), "(Soundness issue) identify non-explanation as explanation");
}
}
p(a).
q(X):-p(X).
r(X):-q(X).
\ No newline at end of file
q(a).
\ No newline at end of file
......@@ -674,7 +674,7 @@ public class ChaseBuilder {
break;
case InteGraalKeywords.CHECKER:
switch ((InteGraalKeywords.Algorithms.Parameters.Chase.Checker) param.value()) {
case OBLIVIOUS -> this.useGRDRuleScheduler();
case OBLIVIOUS -> this.useObliviousChecker();
case SEMI_OBLIVIOUS -> this.useSemiObliviousChecker();
case RESTRICTED -> this.useRestrictedChecker();
case SO_RESTRICTED -> this.useSORestrictedChecker();
......
......@@ -2,6 +2,7 @@ package fr.boreal.forward_chaining.chase.test.treatment;
import fr.boreal.forward_chaining.chase.ChaseBuilder;
import fr.boreal.io.api.ParseException;
import fr.boreal.io.csv.CSVLoader;
import fr.boreal.io.dlgp.DlgpParser;
import fr.boreal.model.kb.api.FactBase;
import fr.boreal.model.kb.api.KnowledgeBase;
......@@ -9,7 +10,12 @@ import fr.boreal.model.kb.api.RuleBase;
import fr.boreal.model.kb.impl.KnowledgeBaseImpl;
import fr.boreal.model.kb.impl.RuleBaseImpl;
import fr.boreal.model.logicalElements.api.Atom;
import fr.boreal.model.logicalElements.impl.SubstitutionImpl;
import fr.boreal.model.query.api.FOQuery;
import fr.boreal.model.query.api.Query;
import fr.boreal.model.rule.api.FORule;
import fr.boreal.query_evaluation.generic.DefaultGenericQueryEvaluator;
import fr.boreal.query_evaluation.generic.GenericFOQueryEvaluator;
import fr.boreal.storage.natives.SimpleInMemoryGraphStore;
import org.junit.Test;
......@@ -22,6 +28,9 @@ public class ChasePerformance {
String a10 = "src/test/resources/knowledge_bases/andersen_10000.dlgp";
String a50 = "src/test/resources/knowledge_bases/andersen_50000.dlgp";
String lubm = "src/test/resources/knowledge_bases/lubm-001/lubm-data-import-integraal.rls";
String lubm_rules = "src/test/resources/knowledge_bases/lubm-001/rules/lubm-rules.dlgp";
String lubm_query = "src/test/resources/knowledge_bases/lubm-001/queries/allQueries.dlgp";
@Test
......@@ -30,12 +39,12 @@ public class ChasePerformance {
/*
Anderser 10
*/
long begin = System.currentTimeMillis();
var res = parseKB(new File(a10));
long end = System.currentTimeMillis();
System.out.println("loading time "+ (end - begin));
var fb= res.getFactBase();
var rb= res.getRuleBase();
var c = ChaseBuilder.defaultBuilder(fb, rb)
......@@ -53,6 +62,45 @@ public class ChasePerformance {
}
@Test
public void testChaseTimeFromCSV() throws FileNotFoundException {
FactBase fb = new SimpleInMemoryGraphStore();
long begin = System.currentTimeMillis();
CSVLoader.parseAndLoad(fb,new File(lubm),false);
long end = System.currentTimeMillis();
System.out.println("loading time from CSV "+ (end - begin));
var rb= new RuleBaseImpl(DlgpParser.parseFile(lubm_rules).rules());
var c = ChaseBuilder.defaultBuilder(fb, rb)
.useObliviousChecker()
.useNaiveComputer()
.useByPredicateRuleScheduler()
.useBreadthFirstApplier()
.build().get();
System.out.println("pre: #atoms " + fb.size());
begin = System.currentTimeMillis();
c.execute();
end = System.currentTimeMillis();
System.out.println("saturation time (ms): " + (end - begin));
System.out.println("post: #atoms " + fb.size());
var queries = DlgpParser.parseFile(lubm_query).queries();
for(Query q : queries) {
System.out.println(q);
var res = DefaultGenericQueryEvaluator.defaultInstance().evaluate(q,fb,q.getAnswerVariables(),new SubstitutionImpl());
int count =0;
while(res.hasNext()){
count++;
res.next();
}
System.out.println("number of answers : "+count);
}
}
public static KnowledgeBase parseKB(File dlgpFile) throws FileNotFoundException {
FactBase fb = new SimpleInMemoryGraphStore();
......
department0-university0-assistantprofessor0
department0-university0-assistantprofessor1
department0-university0-assistantprofessor2
department0-university0-assistantprofessor3
department0-university0-assistantprofessor4
department0-university0-assistantprofessor5
department0-university0-assistantprofessor6
department0-university0-assistantprofessor7
department0-university0-assistantprofessor8
department0-university0-assistantprofessor9
department1-university0-assistantprofessor0
department1-university0-assistantprofessor1
department1-university0-assistantprofessor2
department1-university0-assistantprofessor3
department1-university0-assistantprofessor4
department1-university0-assistantprofessor5
department1-university0-assistantprofessor6
department1-university0-assistantprofessor7
department10-university0-assistantprofessor0
department10-university0-assistantprofessor1
department10-university0-assistantprofessor2
department10-university0-assistantprofessor3
department10-university0-assistantprofessor4
department10-university0-assistantprofessor5
department10-university0-assistantprofessor6
department10-university0-assistantprofessor7
department10-university0-assistantprofessor8
department10-university0-assistantprofessor9
department10-university0-assistantprofessor10
department11-university0-assistantprofessor0
department11-university0-assistantprofessor1
department11-university0-assistantprofessor2
department11-university0-assistantprofessor3
department11-university0-assistantprofessor4
department11-university0-assistantprofessor5
department11-university0-assistantprofessor6
department11-university0-assistantprofessor7
department11-university0-assistantprofessor8
department11-university0-assistantprofessor9
department11-university0-assistantprofessor10
department12-university0-assistantprofessor0
department12-university0-assistantprofessor1
department12-university0-assistantprofessor2
department12-university0-assistantprofessor3
department12-university0-assistantprofessor4
department12-university0-assistantprofessor5
department12-university0-assistantprofessor6
department12-university0-assistantprofessor7
department12-university0-assistantprofessor8
department12-university0-assistantprofessor9
department12-university0-assistantprofessor10
department13-university0-assistantprofessor0
department13-university0-assistantprofessor1
department13-university0-assistantprofessor2
department13-university0-assistantprofessor3
department13-university0-assistantprofessor4
department13-university0-assistantprofessor5
department13-university0-assistantprofessor6
department13-university0-assistantprofessor7
department13-university0-assistantprofessor8
department13-university0-assistantprofessor9
department13-university0-assistantprofessor10
department14-university0-assistantprofessor0
department14-university0-assistantprofessor1
department14-university0-assistantprofessor2
department14-university0-assistantprofessor3
department14-university0-assistantprofessor4
department14-university0-assistantprofessor5
department14-university0-assistantprofessor6
department14-university0-assistantprofessor7
department2-university0-assistantprofessor0
department2-university0-assistantprofessor1
department2-university0-assistantprofessor2
department2-university0-assistantprofessor3
department2-university0-assistantprofessor4
department2-university0-assistantprofessor5
department2-university0-assistantprofessor6
department2-university0-assistantprofessor7
department3-university0-assistantprofessor0
department3-university0-assistantprofessor1
department3-university0-assistantprofessor2
department3-university0-assistantprofessor3
department3-university0-assistantprofessor4
department3-university0-assistantprofessor5
department3-university0-assistantprofessor6
department3-university0-assistantprofessor7
department3-university0-assistantprofessor8
department3-university0-assistantprofessor9
department4-university0-assistantprofessor0
department4-university0-assistantprofessor1
department4-university0-assistantprofessor2
department4-university0-assistantprofessor3
department4-university0-assistantprofessor4
department4-university0-assistantprofessor5
department4-university0-assistantprofessor6
department4-university0-assistantprofessor7
department4-university0-assistantprofessor8
department4-university0-assistantprofessor9
department5-university0-assistantprofessor0
department5-university0-assistantprofessor1
department5-university0-assistantprofessor2
department5-university0-assistantprofessor3
department5-university0-assistantprofessor4
department5-university0-assistantprofessor5
department5-university0-assistantprofessor6
department5-university0-assistantprofessor7
department6-university0-assistantprofessor0
department6-university0-assistantprofessor1
department6-university0-assistantprofessor2
department6-university0-assistantprofessor3
department6-university0-assistantprofessor4
department6-university0-assistantprofessor5
department6-university0-assistantprofessor6
department6-university0-assistantprofessor7
department7-university0-assistantprofessor0
department7-university0-assistantprofessor1
department7-university0-assistantprofessor2
department7-university0-assistantprofessor3
department7-university0-assistantprofessor4
department7-university0-assistantprofessor5
department7-university0-assistantprofessor6
department7-university0-assistantprofessor7
department7-university0-assistantprofessor8
department7-university0-assistantprofessor9
department8-university0-assistantprofessor0
department8-university0-assistantprofessor1
department8-university0-assistantprofessor2
department8-university0-assistantprofessor3
department8-university0-assistantprofessor4
department8-university0-assistantprofessor5
department8-university0-assistantprofessor6
department8-university0-assistantprofessor7
department8-university0-assistantprofessor8
department8-university0-assistantprofessor9
department8-university0-assistantprofessor10
department9-university0-assistantprofessor0
department9-university0-assistantprofessor1
department9-university0-assistantprofessor2
department9-university0-assistantprofessor3
department9-university0-assistantprofessor4
department9-university0-assistantprofessor5
department9-university0-assistantprofessor6
department9-university0-assistantprofessor7
department9-university0-assistantprofessor8
department9-university0-assistantprofessor9
department9-university0-assistantprofessor10
department0-university0-associateprofessor0
department0-university0-associateprofessor1
department0-university0-associateprofessor2
department0-university0-associateprofessor3
department0-university0-associateprofessor4
department0-university0-associateprofessor5
department0-university0-associateprofessor6
department0-university0-associateprofessor7
department0-university0-associateprofessor8
department0-university0-associateprofessor9
department0-university0-associateprofessor10
department0-university0-associateprofessor11
department0-university0-associateprofessor12
department0-university0-associateprofessor13
department1-university0-associateprofessor0
department1-university0-associateprofessor1
department1-university0-associateprofessor2
department1-university0-associateprofessor3
department1-university0-associateprofessor4
department1-university0-associateprofessor5
department1-university0-associateprofessor6
department1-university0-associateprofessor7
department1-university0-associateprofessor8
department1-university0-associateprofessor9
department10-university0-associateprofessor0
department10-university0-associateprofessor1
department10-university0-associateprofessor2
department10-university0-associateprofessor3
department10-university0-associateprofessor4
department10-university0-associateprofessor5
department10-university0-associateprofessor6
department10-university0-associateprofessor7
department10-university0-associateprofessor8
department10-university0-associateprofessor9
department10-university0-associateprofessor10
department11-university0-associateprofessor0
department11-university0-associateprofessor1
department11-university0-associateprofessor2
department11-university0-associateprofessor3
department11-university0-associateprofessor4
department11-university0-associateprofessor5
department11-university0-associateprofessor6
department11-university0-associateprofessor7
department11-university0-associateprofessor8
department11-university0-associateprofessor9
department11-university0-associateprofessor10
department11-university0-associateprofessor11
department11-university0-associateprofessor12
department11-university0-associateprofessor13
department12-university0-associateprofessor0
department12-university0-associateprofessor1
department12-university0-associateprofessor2
department12-university0-associateprofessor3
department12-university0-associateprofessor4
department12-university0-associateprofessor5
department12-university0-associateprofessor6
department12-university0-associateprofessor7
department12-university0-associateprofessor8
department12-university0-associateprofessor9
department12-university0-associateprofessor10
department13-university0-associateprofessor0
department13-university0-associateprofessor1
department13-university0-associateprofessor2
department13-university0-associateprofessor3
department13-university0-associateprofessor4
department13-university0-associateprofessor5
department13-university0-associateprofessor6
department13-university0-associateprofessor7
department13-university0-associateprofessor8
department13-university0-associateprofessor9
department13-university0-associateprofessor10
department13-university0-associateprofessor11
department13-university0-associateprofessor12
department13-university0-associateprofessor13
department14-university0-associateprofessor0
department14-university0-associateprofessor1
department14-university0-associateprofessor2
department14-university0-associateprofessor3
department14-university0-associateprofessor4
department14-university0-associateprofessor5
department14-university0-associateprofessor6
department14-university0-associateprofessor7
department14-university0-associateprofessor8
department14-university0-associateprofessor9
department14-university0-associateprofessor10
department14-university0-associateprofessor11
department2-university0-associateprofessor0
department2-university0-associateprofessor1
department2-university0-associateprofessor2
department2-university0-associateprofessor3
department2-university0-associateprofessor4
department2-university0-associateprofessor5
department2-university0-associateprofessor6
department2-university0-associateprofessor7
department2-university0-associateprofessor8
department2-university0-associateprofessor9
department2-university0-associateprofessor10
department2-university0-associateprofessor11
department3-university0-associateprofessor0
department3-university0-associateprofessor1
department3-university0-associateprofessor2
department3-university0-associateprofessor3
department3-university0-associateprofessor4
department3-university0-associateprofessor5
department3-university0-associateprofessor6
department3-university0-associateprofessor7
department3-university0-associateprofessor8
department3-university0-associateprofessor9
department3-university0-associateprofessor10
department3-university0-associateprofessor11
department4-university0-associateprofessor0
department4-university0-associateprofessor1
department4-university0-associateprofessor2
department4-university0-associateprofessor3
department4-university0-associateprofessor4
department4-university0-associateprofessor5
department4-university0-associateprofessor6
department4-university0-associateprofessor7
department4-university0-associateprofessor8
department4-university0-associateprofessor9
department5-university0-associateprofessor0
department5-university0-associateprofessor1
department5-university0-associateprofessor2
department5-university0-associateprofessor3
department5-university0-associateprofessor4
department5-university0-associateprofessor5
department5-university0-associateprofessor6
department5-university0-associateprofessor7
department5-university0-associateprofessor8
department5-university0-associateprofessor9
department5-university0-associateprofessor10
department6-university0-associateprofessor0
department6-university0-associateprofessor1
department6-university0-associateprofessor2
department6-university0-associateprofessor3
department6-university0-associateprofessor4
department6-university0-associateprofessor5
department6-university0-associateprofessor6
department6-university0-associateprofessor7
department6-university0-associateprofessor8
department6-university0-associateprofessor9
department7-university0-associateprofessor0
department7-university0-associateprofessor1
department7-university0-associateprofessor2
department7-university0-associateprofessor3
department7-university0-associateprofessor4
department7-university0-associateprofessor5
department7-university0-associateprofessor6
department7-university0-associateprofessor7
department7-university0-associateprofessor8
department7-university0-associateprofessor9
department7-university0-associateprofessor10
department7-university0-associateprofessor11
department7-university0-associateprofessor12
department7-university0-associateprofessor13
department8-university0-associateprofessor0
department8-university0-associateprofessor1
department8-university0-associateprofessor2
department8-university0-associateprofessor3
department8-university0-associateprofessor4
department8-university0-associateprofessor5
department8-university0-associateprofessor6
department8-university0-associateprofessor7
department8-university0-associateprofessor8
department8-university0-associateprofessor9
department8-university0-associateprofessor10
department9-university0-associateprofessor0
department9-university0-associateprofessor1
department9-university0-associateprofessor2
department9-university0-associateprofessor3
department9-university0-associateprofessor4
department9-university0-associateprofessor5
department9-university0-associateprofessor6
department9-university0-associateprofessor7
department9-university0-associateprofessor8
department9-university0-associateprofessor9
department0-university0
department1-university0
department10-university0
department11-university0
department12-university0
department13-university0
department14-university0
department2-university0
department3-university0
department4-university0
department5-university0
department6-university0
department7-university0
department8-university0
department9-university0
department0-university0-fullprofessor0
department0-university0-fullprofessor1
department0-university0-fullprofessor2
department0-university0-fullprofessor3
department0-university0-fullprofessor4
department0-university0-fullprofessor5
department0-university0-fullprofessor6
department0-university0-fullprofessor7
department0-university0-fullprofessor8
department0-university0-fullprofessor9
department1-university0-fullprofessor0
department1-university0-fullprofessor1
department1-university0-fullprofessor2
department1-university0-fullprofessor3
department1-university0-fullprofessor4
department1-university0-fullprofessor5
department1-university0-fullprofessor6
department1-university0-fullprofessor7
department1-university0-fullprofessor8
department1-university0-fullprofessor9
department10-university0-fullprofessor0
department10-university0-fullprofessor1
department10-university0-fullprofessor2
department10-university0-fullprofessor3
department10-university0-fullprofessor4
department10-university0-fullprofessor5
department10-university0-fullprofessor6
department11-university0-fullprofessor0
department11-university0-fullprofessor1
department11-university0-fullprofessor2
department11-university0-fullprofessor3
department11-university0-fullprofessor4
department11-university0-fullprofessor5
department11-university0-fullprofessor6
department11-university0-fullprofessor7
department12-university0-fullprofessor0
department12-university0-fullprofessor1
department12-university0-fullprofessor2
department12-university0-fullprofessor3
department12-university0-fullprofessor4
department12-university0-fullprofessor5
department12-university0-fullprofessor6
department12-university0-fullprofessor7
department12-university0-fullprofessor8
department13-university0-fullprofessor0
department13-university0-fullprofessor1
department13-university0-fullprofessor2
department13-university0-fullprofessor3
department13-university0-fullprofessor4
department13-university0-fullprofessor5
department13-university0-fullprofessor6
department13-university0-fullprofessor7
department14-university0-fullprofessor0
department14-university0-fullprofessor1
department14-university0-fullprofessor2
department14-university0-fullprofessor3
department14-university0-fullprofessor4
department14-university0-fullprofessor5
department14-university0-fullprofessor6
department2-university0-fullprofessor0
department2-university0-fullprofessor1
department2-university0-fullprofessor2
department2-university0-fullprofessor3
department2-university0-fullprofessor4
department2-university0-fullprofessor5
department2-university0-fullprofessor6
department3-university0-fullprofessor0
department3-university0-fullprofessor1
department3-university0-fullprofessor2
department3-university0-fullprofessor3
department3-university0-fullprofessor4
department3-university0-fullprofessor5
department3-university0-fullprofessor6
department3-university0-fullprofessor7
department3-university0-fullprofessor8
department4-university0-fullprofessor0
department4-university0-fullprofessor1
department4-university0-fullprofessor2
department4-university0-fullprofessor3
department4-university0-fullprofessor4
department4-university0-fullprofessor5
department4-university0-fullprofessor6
department5-university0-fullprofessor0
department5-university0-fullprofessor1
department5-university0-fullprofessor2
department5-university0-fullprofessor3
department5-university0-fullprofessor4
department5-university0-fullprofessor5
department5-university0-fullprofessor6
department5-university0-fullprofessor7
department5-university0-fullprofessor8
department5-university0-fullprofessor9
department6-university0-fullprofessor0
department6-university0-fullprofessor1
department6-university0-fullprofessor2
department6-university0-fullprofessor3
department6-university0-fullprofessor4
department6-university0-fullprofessor5
department6-university0-fullprofessor6
department6-university0-fullprofessor7
department6-university0-fullprofessor8
department6-university0-fullprofessor9
department7-university0-fullprofessor0
department7-university0-fullprofessor1
department7-university0-fullprofessor2
department7-university0-fullprofessor3
department7-university0-fullprofessor4
department7-university0-fullprofessor5
department7-university0-fullprofessor6
department8-university0-fullprofessor0
department8-university0-fullprofessor1
department8-university0-fullprofessor2
department8-university0-fullprofessor3
department8-university0-fullprofessor4
department8-university0-fullprofessor5
department8-university0-fullprofessor6
department8-university0-fullprofessor7
department8-university0-fullprofessor8
department9-university0-fullprofessor0
department9-university0-fullprofessor1
department9-university0-fullprofessor2
department9-university0-fullprofessor3
department9-university0-fullprofessor4
department9-university0-fullprofessor5
department9-university0-fullprofessor6
department0-university0-lecturer0
department0-university0-lecturer1
department0-university0-lecturer2
department0-university0-lecturer3
department0-university0-lecturer4
department0-university0-lecturer5
department0-university0-lecturer6
department1-university0-lecturer0
department1-university0-lecturer1
department1-university0-lecturer2
department1-university0-lecturer3
department1-university0-lecturer4
department1-university0-lecturer5
department10-university0-lecturer0
department10-university0-lecturer1
department10-university0-lecturer2
department10-university0-lecturer3
department10-university0-lecturer4
department10-university0-lecturer5
department10-university0-lecturer6
department11-university0-lecturer0
department11-university0-lecturer1
department11-university0-lecturer2
department11-university0-lecturer3
department11-university0-lecturer4
department11-university0-lecturer5
department12-university0-lecturer0
department12-university0-lecturer1
department12-university0-lecturer2
department12-university0-lecturer3
department12-university0-lecturer4
department13-university0-lecturer0
department13-university0-lecturer1
department13-university0-lecturer2
department13-university0-lecturer3
department13-university0-lecturer4
department14-university0-lecturer0
department14-university0-lecturer1
department14-university0-lecturer2
department14-university0-lecturer3
department14-university0-lecturer4
department14-university0-lecturer5
department2-university0-lecturer0
department2-university0-lecturer1
department2-university0-lecturer2
department2-university0-lecturer3
department2-university0-lecturer4
department2-university0-lecturer5
department2-university0-lecturer6
department3-university0-lecturer0
department3-university0-lecturer1
department3-university0-lecturer2
department3-university0-lecturer3
department3-university0-lecturer4
department3-university0-lecturer5
department4-university0-lecturer0
department4-university0-lecturer1
department4-university0-lecturer2
department4-university0-lecturer3
department4-university0-lecturer4
department4-university0-lecturer5
department4-university0-lecturer6
department5-university0-lecturer0
department5-university0-lecturer1
department5-university0-lecturer2
department5-university0-lecturer3
department5-university0-lecturer4
department5-university0-lecturer5
department6-university0-lecturer0
department6-university0-lecturer1
department6-university0-lecturer2
department6-university0-lecturer3
department6-university0-lecturer4
department6-university0-lecturer5
department7-university0-lecturer0
department7-university0-lecturer1
department7-university0-lecturer2
department7-university0-lecturer3
department7-university0-lecturer4
department7-university0-lecturer5
department8-university0-lecturer0
department8-university0-lecturer1
department8-university0-lecturer2
department8-university0-lecturer3
department8-university0-lecturer4
department8-university0-lecturer5
department9-university0-lecturer0
department9-university0-lecturer1
department9-university0-lecturer2
department9-university0-lecturer3
department9-university0-lecturer4
department9-university0-lecturer5
department9-university0-lecturer6