Example #1
0
        public void StorageFusekiRemoveTriples()
        {
            try
            {
#if !NO_URICACHE
                Options.UriLoaderCaching = false;
#endif
                StorageFusekiSaveGraph();

                Graph         g  = new Graph();
                List <Triple> ts = new List <Triple>();
                ts.Add(new Triple(g.CreateUriNode(new Uri("http://example.org/subject")), g.CreateUriNode(new Uri("http://example.org/predicate")), g.CreateUriNode(new Uri("http://example.org/object"))));

                FusekiConnector fuseki = FusekiTest.GetConnection();
                fuseki.UpdateGraph("http://example.org/fusekiTest", null, ts);

                fuseki.LoadGraph(g, "http://example.org/fusekiTest");
                Assert.IsTrue(ts.All(t => !g.ContainsTriple(t)), "Removed Triple should not have been in the Graph");
            }
            finally
            {
#if !NO_URICACHE
                Options.UriLoaderCaching = true;
#endif
            }
        }
Example #2
0
        public void StorageFusekiAddTriples()
        {
            try
            {
                Options.UriLoaderCaching = false;
                StorageFusekiSaveGraph();

                Graph         g  = new Graph();
                List <Triple> ts = new List <Triple>();
                ts.Add(new Triple(g.CreateUriNode(new Uri("http://example.org/subject")), g.CreateUriNode(new Uri("http://example.org/predicate")), g.CreateUriNode(new Uri("http://example.org/object"))));

                FusekiConnector fuseki = FusekiTest.GetConnection();
                fuseki.UpdateGraph("http://example.org/fusekiTest", ts, null);

                fuseki.LoadGraph(g, "http://example.org/fusekiTest");
                Assert.True(ts.All(t => g.ContainsTriple(t)), "Added Triple should have been in the Graph");
            }
            finally
            {
                Options.UriLoaderCaching = true;
            }
        }
Example #3
0
        public void StorageFusekiRemoveTriples()
        {
            try
            {
                Options.UriLoaderCaching = false;

                StorageFusekiSaveGraph();

                Graph g = new Graph();
                List<Triple> ts = new List<Triple>();
                ts.Add(new Triple(g.CreateUriNode(new Uri("http://example.org/subject")), g.CreateUriNode(new Uri("http://example.org/predicate")), g.CreateUriNode(new Uri("http://example.org/object"))));

                FusekiConnector fuseki = new FusekiConnector(FusekiTestUri);
                fuseki.UpdateGraph("http://example.org/fusekiTest", null, ts);

                fuseki.LoadGraph(g, "http://example.org/fusekiTest");
                Assert.IsTrue(ts.All(t => !g.ContainsTriple(t)), "Removed Triple should not have been in the Graph");
            }
            finally
            {
                Options.UriLoaderCaching = true;
            }
        }