コード例 #1
0
        public void SR15BUG()
        {
            var reasoner     = new CogniPySvr();
            var ontologyPath = Path.Combine(AssemblyDirectory, "TestFiles", "TestOntology.encnl");

            reasoner.LoadCnl(ontologyPath, true, true);

            const string concept = "reputational-risk-network-component";

            var instances = reasoner.GetInstancesOf(concept, false);

            var descriptionsBeforeDeletion = reasoner.DescribeInstancesByName(instances);

            var toDel = new List <string>
            {
                "Deal-Criteria-14 is a deal-criteria.",
                "Deal-Criteria-11 is a deal-criteria.",
                "Deal-Criteria-26 is a deal-criteria.",
                "Deal-Criteria-8 is a deal-criteria.",
                "Deal-Criteria-2 is a deal-criteria.",
                "Deal-Criteria-20 is a deal-criteria.",
                "Deal-Criteria-23 is a deal-criteria.",
                "Deal-Criteria-5 is a deal-criteria.",
                "Deal-Criteria-17 is a deal-criteria."
            };

            reasoner.KnowledgeDelete(string.Join("\r\n", toDel), true);

            var descriptionsAfterDeletion = reasoner.DescribeInstancesByName(instances);
        }
コード例 #2
0
        public void StrageBug2a2BUG()
        {
            var reasoner = new CogniPySvr();

            reasoner.LoadCnlFromString("Bubu influences-with-weight-of-1 Dudu.", true, true);
            var toDel = "Bubu influence-with-weight-of-1 Dudu.";

            reasoner.KnowledgeDelete(toDel, true);
            var cnl = reasoner.ToCNL(false);
        }
コード例 #3
0
        public void RemoveCnl()
        {
            var feClient = new CogniPySvr();
            // reason the new context
            var CnlContent  = "John is a man.\r\nEvery man is a human-being.\r\n Every human-being has-name equal-to 'aaa'.\r\n";
            var CnlToRemove = new List <string>()
            {
                "John is a man."
                //,                    "Every man is a human-being."
            };

            feClient.LoadCnlFromString(CnlContent, true, true);
            feClient.KnowledgeDelete(string.Join("\r\n", CnlToRemove), false);
            var mergedCnl = feClient.ToCNLList(true, true, true);

            foreach (var cnl in CnlToRemove)
            {
                Assert.IsTrue(!mergedCnl.Any(x => x == cnl));
            }
            Assert.AreEqual(3, mergedCnl.Count());
        }