Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions admin-ui/src/main/java/eu/knowledge/engine/admin/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ public static String getProperty(Model m, Resource r, String propertyURI) {

public static List<Connection> createConnectionObjects(RuleNode rn) {

System.out.println(rn.toString());

Queue<RuleNode> queue = new LinkedList<RuleNode>();
queue.add(rn);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ public void testConnections() throws InterruptedException {
ArrayList<eu.knowledge.engine.admin.model.SmartConnector> list = new ArrayList<>();
Collections.addAll(list, result);

System.out.println(list);

assertNotNull(list);
assertEquals(2, list.size());

Expand Down
2 changes: 1 addition & 1 deletion examples/dcat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
KE_RUNTIME_EXPOSED_URL: http://runtime-4:8081
KD_URL: http://knowledge-directory:8282
KE_REASONER_LEVEL: 5
JAVA_TOOL_OPTIONS: "-Dorg.slf4j.simpleLogger.log.eu.knowledge.engine=info"
JAVA_TOOL_OPTIONS: "-Dorg.slf4j.simpleLogger.log.eu.knowledge.engine=trace"
meta-kb:
build: meta-kb
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ public TaskBoard execute(BindingSet bindingSet) {
Set<RuleNode> changed = new HashSet<>();

do {
LOG.trace("New round.");
stack.clear();
visited.clear();
changed.clear();
Expand Down Expand Up @@ -394,6 +393,8 @@ public TaskBoard execute(BindingSet bindingSet) {
}
} while (!changed.isEmpty());

LOG.trace("Finished reasoning round with {} tasks.", taskBoard.getNrOfTasks());

this.done = !taskBoard.hasTasks();
return taskBoard;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public boolean hasTasks() {
public boolean hasTask(RuleNode node) {
return this.tasks.contains(node);
}

public int getNrOfTasks() {
return this.tasks.size();
}

/**
* Executes all tasks that are on the taskboard and returns a future that is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ public TripleVarBindingSet combine(TripleVarBindingSet aBindingSet) {
Set<Var> vars2 = aBindingSet.getVariables();
overlappingVars.addAll(vars1);
overlappingVars.retainAll(vars2);
LOG.trace("Overlapping vars found: {} - {} = {}", vars1, vars2, overlappingVars);
}

// Cartesian product is the base case
Expand Down Expand Up @@ -438,7 +437,7 @@ else if (tn.nodeIdx == 2)

table.append("\n");
}
System.out.println(table.toString());
LOG.info("{}", table.toString());
}

private String formatNode(Node n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,13 @@ private TripleVarBindingSet combineWithCombiMatches(Set<TriplePattern> aGraphPat

someCombiMatches.stream().forEach(cMatch -> {
i.incrementAndGet();
LOG.trace("Creating binding set for combi match: {}/{}", i.get(), size);
LOG.trace("Creating binding set for combi match of {} rules: {}/{}", cMatch.size(), i.get(), size);

// keep separate binding set per combi match
var cMatchTVBS = new TripleVarBindingSet(aGraphPattern);

for (Entry<BaseRule, Set<Match>> cEntry : cMatch.entrySet()) {

BaseRule aNeighborRule = cEntry.getKey();

Map<Match, TripleVarBindingSet> matchToBS = someNeighborBS.get(aNeighborRule);

if (matchToBS != null) {
Expand Down Expand Up @@ -171,7 +169,7 @@ public TripleVarBindingSet get() {
if (this.combiMatches != null)
this.cache = this.combineWithCombiMatches(this.graphPattern, this.combiMatches, this.neighborBindingSet);
else {
LOG.trace("Ignoring combi matches for binding set construction in {}.");
LOG.trace("Ignoring combi matches for binding set construction in {}.", this.graphPattern);
TripleVarBindingSet combinedBS = new TripleVarBindingSet(graphPattern);

for (TripleVarBindingSet bs : this.neighborBindingSet.values().stream().map(x -> x.values())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void testRequestNonExistingData() throws InterruptedException, ExecutionE
// Start reasoning
ReasonerPlan root = new ReasonerPlan(aStore, requestNonExistingDataRule);

System.out.println(root);
LOG.info("{}", root);

aStore.printGraphVizCode(root);

Expand All @@ -353,7 +353,7 @@ public void testRequestNonExistingData() throws InterruptedException, ExecutionE
}

BindingSet bind = root.getResults();
System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(isEmpty(bind));

}
Expand Down Expand Up @@ -385,7 +385,7 @@ public void testConverter() throws InterruptedException, ExecutionException {
}
BindingSet result = plan.getResults();

System.out.println("bindings: " + result);
LOG.info("bindings: {}", result);
assertFalse(result.isEmpty());

}
Expand All @@ -394,7 +394,7 @@ public void testConverter() throws InterruptedException, ExecutionException {
public void testMoreThanOneInputBinding() throws InterruptedException, ExecutionException {

ReasonerPlan root = new ReasonerPlan(store, moreThanOneInputBindingRule);
System.out.println(root);
LOG.info("{}", root);

BindingSet bs = new BindingSet();
Binding binding = new Binding();
Expand All @@ -411,7 +411,7 @@ public void testMoreThanOneInputBinding() throws InterruptedException, Execution
}
BindingSet bind = root.getResults();

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertFalse(isEmpty(bind));

}
Expand All @@ -420,7 +420,7 @@ public void testMoreThanOneInputBinding() throws InterruptedException, Execution
public void testMoreThanOneInputBinding2() throws InterruptedException, ExecutionException {

ReasonerPlan root = new ReasonerPlan(store, moreThanOneInputBinding2Rule);
System.out.println(root);
LOG.info("{}", root);

BindingSet bs = new BindingSet();
Binding binding = new Binding();
Expand All @@ -437,7 +437,7 @@ public void testMoreThanOneInputBinding2() throws InterruptedException, Executio
}
BindingSet bind = root.getResults();

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertFalse(bind.isEmpty());

}
Expand All @@ -446,7 +446,7 @@ public void testMoreThanOneInputBinding2() throws InterruptedException, Executio
public void testTwoPropsToAndFromTheSameVars() throws InterruptedException, ExecutionException {

ReasonerPlan root = new ReasonerPlan(store, twoPropsToAndFromTheSameVarsRule);
System.out.println(root);
LOG.info("{}", root);

BindingSet bs = new BindingSet();
// Binding binding = new Binding();
Expand All @@ -464,7 +464,7 @@ public void testTwoPropsToAndFromTheSameVars() throws InterruptedException, Exec
}
BindingSet bind = root.getResults();

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(isEmpty(bind));
}

Expand Down Expand Up @@ -506,15 +506,15 @@ public void testVariableMatchesLiteralInGraphPattern() throws InterruptedExcepti
}
BindingSet bind = root.getResults();

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(!bind.isEmpty());
}

@Test
public void testVariableAsPredicate() throws InterruptedException, ExecutionException {
ReasonerPlan root = new ReasonerPlan(store, variableAsPredicateRule);

System.out.println(root);
LOG.info("{}", root);

BindingSet bs = new BindingSet();
Binding binding2 = new Binding();
Expand All @@ -525,9 +525,9 @@ public void testVariableAsPredicate() throws InterruptedException, ExecutionExce
tb.executeScheduledTasks().get();
}
BindingSet bind = root.getResults();
System.out.println(root);
LOG.info("{}", root);

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(!bind.isEmpty());
}

Expand All @@ -547,16 +547,16 @@ public void testVariableAsPredicate2() throws InterruptedException, ExecutionExc
}
BindingSet bind = root.getResults();

System.out.println(root);
LOG.info("{}", root);

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(!bind.isEmpty()); // TODO THIS ONE SHOULD CONTAIN ONLY sensor1
}

@Test
public void testAllTriples() throws InterruptedException, ExecutionException {
ReasonerPlan root = new ReasonerPlan(store, allTriplesRule);
System.out.println(root);
LOG.info("{}", root);

// empty binding is necessary
BindingSet bs = new BindingSet();
Expand All @@ -569,9 +569,9 @@ public void testAllTriples() throws InterruptedException, ExecutionException {
}
BindingSet bind = root.getResults();

System.out.println(root);
LOG.info("{}", root);

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertTrue(!bind.isEmpty());
}

Expand Down Expand Up @@ -653,7 +653,7 @@ public void jenaForwardTest() throws InterruptedException, ExecutionException, P

while (iter.hasNext()) {
Statement st = iter.next();
System.out.println(st);
LOG.info("{}", st);
}
assertEquals(7, rp.getResults().size()); // TODO make this assert more specific

Expand Down Expand Up @@ -734,7 +734,7 @@ public void jenaForwardTest2() throws InterruptedException, ExecutionException,

while (iter.hasNext()) {
Statement st = iter.next();
System.out.println(st);
LOG.info("{}", st);
}
assertEquals(5, rp.getResults().size()); // TODO make this assert more specific

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import eu.knowledge.engine.reasoner.ProactiveRule;
import eu.knowledge.engine.reasoner.ReasonerPlan;
import eu.knowledge.engine.reasoner.Rule;
import eu.knowledge.engine.reasoner.TaskBoard;
import eu.knowledge.engine.reasoner.api.Binding;
import eu.knowledge.engine.reasoner.api.BindingSet;
import eu.knowledge.engine.reasoner.api.TriplePattern;
Expand All @@ -36,6 +34,8 @@ public class DomainKnowledgeTest {

private static RuleStore store;

private static final Logger LOG = LoggerFactory.getLogger(DomainKnowledgeTest.class);

@BeforeAll
public static void setup() {
store = new RuleStore();
Expand Down Expand Up @@ -102,7 +102,6 @@ public void testSubClassOf() throws InterruptedException, ExecutionException {
Binding binding2 = new Binding();
bs.add(binding2);


TaskBoard tb;
while ((tb = plan.execute(bs)).hasTasks()) {
tb.executeScheduledTasks().get();
Expand All @@ -111,7 +110,7 @@ public void testSubClassOf() throws InterruptedException, ExecutionException {

BindingSet bind = plan.getResults();

System.out.println("bindings: " + bind);
LOG.info("bindings: {}", bind);
assertFalse(bind.isEmpty());

}
Expand Down
Loading
Loading