예제 #1
0
        /// <summary>
        /// Validate the given ontology against a set of RDFS/OWL-DL rules, detecting errors and inconsistencies affecting its model and data.
        /// </summary>
        public static RDFOntologyValidatorReport Validate(this RDFOntology ontology)
        {
            var report = new RDFOntologyValidatorReport();

            if (ontology != null)
            {
                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Validator is going to be applied on Ontology '{0}'...", ontology.Value));

                //STEP 1: Expand ontology
                var expOntology = ontology.UnionWith(RDFBASEOntology.Instance);

                //STEP 2: Execute rules
                Parallel.ForEach(Rules, rule => {
                    report.MergeEvidences(rule.ExecuteRule(expOntology));
                });

                RDFSemanticsEvents.RaiseSemanticsInfo(String.Format("Validator has been applied on Ontology '{0}': found " + report.EvidencesCount + " evidences.", ontology.Value));
            }
            return(report);
        }
예제 #2
0
 /// <summary>
 /// Merges the evidences of the given report
 /// </summary>
 internal void MergeEvidences(RDFOntologyValidatorReport report)
 {
     lock (this.SyncLock) {
         this.Evidences.AddRange(report.Evidences);
     }
 }