Update from RDF algorithm to support lists of lists

@gkellogg @dlongley I would appreciate if you could review the changes. I will push another  change in a minute that I think might be controversial.