/// <summary> /// Returns whether the underlying knowledge base is consistent /// </summary> /// <returns></returns> public bool IsConsistent() { Type svcType = typeof(ConsistencyService); if (_kb.SupportsService(svcType)) { ConsistencyService svc = (ConsistencyService)_kb.GetService(svcType); return(svc.IsConsistent()); } else { throw new NotSupportedException("The Knowledge Base does not support the Consistency service"); } }
public void PelletConsistency() { PelletServer server = new PelletServer(PelletTestServer); Type svcType = typeof(ConsistencyService); foreach (KnowledgeBase kb in server.KnowledgeBases) { if (kb.SupportsService(svcType)) { Console.WriteLine(kb.Name + " supports Consistency"); ConsistencyService svc = (ConsistencyService)kb.GetService(svcType); Console.WriteLine("Consistency: " + svc.IsConsistent().ToString()); } else { Console.WriteLine(kb.Name + " does not support the Consistency Service"); } Console.WriteLine(); } }