예제 #1
0
        /// <summary>
        /// Gets the Knowledge Base with the given Name
        /// </summary>
        /// <param name="name">Knowledge Base Name</param>
        /// <returns>
        /// </returns>
        public KnowledgeBase GetKnowledgeBase(String name)
        {
            KnowledgeBase kb = this._kbs.FirstOrDefault(k => k.Name.Equals(name));

            if (kb != null)
            {
                return(kb);
            }
            throw new RdfReasoningException("This Pellet Server does not contain a Knowledge Base named '" + name + "'");
        }
예제 #2
0
 /// <summary>
 /// Creates a new Pellet Reasoner
 /// </summary>
 /// <param name="server">Pellet Server</param>
 /// <param name="kbName">Knowledge Base name</param>
 public PelletReasoner(PelletServer server, String kbName)
 {
     this._server = server;
     if (this._server.HasKnowledgeBase(kbName))
     {
         this._kb = this._server.GetKnowledgeBase(kbName);
     }
     else
     {
         throw new RdfReasoningException("Cannot create a Pellet Reasoner for the Knowledge Base named '" + kbName + "' as this Server does not have the named Knowledge Base");
     }
 }