this.result = spvi.getResult();
this.rootNode.deleteParents();
this.rootNode.setParents();
this.rootNode.detectCycles();
this.rootNode.sendMessage(new BoundVariablesMessage());
final DebugContainer<BasicOperatorByteArray> dc = new DebugContainer<BasicOperatorByteArray>(
"Before a possible correction of the operator graph...",
"correctoperatorgraphPackageDescription",
BasicOperatorByteArray.getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance));
final CorrectOperatorgraphRulePackage recog = new CorrectOperatorgraphRulePackage();
final List<DebugContainer<BasicOperatorByteArray>> correctOperatorGraphRules = recog
.applyRulesDebugByteArray(this.rootNode, prefixInstance);
correctOperatorGraphRules.add(0, dc);
if (this.rdfs != RDFS.NONE) {
for (final PatternMatcher zpm : this.patternMatchers) {
final RDFSRoot ic = new RDFSRoot();
if (this.rdfs == RDFS.RDFS || this.rdfs == RDFS.OPTIMIZEDRDFS) {
if (this.externalOntology != null) {
RDFSchemaInference.addInferenceRulesForInstanceData(ic,
zpm);
} else {
RDFSchemaInference.addInferenceRules(ic, zpm);
}
} else if (this.rdfs == RDFS.RUDIMENTARYRDFS
|| this.rdfs == RDFS.OPTIMIZEDRUDIMENTARYRDFS) {
if (this.externalOntology != null) {
RudimentaryRDFSchemaInference
.addInferenceRulesForInstanceData(ic, zpm);
} else {
RudimentaryRDFSchemaInference
.addInferenceRules(ic, zpm);
}
} else if (this.rdfs == RDFS.ALTERNATIVERDFS
|| this.rdfs == RDFS.OPTIMIZEDALTERNATIVERDFS) {
if (this.externalOntology != null) {
AlternativeRDFSchemaInference
.addInferenceRulesForInstanceData(ic, zpm);
} else {
AlternativeRDFSchemaInference
.addInferenceRules(ic, zpm);
}
}
ic.addToPatternMatcher(zpm);
zpm.deleteParents();
zpm.setParents();
zpm.detectCycles();
zpm.sendMessage(new BoundVariablesMessage());
correctOperatorGraphRules
.add(new DebugContainer<BasicOperatorByteArray>(
"After adding RDFS inference rules to the operator graph...",
"AddRDFSInferenceRules", BasicOperatorByteArray
.getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance)));
if (this.externalOntology != null) {
this.precompileExternalOntology(zpm);
correctOperatorGraphRules
.add(new DebugContainer<BasicOperatorByteArray>(
"After the precomilation of RDFS inference rules to the operator graph...",
"PrecompileRDFSInferenceRules",
BasicOperatorByteArray
.getBasicOperatorByteArray(this.rootNode.deepClone(), prefixInstance)));
zpm.deleteParents();
zpm.setParents();
zpm.detectCycles();
zpm.sendMessage(new BoundVariablesMessage());
final ExternalOntologyRuleEngine eore = new ExternalOntologyRuleEngine();
correctOperatorGraphRules
.addAll(eore.applyRulesDebugByteArray(zpm,
prefixInstance));
}