Detect cycles in lists when converting from RDF