Commit 32f2d38a authored by Christian Willms's avatar Christian Willms
Browse files

Fix for println() bug

removed system.out.println statements from tests; verbose flag in tuplestore & forwardchainer is set to false
parent 34a43248
...@@ -196,6 +196,23 @@ public final class ForwardChainer { ...@@ -196,6 +196,23 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size(); this.noOfTasks = this.ruleStore.allRules.size();
} }
/**
* generates a new forward chainer with the default namespace for XSD, RDF, RDFS, and OWL
* @throws IOException
* @throws FileNotFoundException
* @throws WrongFormatException
*/
public ForwardChainer(boolean verbose, String tupleFile, String ruleFile)
throws FileNotFoundException, IOException, WrongFormatException {
this();
this.verbose = verbose;
Namespace namespace = new Namespace();
this.tupleStore = new TupleStore(verbose, this.noOfAtoms, this.noOfTuples, namespace, tupleFile);
this.ruleStore = new RuleStore(this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/** /**
* this version allows to explicitly define the namespace * this version allows to explicitly define the namespace
* @throws IOException * @throws IOException
...@@ -212,6 +229,23 @@ public final class ForwardChainer { ...@@ -212,6 +229,23 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size(); this.noOfTasks = this.ruleStore.allRules.size();
} }
/**
* this version allows to explicitly define the namespace
* @throws IOException
* @throws WrongFormatException
* @throws FileNotFoundException
*/
public ForwardChainer(boolean verbose, String tupleFile, String ruleFile, String namespaceFile)
throws FileNotFoundException, WrongFormatException, IOException {
this();
this.verbose = verbose;
Namespace namespace = new Namespace(namespaceFile);
this.tupleStore = new TupleStore(false, this.noOfAtoms, this.noOfTuples, namespace, tupleFile);
this.ruleStore = new RuleStore(this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/** /**
* this version allows to explicitly define the namespace * this version allows to explicitly define the namespace
* @throws IOException * @throws IOException
...@@ -250,6 +284,28 @@ public final class ForwardChainer { ...@@ -250,6 +284,28 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size(); this.noOfTasks = this.ruleStore.allRules.size();
} }
/**
* generates a new forward chainer with the default namespace for XSD, RDF, RDFS, and OWL;
* noOfAtoms and noOfTuples are important parameters that affects the performance of the
* tuple store used by the forward chainer
* @throws IOException
* @throws FileNotFoundException
* @throws WrongFormatException
*/
public ForwardChainer(boolean verbose, int noOfAtoms, int noOfTuples, String tupleFile, String ruleFile)
throws FileNotFoundException, IOException, WrongFormatException {
this();
this.verbose = verbose;
this.noOfAtoms = noOfAtoms;
this.noOfTuples = noOfTuples;
//this.namespace = new Namespace();
this.tupleStore = new TupleStore(verbose, this.noOfAtoms, this.noOfTuples);
this.tupleStore.readTuples(tupleFile);
this.ruleStore = new RuleStore(this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/** /**
* this version allows to explicitly define the namespace * this version allows to explicitly define the namespace
* @throws IOException * @throws IOException
...@@ -268,6 +324,25 @@ public final class ForwardChainer { ...@@ -268,6 +324,25 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size(); this.noOfTasks = this.ruleStore.allRules.size();
} }
/**
* this version allows to explicitly define the namespace
* @throws IOException
* @throws WrongFormatException
* @throws FileNotFoundException
*/
public ForwardChainer(boolean verbose, int noOfAtoms, int noOfTuples, String tupleFile, String ruleFile, String namespaceFile)
throws FileNotFoundException, WrongFormatException, IOException {
this();
this.verbose = verbose;
this.noOfAtoms = noOfAtoms;
this.noOfTuples = noOfTuples;
Namespace namespace = new Namespace(namespaceFile);
this.tupleStore = new TupleStore(verbose, this.noOfAtoms, this.noOfTuples, namespace, tupleFile);
this.ruleStore = new RuleStore(this.tupleStore, ruleFile);
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/** /**
* assumes a default of 100,000 atoms and 500,000 tuples * assumes a default of 100,000 atoms and 500,000 tuples
...@@ -280,6 +355,18 @@ public final class ForwardChainer { ...@@ -280,6 +355,18 @@ public final class ForwardChainer {
this.noOfTasks = this.ruleStore.allRules.size(); this.noOfTasks = this.ruleStore.allRules.size();
} }
/**
* assumes a default of 100,000 atoms and 500,000 tuples
*/
public ForwardChainer(boolean verbose, TupleStore tupleStore, RuleStore ruleStore) {
this();
this.verbose = verbose;
this.tupleStore = tupleStore;
this.ruleStore = ruleStore;
this.threadPool = Executors.newFixedThreadPool(this.noOfCores);
this.noOfTasks = this.ruleStore.allRules.size();
}
/** /**
* more options that will also affect namespace, tuple store, and rule store * more options that will also affect namespace, tuple store, and rule store
* @throws IOException * @throws IOException
......
...@@ -428,6 +428,22 @@ public final class TupleStore { ...@@ -428,6 +428,22 @@ public final class TupleStore {
noOfAtoms, noOfTuples); noOfAtoms, noOfTuples);
} }
/**
* choose a proper noOfAtoms/noOfTuples in order not to arrive at copying (at all or
* too early) the elements into a larger structure; keep in mind that other services
* (e.g., rule application) can drastically increase the number of tuples;
* note: assigns an empty Namespace object to this.namespace
*/
public TupleStore(boolean verbose, int noOfAtoms, int noOfTuples) {
this.namespace = new Namespace();
this.indexStore = null;
this.verbose = verbose;
init(this.verbose, this.rdfCheck, this.equivalenceClassReduction,
this.minNoOfArgs, this.maxNoOfArgs,
this.subjectPosition, this.predicatePosition, this.objectPosition,
noOfAtoms, noOfTuples);
}
/** /**
* extends the binary constructor with the ability to read in a namespace * extends the binary constructor with the ability to read in a namespace
*/ */
...@@ -460,6 +476,25 @@ public final class TupleStore { ...@@ -460,6 +476,25 @@ public final class TupleStore {
readTuples(tupleFile); readTuples(tupleFile);
} }
/**
* extends the binary constructor with the ability to read in a namespace and a
* textual representation of facts (basically N-Triples syntax), stored in a file
* @throws IOException
* @throws WrongFormatException
* @see #readTuples
*/
public TupleStore(boolean verbose, int noOfAtoms, int noOfTuples, Namespace namespace, String tupleFile)
throws IOException, WrongFormatException {
this.verbose = verbose;
this.namespace = namespace;
this.indexStore = null;
init(this.verbose, this.rdfCheck, this.equivalenceClassReduction,
this.minNoOfArgs, this.maxNoOfArgs,
this.subjectPosition, this.predicatePosition, this.objectPosition,
noOfAtoms, noOfTuples);
readTuples(tupleFile);
}
/** /**
* extends the binary constructor with the ability to read in a namespace, a index store, as well as a * extends the binary constructor with the ability to read in a namespace, a index store, as well as a
...@@ -540,6 +575,19 @@ public final class TupleStore { ...@@ -540,6 +575,19 @@ public final class TupleStore {
100000, 500000); 100000, 500000);
} }
/**
* assumes a default of 100,000 atoms and 500,000 tuples
*/
public TupleStore(boolean verbose, Namespace namespace) {
this.verbose = false;
this.namespace = namespace;
this.indexStore = null;
init(this.verbose, this.rdfCheck, this.equivalenceClassReduction,
this.minNoOfArgs, this.maxNoOfArgs,
this.subjectPosition, this.predicatePosition, this.objectPosition,
100000, 500000);
}
/** /**
* assumes a default of 100,000 atoms and 500,000 tuples * assumes a default of 100,000 atoms and 500,000 tuples
* @throws IOException * @throws IOException
...@@ -552,6 +600,18 @@ public final class TupleStore { ...@@ -552,6 +600,18 @@ public final class TupleStore {
readTuples(tupleFile); readTuples(tupleFile);
} }
/**
* assumes a default of 100,000 atoms and 500,000 tuples
* @throws IOException
* @throws FileNotFoundException
* @throws WrongFormatException
*/
public TupleStore(boolean verbose, Namespace namespace, String tupleFile)
throws FileNotFoundException, IOException, WrongFormatException {
this(verbose,namespace);
readTuples(tupleFile);
}
/** /**
* a simple STATIC method, translating an int array into something readable (N-tuple syntax) * a simple STATIC method, translating an int array into something readable (N-tuple syntax)
*/ */
......
...@@ -30,7 +30,7 @@ public class ForwardChainerTest { ...@@ -30,7 +30,7 @@ public class ForwardChainerTest {
//test constructor ForwardChainer(String tupleFile, String ruleFile) //test constructor ForwardChainer(String tupleFile, String ruleFile)
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer(false, tupleFile, ruleFile);
assertNotNull(fc); assertNotNull(fc);
} }
...@@ -40,7 +40,7 @@ public class ForwardChainerTest { ...@@ -40,7 +40,7 @@ public class ForwardChainerTest {
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
String namespaceFile = getTestResource("default.ns"); String namespaceFile = getTestResource("default.ns");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile, namespaceFile); ForwardChainer fc = new ForwardChainer(false,tupleFile, ruleFile, namespaceFile);
assertNotNull(fc); assertNotNull(fc);
} }
...@@ -51,7 +51,7 @@ public class ForwardChainerTest { ...@@ -51,7 +51,7 @@ public class ForwardChainerTest {
int noOfTuples = 2; int noOfTuples = 2;
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(noOfAtoms, noOfTuples, tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer( false,noOfAtoms, noOfTuples, tupleFile, ruleFile);
assertNotNull(fc); assertNotNull(fc);
} }
...@@ -63,7 +63,7 @@ public class ForwardChainerTest { ...@@ -63,7 +63,7 @@ public class ForwardChainerTest {
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
String namespaceFile = getTestResource("default.ns"); String namespaceFile = getTestResource("default.ns");
ForwardChainer fc = new ForwardChainer(noOfAtoms, noOfTuples, tupleFile, ruleFile, namespaceFile); ForwardChainer fc = new ForwardChainer(false, noOfAtoms, noOfTuples, tupleFile, ruleFile, namespaceFile);
assertNotNull(fc); assertNotNull(fc);
} }
...@@ -73,7 +73,7 @@ public class ForwardChainerTest { ...@@ -73,7 +73,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
assertNotNull(fc); assertNotNull(fc);
} }
...@@ -144,7 +144,7 @@ public class ForwardChainerTest { ...@@ -144,7 +144,7 @@ public class ForwardChainerTest {
//test method setNoOfCores(int noOfCores) //test method setNoOfCores(int noOfCores)
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer(false,tupleFile, ruleFile);
fc.setNoOfCores(104); fc.setNoOfCores(104);
assertEquals(fc.noOfCores, 104); assertEquals(fc.noOfCores, 104);
} }
...@@ -154,7 +154,7 @@ public class ForwardChainerTest { ...@@ -154,7 +154,7 @@ public class ForwardChainerTest {
//test method nextBlankNode () that returns an int //test method nextBlankNode () that returns an int
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer(false, tupleFile, ruleFile);
assertEquals(51, fc.nextBlankNode()); assertEquals(51, fc.nextBlankNode());
assertTrue(fc.nextBlankNode() > 0); assertTrue(fc.nextBlankNode() > 0);
} }
...@@ -192,7 +192,7 @@ public class ForwardChainerTest { ...@@ -192,7 +192,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(2, 2, namespace); TupleStore tupleStore = new TupleStore(2, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
//fc.deleteTuple(tuple); Null pointer exception //fc.deleteTuple(tuple); Null pointer exception
} }
...@@ -207,7 +207,7 @@ public class ForwardChainerTest { ...@@ -207,7 +207,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
//fc.deleteTuples(tuples); Null pointer exception //fc.deleteTuples(tuples); Null pointer exception
} }
...@@ -239,12 +239,12 @@ public class ForwardChainerTest { ...@@ -239,12 +239,12 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt")); TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt"));
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc2 = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc2 = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(fc2.computeClosure(1, true), false); assertEquals(fc2.computeClosure(1, true), false);
assertEquals(fc2.computeClosure(1, false), false); assertEquals(fc2.computeClosure(1, false), false);
// //
TupleStore tupleStore1 = new TupleStore(false, true, false, 2, 1, 2, 3, namespace, getTestResource("default.nt")); TupleStore tupleStore1 = new TupleStore(false, true, false, 2, 1, 2, 3, namespace, getTestResource("default.nt"));
ForwardChainer fc3 = new ForwardChainer(tupleStore1, ruleStore); ForwardChainer fc3 = new ForwardChainer(false, tupleStore1, ruleStore);
assertEquals(fc3.computeClosure(2, true), false); assertEquals(fc3.computeClosure(2, true), false);
} }
...@@ -254,7 +254,7 @@ public class ForwardChainerTest { ...@@ -254,7 +254,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt")); TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt"));
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc2 = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc2 = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(fc2.computeClosure(), false); assertEquals(fc2.computeClosure(), false);
} }
...@@ -267,7 +267,7 @@ public class ForwardChainerTest { ...@@ -267,7 +267,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt")); TupleStore tupleStore = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt"));
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
//no tuples were generated, so returns false //no tuples were generated, so returns false
assertEquals(fc.computeClosure(newTuples, noOfIterations, cleanUpRepository), false); assertEquals(fc.computeClosure(newTuples, noOfIterations, cleanUpRepository), false);
//set verbose to false //set verbose to false
...@@ -282,7 +282,7 @@ public class ForwardChainerTest { ...@@ -282,7 +282,7 @@ public class ForwardChainerTest {
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
String namespaceFile = getTestResource("default.ns"); String namespaceFile = getTestResource("default.ns");
ForwardChainer fc1 = new ForwardChainer(noOfCores, verboseF, rdfCheck, eqReduction, minNoOfArgs, maxNoOfArgs, ForwardChainer fc1 = new ForwardChainer( noOfCores, verboseF, rdfCheck, eqReduction, minNoOfArgs, maxNoOfArgs,
noOfAtoms, noOfTuples, tupleFile, ruleFile, namespaceFile); noOfAtoms, noOfTuples, tupleFile, ruleFile, namespaceFile);
assertEquals(fc1.computeClosure(newTuples, noOfIterations, cleanUpRepository), false); assertEquals(fc1.computeClosure(newTuples, noOfIterations, cleanUpRepository), false);
//newTuples not empty: //newTuples not empty:
...@@ -291,7 +291,7 @@ public class ForwardChainerTest { ...@@ -291,7 +291,7 @@ public class ForwardChainerTest {
toadd[0] = 0; toadd[0] = 0;
toadd[1] = 1; toadd[1] = 1;
newTuplesfull.add(toadd); newTuplesfull.add(toadd);
ForwardChainer fc2 = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc2 = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(fc2.computeClosure(newTuplesfull, 1, false), false); assertEquals(fc2.computeClosure(newTuplesfull, 1, false), false);
assertEquals(fc2.computeClosure(newTuplesfull, 1, true), false); assertEquals(fc2.computeClosure(newTuplesfull, 1, true), false);
} }
...@@ -322,7 +322,7 @@ public class ForwardChainerTest { ...@@ -322,7 +322,7 @@ public class ForwardChainerTest {
String filename = getTestResource("default.ns"); String filename = getTestResource("default.ns");
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer(false, tupleFile, ruleFile);
fc.uploadNamespaces(filename); fc.uploadNamespaces(filename);
//TODO create a test //TODO create a test
} }
...@@ -334,7 +334,8 @@ public class ForwardChainerTest { ...@@ -334,7 +334,8 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
tupleStore.verbose = false;
fc.uploadTuples(filename); fc.uploadTuples(filename);
//TODO create a test //TODO create a test
} }
...@@ -351,7 +352,7 @@ public class ForwardChainerTest { ...@@ -351,7 +352,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(false, fc.addTuplesToRepository(tuples)); assertEquals(false, fc.addTuplesToRepository(tuples));
} }
...@@ -363,7 +364,7 @@ public class ForwardChainerTest { ...@@ -363,7 +364,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
fc.addTuples(tuples); fc.addTuples(tuples);
//TODO create a test //TODO create a test
...@@ -381,7 +382,7 @@ public class ForwardChainerTest { ...@@ -381,7 +382,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(false, fc.removeTuplesFromRepository(tuples)); assertEquals(false, fc.removeTuplesFromRepository(tuples));
} }
...@@ -396,7 +397,7 @@ public class ForwardChainerTest { ...@@ -396,7 +397,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(false, fc.deleteTuplesFromRepository(tuples)); assertEquals(false, fc.deleteTuplesFromRepository(tuples));
} }
...@@ -406,7 +407,7 @@ public class ForwardChainerTest { ...@@ -406,7 +407,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
assertEquals(false, fc.computeClosure()); assertEquals(false, fc.computeClosure());
} }
...@@ -427,7 +428,7 @@ public class ForwardChainerTest { ...@@ -427,7 +428,7 @@ public class ForwardChainerTest {
Namespace namespace = new Namespace(getTestResource("default.ns")); Namespace namespace = new Namespace(getTestResource("default.ns"));
TupleStore tupleStore = new TupleStore(1, 2, namespace); TupleStore tupleStore = new TupleStore(1, 2, namespace);
RuleStore ruleStore = new RuleStore(tupleStore); RuleStore ruleStore = new RuleStore(tupleStore);
ForwardChainer fc = new ForwardChainer(tupleStore, ruleStore); ForwardChainer fc = new ForwardChainer(false, tupleStore, ruleStore);
fc.uploadRules(filename); fc.uploadRules(filename);
//TODO create a test //TODO create a test
} }
...@@ -490,7 +491,7 @@ public class ForwardChainerTest { ...@@ -490,7 +491,7 @@ public class ForwardChainerTest {
int levelx = 12900; int levelx = 12900;
String tupleFile = getTestResource("default.nt"); String tupleFile = getTestResource("default.nt");
String ruleFile = getTestResource("default.eqred.rdl"); String ruleFile = getTestResource("default.eqred.rdl");
ForwardChainer fc = new ForwardChainer(tupleFile, ruleFile); ForwardChainer fc = new ForwardChainer(false, tupleFile, ruleFile);
fc.compress(level0); fc.compress(level0);
fc.compress(level1); fc.compress(level1);
fc.compress(level2); fc.compress(level2);
...@@ -508,7 +509,7 @@ public class ForwardChainerTest { ...@@ -508,7 +509,7 @@ public class ForwardChainerTest {
fc.uncompressIndex(); fc.uncompressIndex();
//TODO create a test //TODO create a test
TupleStore tupleconstructor5 = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt")); TupleStore tupleconstructor5 = new TupleStore(false, true, true, 2, 5, 4, 2, namespace, getTestResource("default.nt"));
ForwardChainer fc1 = new ForwardChainer(tupleconstructor5, ruleStore); ForwardChainer fc1 = new ForwardChainer(false, tupleconstructor5, ruleStore);
fc1.uncompressIndex(); fc1.uncompressIndex();
//TODO create a test //TODO create a test
} }
......
...@@ -47,7 +47,7 @@ public class ISumThree { ...@@ -47,7 +47,7 @@ public class ISumThree {
};