private static void GetAllSubclasses(string cat, Dictionary <string, string> list) { var result = _api.Get(string.Format(WD_CAT_QUERY, cat)); foreach (var r in result.Results.Bindings) { var id = r["s"].Value; var label = r["sLabel"].Value; if (!list.ContainsKey(id)) { list.Add(id, label); GetAllSubclasses(id, list); } } }
public void Do(UnitPart unit) { do { unit.Started = true; var query = GetQuery(unit); var result = _api.Get(query); if (result == null || !result.Results.Bindings.Any()) { break; } // save new offset unit.Offset += result.Results.Bindings.Length; // save result ProcessResult(unit.Property, unit.Category, result); } while (true); unit.Done = true; }