private void TestUpdate(IStorageProvider manager)
        {
            this.EnsureTestDataset(manager);

            Skip.IfNot(TestConfigManager.GetSettingAsBoolean(TestConfigManager.UseRemoteParsing),
                       "Test Config marks Remote Parsing as unavailable, test cannot be run");

            Uri updateUri = new Uri("http://example.org/persistence/update/temp");

            this.EnsureGraphDeleted(manager, updateUri);

            PersistentTripleStore store = new PersistentTripleStore(manager);

            try
            {
                Assert.False(store.HasGraph(updateUri), "Prior to SPARQL Update our target graph should not exist using HasGraph()");
                Assert.False(store.Graphs.Contains(updateUri), "Prior to SPARQL Update out target graph should not exist using Graphs.Contains()");
                Assert.False(manager.ListGraphs().Contains(updateUri), "Prior to SPARQL Update our target graph should not exist in the underlying store");

                store.ExecuteUpdate("LOAD <http://dbpedia.org/resource/Ilkeston> INTO GRAPH <" + updateUri.ToString() + ">");

                Assert.True(store.HasGraph(updateUri), "SPARQL Update should have loaded into our target graph so that HasGraph() returns true");
                Assert.True(store.Graphs.Contains(updateUri), "SPARQL Update should have loaded into out target graph so that Graphs.Contains() returns true");

                //Note that SPARQL Updates go directly to the underlying store so the change is persisted immediately
                Assert.True(manager.ListGraphs().Contains(updateUri), "SPARQL Update should loaded into our target graph directly in the underlying store");
            }
            finally
            {
                store.Dispose();
            }
        }
Ejemplo n.º 2
0
        public void ClearRepository()
        {
            var query = _queryTemplatesService.GetQueryTemplate("delete_all_triples");

            try
            {
                _repository.ExecuteUpdate(query);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Delete error");
            }
        }
Ejemplo n.º 3
0
        private void TestUpdateUnsynced(IStorageProvider manager)
        {
            this.EnsureTestDataset(manager);

            PersistentTripleStore store = new PersistentTripleStore(manager);

            try
            {
                store.Remove(new Uri(TestGraphUri1));

                store.ExecuteUpdate("LOAD <http://dbpedia.org/resource/Ilkeston>");
            }
            finally
            {
                store.Discard();
                store.Dispose();
            }
        }
        private void TestUpdateUnsynced(IStorageProvider manager)
        {
            this.EnsureTestDataset(manager);

            Skip.IfNot(TestConfigManager.GetSettingAsBoolean(TestConfigManager.UseRemoteParsing),
                       "Test Config marks Remote Parsing as unavailable, test cannot be run");

            PersistentTripleStore store = new PersistentTripleStore(manager);

            try
            {
                store.Remove(new Uri(TestGraphUri1));

                store.ExecuteUpdate("LOAD <http://dbpedia.org/resource/Ilkeston>");
            }
            finally
            {
                store.Discard();
                store.Dispose();
            }
        }