Skip to content

Commit fadf77f

Browse files
committed
SLight code cleanups
1 parent 8ff7456 commit fadf77f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

OWLSharp/Reasoner/OWLReasoner.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public async Task<List<OWLInference>> ApplyToOntologyAsync(OWLOntology ontology,
7373
Rules = Rules.Distinct().ToList();
7474

7575
#region Execute
76-
OWLEvents.RaiseInfo($"Launching OWL2/SWRL reasoner on ontology '{ontology.IRI}'...");
76+
OWLEvents.RaiseInfo($"Launching reasoner on ontology '{ontology.IRI}'...");
7777

7878
#region Init registry & context
7979
//Initialize inference registry
@@ -259,15 +259,15 @@ await Task.WhenAll(clsAsnAxiomsTask, dtPropAsnAxiomsTask, opPropAsnAxiomsTask, s
259259
inferences.AddRange(inferenceRegistry.SelectMany(ir => ir.Value ?? emptyInferenceSet).Distinct());
260260
#endregion
261261

262-
OWLEvents.RaiseInfo($"Completed OWL2/SWRL reasoner on ontology '{ontology.IRI}' => {inferences.Count} inferences");
262+
OWLEvents.RaiseInfo($"Completed reasoner on ontology '{ontology.IRI}' => {inferences.Count} inferences");
263263
#endregion
264264

265265
#region Iterate
266266
if (reasonerOptions.EnableIterativeReasoning
267267
&& inferences.Count > 0
268268
&& reasonerOptions.CurrentIteration < reasonerOptions.MaxAllowedIterations)
269269
{
270-
OWLEvents.RaiseInfo($"Merging inferences into ontology '{ontology.IRI}' (iteration: {reasonerOptions.CurrentIteration})...");
270+
OWLEvents.RaiseInfo($"Merging inferences (iteration: {reasonerOptions.CurrentIteration})...");
271271
foreach (IGrouping<Type,OWLInference> inferenceGroupType in inferences.GroupBy(inf => inf.Axiom.GetType()))
272272
{
273273
switch (inferenceGroupType.Key.BaseType?.Name)
@@ -294,7 +294,6 @@ await Task.WhenAll(clsAsnAxiomsTask, dtPropAsnAxiomsTask, opPropAsnAxiomsTask, s
294294
break;
295295
}
296296
}
297-
OWLEvents.RaiseInfo($"Completed merging of inferences into ontology '{ontology.IRI}' (iteration: {reasonerOptions.CurrentIteration})");
298297

299298
reasonerOptions.CurrentIteration++;
300299
inferences.AddRange(await ApplyToOntologyAsync(ontology, reasonerOptions));

OWLSharp/Validator/OWLValidator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public OWLValidator AddRule(OWLEnums.OWLValidatorRules rule)
5959
public Task<List<OWLIssue>> ApplyToOntologyAsync(OWLOntology ontology)
6060
{
6161
List<OWLIssue> issues = new List<OWLIssue>();
62-
Rules = Rules.Distinct().ToList();
6362

6463
if (ontology != null)
6564
{
66-
OWLEvents.RaiseInfo($"Launching OWL2 validator on ontology '{ontology.IRI}'...");
65+
OWLEvents.RaiseInfo($"Launching validator on ontology '{ontology.IRI}'...");
6766

6867
#region Init registry & context
6968
//Initialize issue registry
7069
Dictionary<string, List<OWLIssue>> issueRegistry = new Dictionary<string, List<OWLIssue>>(Rules.Count);
70+
Rules = Rules.Distinct().ToList();
7171
Rules.ForEach(rule => issueRegistry.Add(rule.ToString(), null));
7272
#endregion
7373

@@ -179,7 +179,7 @@ public Task<List<OWLIssue>> ApplyToOntologyAsync(OWLOntology ontology)
179179
issues.AddRange(issueRegistry.SelectMany(ir => ir.Value ?? emptyIssueSet));
180180
#endregion
181181

182-
OWLEvents.RaiseInfo($"Completed OWL2 validator on ontology {ontology.IRI} => {issues.Count} issues");
182+
OWLEvents.RaiseInfo($"Completed validator on ontology {ontology.IRI} => {issues.Count} issues");
183183
}
184184

185185
return Task.FromResult(issues);

0 commit comments

Comments
 (0)