After making a change to hsparql (I will submit a pull request) I can now programmatically build triples.