protected override async Task<bool> OnProcessBatch(CollectorHttpClient client, IEnumerable<JToken> items, JToken context, DateTime commitTimeStamp, bool isLastBatch, CancellationToken cancellationToken)
{
List<Task<IGraph>> tasks = new List<Task<IGraph>>();
foreach (JObject item in items)
{
if (Utils.IsType((JObject)context, item, _types))
{
Uri itemUri = item["@id"].ToObject<Uri>();
tasks.Add(client.GetGraphAsync(itemUri));
}
}
if (tasks.Count > 0)
{
await Task.WhenAll(tasks.ToArray());
TripleStore store = new TripleStore();
foreach (Task<IGraph> task in tasks)
{
store.Add(task.Result, true);
}
await ProcessStore(store, cancellationToken);
}
return true;
}