Skip to content

Enable Advanced form and support query in URL with jsonurl.js#34

Open
will-moore wants to merge 11 commits intoIDR:masterfrom
will-moore:complex_queries
Open

Enable Advanced form and support query in URL with jsonurl.js#34
will-moore wants to merge 11 commits intoIDR:masterfrom
will-moore:complex_queries

Conversation

@will-moore
Copy link
Copy Markdown
Member

@will-moore will-moore commented May 12, 2023

Fixes #33.

We use https://github.com/jsonurl/jsonurl-js to convert JSON version of the form into a URL.
The and, or queries are nested in a list like:

`(and, and, (or, or), and, (or, or))

E.g.

/search/?q=(((key:Gene+Symbol,value:pdxk,operator:equals,resource:image),(key:Gene+Symbol,value:pdxp,operator:equals,resource:image)),(key:Publication+Title,value:rnf168+binds+and+amplifies+ubiquitin+conjugates+on+damaged+chromosomes+to+allow+accumulation+of+repair+proteins.,operator:contains,resource:container),(key:Organism,value:homo+sapiens,operator:equals,resource:container))

Also added Query JSON button to show the query sent to the API - so it can be debugged or used via API.

Also added Undo/Redo buttons for going back to previous queries:

Screenshot 2023-05-29 at 09 21 06

@pwalczysko
Copy link
Copy Markdown

Problem:

  1. When a sensible publication title term is given, then the query delivers some images (=> expected).
  2. When a nonsensical publication title term is given, then the query delivers many more images => not expected.

Ad 1

Screenshot 2023-05-29 at 14 25 05

Ad 2
Screenshot 2023-05-29 at 14 27 20

@pwalczysko
Copy link
Copy Markdown

How to use the Case sensitive checkbox ?
The only way I found is to

  1. Check (or uncheck) the checkbox
  2. Hit Enter on the keyboard

This is not intuitive - checkbok selection is followed by confirmation by Enter.

@will-moore
Copy link
Copy Markdown
Member Author

Thanks @pwalczysko.

With Gene symbol PDX or pgam5 gives 5790 Images
http://idr-testing.openmicroscopy.org/search/?q=(((key:Gene+Symbol,value:pdx,operator:contains,resource:image),(key:Gene+Symbol,value:pgam5,operator:equals,resource:image)))

Also with AND Human we get the same 5790 Images:
http://idr-testing.openmicroscopy.org/search/?q=((key:Organism,value:homo+sapiens,operator:equals,resource:container),((key:Gene+Symbol,value:pdx,operator:contains,resource:image),(key:Gene+Symbol,value:pgam5,operator:equals,resource:image)))

Add Publication Title 'invalid', we get 5548 Images:
http://idr-testing.openmicroscopy.org/search/?q=((key:Publication+Title,value:studysdsd,operator:contains,resource:container),(key:Organism,value:homo+sapiens,operator:equals,resource:container),((key:Gene+Symbol,value:pdx,operator:contains,resource:image),(key:Gene+Symbol,value:pgam5,operator:equals,resource:image)))

Without the 'Human' AND statement, the Study Title behaves correctly (invalid keyword returns no results):
http://idr-testing.openmicroscopy.org/search/?q=((key:Publication+Title,value:study,operator:contains,resource:container),((key:Gene+Symbol,value:pdx,operator:contains,resource:image),(key:Gene+Symbol,value:pgam5,operator:equals,resource:image)))

Also, without the OR clause, the Study Title behaves correctly (invalid keyword returns no results):
http://idr-testing.openmicroscopy.org/search/?q=((key:Publication+Title,value:study,operator:contains,resource:container),(key:Organism,value:homo+sapiens,operator:equals,resource:container),(key:Gene+Symbol,value:pdx,operator:contains,resource:image))

@will-moore
Copy link
Copy Markdown
Member Author

@pwalczysko - Ah, yes I've not looked at the Case sensitive checkbox - I'll try fix now...

@will-moore
Copy link
Copy Markdown
Member Author

@pwalczysko The case_sensitive checkbox should be working now on idr-testing (needs full refresh to clear cache).
Checking/unchecking will update the URL, search results and undo/redo buttons. Undo/redo should update the checkbox as expected etc.

@will-moore will-moore mentioned this pull request Jun 2, 2023
@dominikl
Copy link
Copy Markdown
Member

This PR looks good to me. I think we should get this merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complex queries

3 participants