public void OntologyReasonerGraph() { //Load Test Data Console.WriteLine("Loading in the standard test data InferenceTest.ttl"); OntologyGraph g = new OntologyGraph(); FileLoader.Load(g, "InferenceTest.ttl"); OntologyClass c = g.CreateOntologyClass(new Uri("http://example.org/vehicles/Car")); Console.WriteLine("Things which are cars in an Ontology Graph"); foreach (OntologyResource r in c.Instances) { Console.WriteLine(r.Resource.ToString()); } Console.WriteLine(); ReasonerGraph g2 = new ReasonerGraph(g, new RdfsReasoner()); OntologyClass c2 = g2.CreateOntologyClass(new Uri("http://example.org/vehicles/Car")); Console.WriteLine("Things which are cars in a Reasoner Graph using an RDFS Reasoner"); foreach (OntologyResource r in c2.Instances) { Console.WriteLine(r.Resource.ToString()); } Console.WriteLine(); Console.WriteLine("Original Graph has " + g.Triples.Count + " Triples"); Console.WriteLine("Reasoner Graph has " + g2.Triples.Count + " Triples"); Assert.IsTrue(g2.Triples.Count > g.Triples.Count, "Reasoner Graph should have more Triples"); Assert.AreEqual(g, g2.BaseGraph, "Original Graph should be equal to the Reasoner Graphs BaseGraph"); Console.WriteLine(); Console.WriteLine("Going to do a GetTriplesWithSubject() call on both Graphs to see if ReasonerGraph behaves as expected"); IUriNode fiesta = g.CreateUriNode(new Uri("http://example.org/vehicles/FordFiesta")); Console.WriteLine("Original Graph:"); foreach (Triple t in g.GetTriplesWithSubject(fiesta)) { Console.WriteLine(t.ToString()); } Console.WriteLine(); Console.WriteLine("Reasoner Graph:"); foreach (Triple t in g2.GetTriplesWithSubject(fiesta)) { Console.WriteLine(t.ToString()); } }