コード例 #1
0
ファイル: RdfDataFetcher.cs プロジェクト: Dkowald/kwd.RdfSeed
        /// <summary>
        /// Loads all specified files,
        /// returning a graph with loaded data.
        /// </summary>
        public async Task <Graph> Load(params Node <FileInfo>[] files)
        {
            var loading = new List <Task <Graph> >();

            foreach (var file in files)
            {
                loading.Add(Load(file));
            }

            await Task.WhenAll(loading);

            var g = _rdf.GetGraph(
                loading.First().Result.Id,
                loading.Skip(1).Select(x => x.Result.Id));

            return(g);
        }
コード例 #2
0
        public async Task Purge_()
        {
            var loader = new RdfDataFetcher(_rdf);

            var g = await loader.Load(Files.TestData.Sample1);

            loader.Purge(Files.TestData.Sample1);

            Assert.IsFalse(loader.List().Any(), "backing file removed.");
            _rdf.GetGraph(g.Id);
        }
コード例 #3
0
 /// <summary>Get system graph with all data</summary>
 public static Graph GetSystem(this IRdfData store)
 => store.GetGraph(store.System, store.GraphIds);
コード例 #4
0
 /// <summary>Get default graph with all data</summary>
 public static Graph GetDefault(this IRdfData store)
 => store.GetGraph(store.Default, store.GraphIds);
コード例 #5
0
 /// <summary>Get new blank graph; has all the current data</summary>
 public static Graph GetBlankGraph(this IRdfData store, string?id = null)
 => store.GetGraph(store.BlankSelf(id), store.GraphIds);
コード例 #6
0
 /// <summary>Get self graph: graph contains only its own quads</summary>
 public static Graph GetSelfGraph(this IRdfData rdf, string graphUri)
 => rdf.GetGraph(rdf.Uri(graphUri), Enumerable.Empty <Node <UriOrBlank> >());
コード例 #7
0
 /// <summary>Get self graph: graph contains only its own quads</summary>
 public static Graph GetSelfGraph(this IRdfData store, Node <UriOrBlank> graphId)
 => store.GetGraph(graphId, Enumerable.Empty <Node <UriOrBlank> >());
コード例 #8
0
 /// <summary>Get full graph: graph contains all current quads.</summary>
 public static Graph GetFullGraph(this IRdfData store, Node <UriOrBlank> graphUri)
 => store.GetGraph(graphUri, store.GraphIds);
コード例 #9
0
 /// <summary>Get full graph: graph contains all current quads.</summary>
 public static Graph GetFullGraph(this IRdfData rdf, string graphUri)
 => rdf.GetGraph(rdf.Uri(graphUri), rdf.GraphIds);
コード例 #10
0
 /// <summary>
 /// A set of quads ordered by graph.
 /// Includes data from the specified additional graph(s)
 /// </summary>
 public static Graph GetGraph(this IRdfData store,
                              Node <UriOrBlank> graphId, IEnumerable <Node <UriOrBlank> > other)
 => store.GetGraph(graphId, other.ToArray());
コード例 #11
0
 /// <summary>Select <see cref="Graph"/>.</summary>
 public GraphBuilder From(Node <UriOrBlank> graphId)
 => new GraphBuilder(this, _owner.GetGraph(graphId, Enumerable.Empty <Node <UriOrBlank> >()));