fix triples query