public void IsEmptyAfterClear() { TripleStore store = MakeTripleStoreWithOneDummyStatement(); store.Clear(); Assert.IsTrue(store.IsEmpty()); }
public void IsEmptyIsNotTrueIfStatementAdded() { TripleStore store = MakeTripleStoreWithOneDummyStatement(); Assert.IsFalse(store.IsEmpty()); store.Clear(); }
public void NewInstanceIsEmpty() { TripleStore store = MakeNewTripleStore(); Assert.IsTrue(store.IsEmpty()); store.Clear(); }
public void GetResourceDenotedByDoesNotChangeIsEmptyFlag() { TripleStore store = MakeNewTripleStore(); store.GetResourceDenotedBy(new UriRef("http://example.com/uri")); Assert.IsTrue(store.IsEmpty()); store.Clear(); }
public void EvaluateRule() { TripleStore store = MakeNewTripleStore(); SimpleRuleProcessor ruleProcessor = new SimpleRuleProcessor(); store.Add(new Statement(new UriRef("http://example.com/subj1"), new UriRef("http://example.com/pred"), new UriRef("http://example.com/obj1"))); store.Add(new Statement(new UriRef("http://example.com/subj2"), new UriRef("http://example.com/pred"), new UriRef("http://example.com/obj2"))); Rule rule = new Rule(); rule.AddAntecedent(new Pattern(new Variable("var1"), new UriRef("http://example.com/pred"), new Variable("var2"))); rule.AddConsequent(new Pattern(new Variable("var1"), new UriRef("http://example.com/newPred"), new Variable("var2"))); ruleProcessor.Process(rule, store); Assert.IsFalse(store.IsEmpty(), "Destination is non-empty"); Assert.IsTrue(store.Contains(new Statement(new UriRef("http://example.com/subj1"), new UriRef("http://example.com/newPred"), new UriRef("http://example.com/obj1"))), "Destination contains first match consequent"); Assert.IsTrue(store.Contains(new Statement(new UriRef("http://example.com/subj2"), new UriRef("http://example.com/newPred"), new UriRef("http://example.com/obj2"))), "Destination contains second match consequent"); store.Clear(); }
/// <summary>Gets a value indicating whether the KnowledgeBase is empty or not.</summary> /// <returns>true if the KnowledgeBase contains any resource descriptions, false otherwise</returns> public virtual bool IsEmpty() { return(itsAssertions.IsEmpty()); }