Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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;
        }