I have a table that stores RDF triples:
triples (triple_id, sub_id, pre_id, obj_id)
The method (I need to write) will get an array of numbers that matches the pre_id values. I want to select all sub_id values that have the corresponding pre_id for all pre_ids in the array that is being passed.
eg. if I had one pre_id value passed in ... allows you to call the value passed in preId, I would do:
select sub_id from triples, where pre_id = preId;
However, since I have mutliple pre_id values, I want to continue to iterate through the pre_id values and save the sub_id values corresponding to the “triple” records that both have.
eg. image there are five entries:
triples(1, 34,65,23) triples(2, 31,35,28) triples(3, 32,32,19) triples(4, 12,65,28) triples(5, 76,32,34)
If I pass an array of pre_id values [65.32], then I want to select the first, third, fourth and fifth records.
What would I do for this?