Relax validation of Input queries

A query may be omitted if the input belongs to a share group, and all
other inputs in the group define a query.