Add test coverage for to_rdfgraph()

- Fix error in to_rdfgraph() dispatching mechanism
  due to iterators being consumed and later reused