}
Demo_Applet.this.ruleApplicationsForMaterialization = null;
Demo_Applet.this.materializationInfo = null;
Demo_Applet.this.inferenceRules = ((SPARQLINFERENCE)Demo_Applet.this.comboBox_sparqlInference.getSelectedItem()).getRuleSet(Demo_Applet.this.rulesets);
if(Demo_Applet.this.inferenceRules != null){
final BasicIndexRuleEvaluator birqe = new BasicIndexRuleEvaluator((CommonCoreQueryEvaluator<Node>)this.evaluator);
birqe.compileQuery(Demo_Applet.this.inferenceRules);
Demo_Applet.this.materializationInfo = new RIFDebugViewerCreator(Demo_Applet.this.webdemo != DEMO_ENUM.ECLIPSE, Demo_Applet.this.prefixInstance, Demo_Applet.this.usePrefixes,
new RulesGetter(){
@Override
public List<DebugContainer<BasicOperatorByteArray>> getRuleApplications() {
return Demo_Applet.this.ruleApplications;
}
}, Demo_Applet.getIcon(Demo_Applet.this.webdemo), birqe.getCompilationUnit(), birqe.getDocument());
// TODO improve RIF logical optimization such that it is fast enough for large operator graphs!
// as workaround here only use the logical optimization of the underlying evaluator!
System.out.println("Logical optimization...");
if (Demo_Applet.this.ruleApplicationsForMaterialization != null) {
Demo_Applet.this.ruleApplicationsForMaterialization.addAll(this.evaluator.logicalOptimizationDebugByteArray(Demo_Applet.this.prefixInstance));
} else {
Demo_Applet.this.ruleApplicationsForMaterialization = this.evaluator.logicalOptimizationDebugByteArray(Demo_Applet.this.prefixInstance);
}
System.out.println("Physical optimization...");
if (Demo_Applet.this.ruleApplicationsForMaterialization != null) {
Demo_Applet.this.ruleApplicationsForMaterialization.addAll(birqe.physicalOptimizationDebugByteArray(Demo_Applet.this.prefixInstance));
} else {
Demo_Applet.this.ruleApplicationsForMaterialization = birqe.physicalOptimizationDebugByteArray(Demo_Applet.this.prefixInstance);
}
if(Demo_Applet.this.comboBox_sparqlInferenceMaterialization.getSelectedItem() == SPARQLINFERENCEMATERIALIZATION.MATERIALIZEALL){
Demo_Applet.this.errorsInOntology = birqe.inferTriplesAndStoreInDataset();
} else {
this.rootInference = birqe.getRootNode();
this.resultInference = birqe.getResultOperator();
}
}
}