public void RuleML086SaveRuleBase() { IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML086DatalogAdapter(ruleFilesFolder + "endlessloop.ruleml", FileAccess.Read)); ie.SaveRuleBase(new RuleML086DatalogAdapter(outFile, FileAccess.Write)); // for now, compare only the size Assert.IsTrue(AreXmlOfSameLength(ruleFilesFolder + "endlessloop.ruleml", outFile), "Same XML size"); }
public void RuleML08SaveRuleBase() { IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML08DatalogAdapter(ruleFilesFolder + "discount.ruleml", FileAccess.Read)); ie.SaveRuleBase(new RuleML08DatalogAdapter(outFile, FileAccess.Write)); // for now, let's reload the rulebase ie.LoadRuleBase(new RuleML08DatalogAdapter(outFile, FileAccess.Read)); }
public void RuleML086SaveRuleBase() { IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML086DatalogAdapter(ruleFilesFolder + "endlessloop.ruleml", FileAccess.Read)); ie.SaveRuleBase(new RuleML086DatalogAdapter(outFile, FileAccess.Write)); ie.LoadRuleBase(new RuleML086DatalogAdapter(outFile, FileAccess.Read)); Assert.IsTrue(AreSameXml(ruleFilesFolder + "endlessloop.ruleml", outFile), "Same XML"); }
public void RuleMLNaf09SaveRuleBase() { string inFile = ruleFilesFolder + "test-0_9.ruleml"; IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML09NafDatalogAdapter(inFile, FileAccess.Read)); ie.SaveRuleBase(new RuleML09NafDatalogAdapter(outFile, FileAccess.Write)); // for now, compare only the size Assert.IsTrue(AreXmlOfSameLength(inFile, outFile), "Same XML size"); }
public void RuleMLNaf091SaveRuleBase() { string inFile = ruleFilesFolder + "test-0_91.ruleml"; IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML091NafDatalogAdapter(inFile, FileAccess.Read)); ie.SaveRuleBase(new RuleML091NafDatalogAdapter(outFile, FileAccess.Write)); ie.LoadRuleBase(new RuleML091NafDatalogAdapter(outFile, FileAccess.Read)); Assert.IsTrue(AreSameXml(inFile, outFile), "Same XML: " + inFile + " and " + outFile); }
public void HRFSaveRuleBase() { IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new HRF086Adapter(ruleFilesFolder + "gedcom-relations.hrf", FileAccess.Read)); ie.SaveRuleBase(new HRF086Adapter(outFileHRF, FileAccess.Write)); IInferenceEngine ie2 = new IEImpl(); ie2.LoadRuleBase(new HRF086Adapter(outFileHRF, FileAccess.Read)); Assert.AreEqual(ie.Direction, ie2.Direction, "Same Direction"); Assert.AreEqual(ie.Label, ie2.Label, "Same Label"); }
protected string GenerateRuleFile(string inFile, SaveFormatAttributes sfa) { string outFile = outFilesFolder + sfa.ToString().ToLower() + "-" + inFile; FileInfo fi = new FileInfo(outFile); if (fi.Exists) fi.Delete(); IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML09NafDatalogAdapter(ruleFilesFolder + inFile, FileAccess.Read)); ie.SaveRuleBase(new RuleML09NafDatalogAdapter(outFile, FileAccess.Write, sfa)); Console.Out.WriteLine("Generated: {0}", outFile); return outFile; }
private void PerformSaveTest(string ruleFile, SaveFormatAttributes sfa) { string inFile = ruleFilesFolder + ruleFile; string outFile = outFilesFolder + "outtest.ruleml"; FileInfo fi = new FileInfo(outFile); if (fi.Exists) { fi.Delete(); } IInferenceEngine ie = new IEImpl(); ie.LoadRuleBase(new RuleML09NafDatalogAdapter(inFile, FileAccess.Read)); ie.SaveRuleBase(new RuleML09NafDatalogAdapter(outFile, FileAccess.Write, sfa)); Assert.IsTrue(TestAdapter.AreSameXml(inFile, outFile), "Same XML file lengths"); }