We're Hiring!

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

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

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

Postby dsudar » Mon Aug 03, 2015 12:49 am

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
dsudar
 
Posts: 235
Joined: Mon May 14, 2012 8:43 pm
Location: Berkeley, CA, USA

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

Postby mtbc » Mon Aug 03, 2015 10:08 am

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
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 0 guests