Ranked Relations: Query Languages and Query Processing Methods for Multimedia