A ring-based chemical structural query system: use of a novel ring-complexity heuristic