Esempio n. 1
0
        public void InteropSemWebGraphConversion()
        {
            Graph g = new Graph();

            FileLoader.Load(g, "Turtle.ttl");

            MemoryStore mem = new MemoryStore();

            SemWebConverter.ToSemWeb(g, mem);

            Graph h = new Graph();

            SemWebConverter.FromSemWeb(mem, h);

            Assert.AreEqual(g, h, "1 - Graphs should have been equal");

            MemoryStore mem2 = new MemoryStore();

            SemWebConverter.ToSemWeb(h, mem2);

            Graph i = new Graph();

            SemWebConverter.FromSemWeb(mem2, i);

            Assert.AreEqual(h, i, "2 - Graphs should have been equal");
        }
Esempio n. 2
0
        public void InteropSemWebWriteVia()
        {
            Graph g = new Graph();

            FileLoader.Load(g, "InferenceTest.ttl");

            MemoryStore mem = new MemoryStore();

            SemWebConverter.ToSemWeb(g, mem);

            RdfWriter writer = new RdfXmlWriter("semweb.rdf");

            writer.Write(mem);
            writer.Close();

            //Read the output graph back in to check for equality
            Graph h = new Graph();

            FileLoader.Load(h, "semweb.rdf");

            Assert.AreEqual(g, h, "Graphs should have been equal");
        }