List<Query> queryList = new ArrayList<Query>();
for (Integer shipID : queryJob.getShipIDs()) {
// Set up query
List<OVInstance> ovInstanceList = new ArrayList<OVInstance>(1);
List<Argument> arglist = queryNode.getArgumentList();
OrdinaryVariable ov = arglist.get(0).getOVariable();
OVInstance ovInstance = OVInstance.getInstance(ov,
LiteralEntityInstance.getInstance("ship" + shipID, ov.getValueType()));
ovInstanceList.add(ovInstance);
Query query = new Query(queryNode, ovInstanceList);
queryList.add(query);