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