Пример #1
0
        public void FilterByTypes()
        {
            // this is fairly ugly. if types has values we add an extra property
            // RDF_TYPE to records during build, then filter out records of the
            // wrong types here. finally, we strip away the RDF_TYPE property here.

            if (_types.Count == 0)
            {
                return;
            }

            var recordKey = new List <string>(_records.Keys);

            foreach (var uri in recordKey)
            {
                RecordImpl r = _records[uri];
                if (!FilterByType(r))
                {
                    _records.Remove(uri);
                }
                else
                {
                    r.Remove(RDF_TYPE);
                }
            }
        }