We're Hiring!

How to specify the scope of search?

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.

How to specify the scope of search?

Postby pz3977 » Fri Aug 29, 2014 8:54 am

Hi,

I have a question regarding the scope of “Project” and “Dataset”. Does Dataset refer to the file? If I want to search for a metadata inside a file, looking in image and dataset is enough or I should add Project as well?

for i in conn.searchObjects(["Dataset", "Image"], "tiff"):
print i.OMERO_CLASS, i.getName(),i.getDescription(),i.getOwnerFullName(),i.getDate()

Another question is regarding the domain of the search regarding user access level. What kind of access should user have on a file which is being searched? Having read access to a file is enough for search? Is user allowed to download all the search result?

Best regards,
pz3977
pz3977
 
Posts: 31
Joined: Thu Jul 10, 2014 11:39 am

Re: How to specify the scope of search?

Postby wmoore » Fri Aug 29, 2014 1:03 pm

Hi,

Projects and Dataset are simply 'containers' for organising Images. Datasets are not really 'files' - They are just linked to images in the database.

For searching, you should specify the type of object you want to be returned by the search. If you are really looking for images, then you should only use 'Image' in:

Code: Select all
conn.searchObjects(["Image"], "tiff"):


There's no way to use searchObjects() to find Images within a particular Dataset.

If a user has read-access to an Image then they will be able to find that Image via searching. They will then be able to access all the linked data and download the Image.

By default, searchObjects() will search the current group you are logged in to. You can search within specific groups or across all groups as shown in examples:

https://gist.github.com/will-moore/e5fe45145fbfc5494127

Hope that helps,

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm


Return to Developer Discussion

Who is online

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