Page 1 of 1

HQL documentation - query for # of images in Dataset or Plat

PostPosted: Mon Aug 03, 2015 12:49 am
by dsudar
Hi,

I know that you can do a lot with the HQL queries, even simply from the command line but I'm having a hard time finding the documentation besides a few examples for some specific cases. Is there a place to look for some kind of tutorial, specifically in relation to OMERO's schema? The page: http://www.openmicroscopy.org/site/supp ... hlight=hql is a start but not enough for someone who is also SQL-deficient.

I'm specifically looking for a simple query that gets the number of images present in a Dataset or in a Plate. Our downstream processing needs to know how many images to iterate through and sometimes the Datasets or Plates are only partial.

Thanks,
- Damir

Re: HQL documentation - query for # of images in Dataset or

PostPosted: Mon Aug 03, 2015 10:08 am
by mtbc
Dear Damir,

You are quite correct: I shall add to the documentation you found a couple of links that personally I find invaluable: http://www.openmicroscopy.org/site/supp ... bject.html for finding my way around the OMERO object model, and https://docs.jboss.org/hibernate/orm/3. ... ryhql.html for phrasing HQL queries.

For how many images there are in dataset 1234:
Code: Select all
bin/omero hql "SELECT COUNT(DISTINCT child.id) FROM DatasetImageLink WHERE parent.id = 1234"

For how many images there are in plate 8765:
Code: Select all
bin/omero hql "SELECT COUNT(DISTINCT field.image.id) FROM WellSample AS field, Well AS well WHERE field.well = well AND well.plate = 8765"


Cheers,
Mark