Esempio n. 1
0
        public async Task Save_()
        {
            var file = Files.TestData.Sample1.CopyTo(
                Files.AppDataDir.GetFolder(nameof(RdfDataFetcherTests)), true);

            var loader = new RdfDataFetcher(_rdf);
            var g      = await loader.Load(file);

            var preUpdate = g.Query.Count;

            g.Assert(g.Blank(), g.Uri("app:isTest"), g.New(true));
            await loader.Save(g);

            g.Clear();

            await loader.Load(file);

            var postUpdate = g.Query.Count;

            Assert.IsTrue(postUpdate > preUpdate);
        }
Esempio n. 2
0
 /// <summary>Save previously loaded graph </summary>
 /// <exception cref="ErrorNoBackingFile"></exception>
 public static async Task <RdfDataFetcher> Save(this RdfDataFetcher self, Graph g)
 => await self.Save(g.Id);