/// <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); }
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); }
/// <summary>Get system graph with all data</summary> public static Graph GetSystem(this IRdfData store) => store.GetGraph(store.System, store.GraphIds);
/// <summary>Get default graph with all data</summary> public static Graph GetDefault(this IRdfData store) => store.GetGraph(store.Default, store.GraphIds);
/// <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);
/// <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> >());
/// <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> >());
/// <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);
/// <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);
/// <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());
/// <summary>Select <see cref="Graph"/>.</summary> public GraphBuilder From(Node <UriOrBlank> graphId) => new GraphBuilder(this, _owner.GetGraph(graphId, Enumerable.Empty <Node <UriOrBlank> >()));