more or less fixed retrieving triples from triple patterns