Method: InterMine::PathQuery::Query#summaries

Defined in:
lib/intermine/query.rb

#summaries(path, start = 0, size = nil) ⇒ Object

Return an Enumerable of summary items starting at the given offset.

summary = query.summary_items("chromosome.primaryIdentifier")
top_chromosome = summary[0]["item"]
no_in_top_chrom = summary[0]["count"]

This can be made more efficient by passing in a size - ie, if you only want the top item, pass in an offset of 0 and a size of 1 and only that row will be fetched.



513
514
515
516
517
# File 'lib/intermine/query.rb', line 513

def summaries(path, start=0, size=nil)
    q = self.clone
    q.add_views(path)
    return Results::SummaryReader.new(@url, q, start, size, path)
end