/// <summary>
        /// Triggers the execution of the given rule on the given ontology.
        /// Returns a boolean indicating if new evidences have been found.
        /// </summary>
        internal Boolean TriggerRule(String ruleName, RDFOntology ontology, RDFOntologyReasonerReport report)
        {
            var reasonerRule = this.SelectRule(ruleName);

            if (reasonerRule != null)
            {
                //Raise launching signal
                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Launching execution of reasoning rule '{0}'", ruleName));

                //Launch the reasoning rule
                var oldCnt = report.EvidencesCount;
                reasonerRule.ExecuteRule(ontology, report);
                var newCnt = report.EvidencesCount;

                //Raise termination signal
                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Completed execution of reasoning rule '{0}': found {1} new evidences", ruleName, newCnt - oldCnt));

                return(newCnt - oldCnt > 0);
            }
            return(false);
        }
        /// <summary>
        /// Applies the reasoner on the given ontology, producing a reasoning report.
        /// </summary>
        public RDFOntologyReasonerReport ApplyToOntology(ref RDFOntology ontology)
        {
            if (ontology != null)
            {
                var report = new RDFOntologyReasonerReport();
                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Reasoner is going to be applied on Ontology '{0}'", ontology.Value));

                //Expand ontology
                ontology = ontology.UnionWith(RDFBASEOntology.Instance);

                #region Triggers
                //Apply first rules
                this.TriggerRule("EquivalentClassTransitivity", ontology, report);
                this.TriggerRule("SubClassTransitivity", ontology, report);
                this.TriggerRule("DisjointWithEntailment", ontology, report);
                this.TriggerRule("EquivalentPropertyTransitivity", ontology, report);
                this.TriggerRule("SubPropertyTransitivity", ontology, report);
                this.TriggerRule("SameAsTransitivity", ontology, report);
                this.TriggerRule("DifferentFromEntailment", ontology, report);

                //Apply second rules
                this.TriggerRule("DomainEntailment", ontology, report);
                this.TriggerRule("RangeEntailment", ontology, report);
                this.TriggerRule("ClassTypeEntailment", ontology, report);
                this.TriggerRule("InverseOfEntailment", ontology, report);
                this.TriggerRule("SymmetricPropertyEntailment", ontology, report);
                this.TriggerRule("TransitivePropertyEntailment", ontology, report);
                this.TriggerRule("PropertyEntailment", ontology, report);
                this.TriggerRule("SameAsEntailment", ontology, report);
                #endregion

                //Unexpand ontology
                ontology = ontology.DifferenceWith(RDFBASEOntology.Instance);

                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Reasoner has been applied on Ontology '{0}'", ontology.Value));
                return(report);
            }
            throw new RDFSemanticsException("Cannot apply RDFOntologyReasoner because given \"ontology\" parameter is null.");
        }