Commit fa804739 authored by Christian Willms's avatar Christian Willms
Browse files

fixed inports for LEqualTest

parent 3bcffd33
......@@ -79,13 +79,18 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.1</version>
<version>1.1.0-M1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.1</version>
<version>5.1.0-M1</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.1.0-M1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
......@@ -136,24 +141,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.0.1</version>
<version>5.1.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>4.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.0.1</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
......
......@@ -7,7 +7,7 @@ import static de.dfki.lt.hfc.TestUtils.checkResult;
import static org.junit.jupiter.api.Assertions.*;
public class TestApplicabilityOfAllenRelations {
public class ApplicabilityOfAllenRelationsTest {
static ForwardChainer fcWithIntervalTree_Index;
......
package de.dfki.lt.hfc;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static de.dfki.lt.hfc.TestUtils.checkResult;
public class ConcatenateOne {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("Concatenate1", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("concatenate.nt"), // tuple file
getResource("concatenate.rdl"), // rule file
getResource("concatenate.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
// TODO: FIX EXPECTED DATA
String[][] expected = {
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDFKI GmbH\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDFKI GmbH\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"SRIStanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDFKI\"^^<xsd:string>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"Stanford Research InstituteSRI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDFKI\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDFKI\"^^<xsd:string>" },
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
//TestLGetLatest.printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}
package de.dfki.lt.hfc;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static de.dfki.lt.hfc.TestUtils.checkResult;
public class ConcatenateThree {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("Concatenate3", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("concatenate.nt"), // tuple file
getResource("concatenate.rdl"), // rule file
getResource("concatenate.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
// TODO: FIX EXPECTED DATA
String[][] expected = {
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"SRIStanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDFKI GmbH\"^^<xsd:string>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDFKI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDFKI\"^^<xsd:string>" },
{ "<test:db>", "<test:hasDoubleName>", "\"Daimler BenzDaimler Benz\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDFKI GmbH\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<test:sri>", "<test:hasDoubleName>", "\"Stanford Research InstituteSRI\"^^<xsd:string>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDFKI\"^^<xsd:string>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"Stanford Research InstituteStanford Research Institute\"^^<xsd:string>" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"SRISRI\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDFKI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
//TestLGetLatest.printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}
package de.dfki.lt.hfc;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static de.dfki.lt.hfc.TestUtils.checkResult;
public class ConcatenateTwo {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("Concatenate2", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("concatenate.nt"), // tuple file
getResource("concatenate.rdl"), // rule file
getResource("concatenate.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
// TODO: FIX EXPECTED DATA
String[][] expected = {
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"German Research Center for Artificial InteligenceGerman Research Center for Artificial Inteligence\"^^<xsd:string>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"Stanford Research InstituteStanford Research Institute\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKIDFKI\"^^<xsd:string>" },
{ "<test:sri>", "<test:hasDoubleName>", "\"SRISRI\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"Deutsches Forschungszentrum für Künstliche IntelligenzDeutsches Forschungszentrum für Künstliche Intelligenz\"^^<xsd:string>" },
{ "<test:dfki>", "<test:hasDoubleName>", "\"DFKI GmbHDFKI GmbH\"^^<xsd:string>" },
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}
......@@ -4,7 +4,7 @@ package de.dfki.lt.hfc;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestHfc {
public class HTCTest {
@Test
public void test() {
......
package de.dfki.lt.hfc;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import static de.dfki.lt.hfc.TestUtils.checkResult;
public class ISumOne {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("ISum1", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("isum.nt"), // tuple file
getResource("isum.rdl"), // rule file
getResource("isum.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
// TODO: FIX EXPECTED DATA
String[][] expected = {
{ "<test:dfki>", "<rdf:type>", "<test:Company>" },
{ "<xsd:string>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<owl:Nothing>", "<rdf:type>", "<owl:Class>" },
{ "<test:adder>", "<test:numberOfEmployees>", "\"60500\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"German Research Center for Artificial Inteligence\"@en" },
{ "<owl:Thing>", "<owl:disjointWith>", "<owl:Nothing>" },
{ "<test:db>", "<rdf:type>", "<test:Company>" },
{ "<test:dfki>", "<test:numberOfEmployees>", "\"500\"^^<xsd:int>" },
{ "<test:sri>", "<test:hasName>", "\"Stanford Research Institute\"^^<xsd:string>" },
{ "<test:sri>", "<test:numberOfEmployees>", "\"1000\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI\"^^<xsd:string>" },
{ "<owl:Thing>", "<rdf:type>", "<owl:Class>" },
{ "<test:sri>", "<rdf:type>", "<test:Company>" },
{ "<test:db>", "<test:numberOfEmployees>", "\"60000\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"Deutsches Forschungszentrum für Künstliche Intelligenz\"@de" },
{ "<xsd:int>", "<rdf:type>", "<rdfs:Datatype>" },
{ "<test:sri>", "<test:hasName>", "\"SRI\"^^<xsd:string>" },
{ "<owl:Nothing>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:adder>", "<rdf:type>", "<owl:Thing>" },
{ "<test:adder>", "<test:numberOfEmployees>", "\"61000\"^^<xsd:int>" },
{ "<test:dfki>", "<test:hasName>", "\"DFKI GmbH\"^^<xsd:string>" },
{ "<test:Company>", "<rdfs:subClassOf>", "<owl:Thing>" },
{ "<test:db>", "<test:hasName>", "\"Daimler Benz\"^^<xsd:string>" },
{ "<test:adder>", "<test:numberOfEmployees>", "\"1500\"^^<xsd:int>" },
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
//TestLGetLatest.printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}
......@@ -2,9 +2,9 @@ package de.dfki.lt.hfc;
import de.dfki.lt.hfc.runnable.Utils;
import org.junit.After;
import org.junit.Before;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import static de.dfki.lt.hfc.runnable.Utils.checkResult;
......@@ -15,7 +15,8 @@ public class ISumOneTest {
private static String getResource(String name) {
return Utils.getTestResource("ISum1", name);
}
@BeforeAll
@Before
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
......@@ -75,7 +76,7 @@ public class ISumOneTest {
checkResult(expected, bt, bt.getVars());
}
@AfterAll
@After
public static void finish() {
fc.shutdownNoExit();
}
......
package de.dfki.lt.hfc;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static de.dfki.lt.hfc.TestUtils.printExpected;
public class ISumThree {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("ISum3", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("isum.nt"), // tuple file
getResource("isum.rdl"), // rule file
getResource("isum.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
// TODO: FIX EXPECTED DATA
String[][] expected = {
//no table in the output
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
// printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
//checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}
......@@ -16,6 +16,7 @@ public class ISumTwoTest {
private static String getResource(String name) {
return TestUtils.getTestResource("ISum2", name);
}
@BeforeAll
public static void init() throws Exception {
......@@ -74,7 +75,6 @@ public class ISumTwoTest {
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
//TestUtils.printExpected(bt, fc.tupleStore); // TODO: THIS SHOULD BE REMOVED WHEN FINISHED
checkResult(expected, bt, bt.getVars());
}
......
package de.dfki.lt.hfc;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static de.dfki.lt.hfc.runnable.Utils.checkResult;
import static de.dfki.lt.hfc.runnable.Utils.printExpected;
public class NoValue {
static ForwardChainer fc;
private static String getResource(String name) {
return TestUtils.getTestResource("NoValue", name);
}
@BeforeAll
public static void init() throws Exception {
fc = new ForwardChainer(4, // #cores
false, // verbose
true, // RDF Check
false, // EQ reduction disabled
3, // min #args
3, // max #args
100000, // #atoms
500000, // #tuples
getResource("novalue.nt"), // tuple file
getResource("novalue.rdl"), // rule file
getResource("novalue.ns") // namespace file
);
// compute deductive closure
fc.computeClosure();
}
@Test
public void test() throws QueryParseException {
String[][] expected = {
//tuple too short
};
Query q = new Query(fc.tupleStore);
BindingTable bt = q.query("SELECT ?s ?p ?o WHERE ?s ?p ?o");
checkResult(expected, bt, bt.getVars());
}
@AfterAll
public static void finish() {
fc.shutdownNoExit();
}
}