Extract Rdf query resolution from Term

Is this an unrelated refactor? or is it a part of the extraction? If the former, maybe it should go in a separate commit?