Batch query for triples by subjects and predicates