General string-to-graph loader