Example #1
0
        public void StorageNativeGraph()
        {
            //Load in our Test Graph
            TurtleParser ttlparser = new TurtleParser();
            Graph        g         = new Graph();

            ttlparser.Load(g, "resources\\Turtle.ttl");

            Console.WriteLine("Loaded Test Graph OK");
            Console.WriteLine("Test Graph contains:");

            Assert.False(g.IsEmpty, "Test Graph should be non-empty");

            foreach (Triple t in g.Triples)
            {
                Console.WriteLine(t.ToString());
            }
            Console.WriteLine();

            //Create our Native Managers
            List <IStorageProvider> managers = new List <IStorageProvider>()
            {
                new InMemoryManager(),
#if NET40
                VirtuosoTest.GetConnection()
#endif
            };

            //Save the Graph to each Manager
            foreach (IStorageProvider manager in managers)
            {
                Console.WriteLine("Saving using '" + manager.GetType().ToString() + "'");
                manager.SaveGraph(g);
                Console.WriteLine("Saved OK");
                Console.WriteLine();
            }

            //Load Back from each Manager
            foreach (IStorageProvider manager in managers)
            {
                Console.WriteLine("Loading using '" + manager.GetType().ToString() + "' with a NativeGraph");
                StoreGraphPersistenceWrapper native = new StoreGraphPersistenceWrapper(manager, g.BaseUri);
                Console.WriteLine("Loaded OK");

                Assert.False(native.IsEmpty, "Retrieved Graph should contain Triples");
                Assert.Equal(g.Triples.Count, native.Triples.Count);

                Console.WriteLine("Loaded Graph contains:");
                foreach (Triple t in native.Triples)
                {
                    Console.WriteLine(t.ToString());
                }
                Console.WriteLine();

                native.Dispose();
            }
        }
Example #2
0
 protected override IAsyncStorageProvider GetAsyncProvider()
 {
     return(VirtuosoTest.GetConnection());
 }
        public void ParsingWriteToStoreHandlerBNodesAcrossBatchesVirtuoso()
        {
            VirtuosoManager virtuoso = VirtuosoTest.GetConnection();

            this.TestWriteToStoreHandlerWithBNodes(virtuoso);
        }
        public void ParsingWriteToStoreHandlerDatasetsVirtuoso()
        {
            VirtuosoManager virtuoso = VirtuosoTest.GetConnection();

            this.TestWriteToStoreDatasetsHandler(virtuoso);
        }