public void Contains_reports_by_predicate_object_and_argument_subject() { var g = new Graph(); g.LoadFromString(@" <urn:s> <urn:s> <urn:s> . <urn:s> <urn:s> <urn:p> . <urn:s> <urn:s> <urn:o> . <urn:s> <urn:p> <urn:s> . <urn:s> <urn:p> <urn:p> . <urn:s> <urn:p> <urn:o> . # true <urn:s> <urn:o> <urn:s> . <urn:s> <urn:o> <urn:p> . <urn:s> <urn:o> <urn:o> . <urn:p> <urn:s> <urn:s> . <urn:p> <urn:s> <urn:p> . <urn:p> <urn:s> <urn:o> . <urn:p> <urn:p> <urn:s> . <urn:p> <urn:p> <urn:p> . <urn:p> <urn:p> <urn:o> . # true <urn:p> <urn:o> <urn:s> . <urn:p> <urn:o> <urn:p> . <urn:p> <urn:o> <urn:o> . <urn:o> <urn:s> <urn:s> . <urn:o> <urn:s> <urn:p> . <urn:o> <urn:s> <urn:o> . <urn:o> <urn:p> <urn:s> . <urn:o> <urn:p> <urn:p> . <urn:o> <urn:p> <urn:o> . # true <urn:o> <urn:o> <urn:s> . <urn:o> <urn:o> <urn:p> . <urn:o> <urn:o> <urn:o> . "); var s = g.CreateUriNode(UriFactory.Create("urn:s")); var p = g.CreateUriNode(UriFactory.Create("urn:p")); var o = g.CreateUriNode(UriFactory.Create("urn:o")); var d = new DynamicNode(s); var c = new DynamicSubjectCollection(p, d); Assert.Contains(s, c); Assert.Contains(p, c); Assert.Contains(o, c); Assert.Equal(3, c.Count()); }
public void Counts_by_predicate_and_object() { var g = new Graph(); g.LoadFromString(@" <urn:s> <urn:s> <urn:s> . <urn:s> <urn:s> <urn:p> . <urn:s> <urn:s> <urn:o> . <urn:s> <urn:p> <urn:s> . <urn:s> <urn:p> <urn:p> . <urn:s> <urn:p> <urn:o> . # 1 <urn:s> <urn:o> <urn:s> . <urn:s> <urn:o> <urn:p> . <urn:s> <urn:o> <urn:o> . <urn:p> <urn:s> <urn:s> . <urn:p> <urn:s> <urn:p> . <urn:p> <urn:s> <urn:o> . <urn:p> <urn:p> <urn:s> . <urn:p> <urn:p> <urn:p> . <urn:p> <urn:p> <urn:o> . # 2 <urn:p> <urn:o> <urn:s> . <urn:p> <urn:o> <urn:p> . <urn:p> <urn:o> <urn:o> . <urn:o> <urn:s> <urn:s> . <urn:o> <urn:s> <urn:p> . <urn:o> <urn:s> <urn:o> . <urn:o> <urn:p> <urn:s> . <urn:o> <urn:p> <urn:p> . <urn:o> <urn:p> <urn:o> . # 3 <urn:o> <urn:o> <urn:s> . <urn:o> <urn:o> <urn:p> . <urn:o> <urn:o> <urn:o> . "); var p = g.CreateUriNode(UriFactory.Create("urn:p")); var o = g.CreateUriNode(UriFactory.Create("urn:o")); var d = new DynamicNode(o); var c = new DynamicSubjectCollection(p, d); Assert.Equal(3, c.Count()); }