irods-contrib / irods-cloud-browser

DFC Web Based cloud browser
BSD 2-Clause "Simplified" License
18 stars 13 forks source link

add add'l query operators #149

Closed michael-conway closed 8 years ago

michael-conway commented 8 years ago

for metadata query, and genquery, here are the operators (the strings in parens)

NOT_EQUAL("<>"), LESS_THAN_OR_EQUAL_TO("<="), GREATER_THAN_OR_EQUAL_TO(">="), NOT_LIKE("not like"), SOUNDS_LIKE("sounds like"), SOUNDS_NOT_LIKE("sounds not like"), TABLE("table"), NUMERIC_LESS_THAN("n<"), NUMERIC_LESS_THAN_OR_EQUAL_TO("n<="), NUMERIC_GREATER_THAN_OR_EQUAL_TO("n>="), NUMERIC_GREATER_THAN("n>"), NUMERIC_EQUAL("n="), EQUAL("="), LESS_THAN("<"), GREATER_THAN(">"), IN("in"), BETWEEN("between"), LIKE("like");

michael-conway commented 8 years ago

also for query types...

public enum QueryType { DATA, COLLECTIONS, BOTH }

chexare commented 8 years ago

When using operator like: SOUNDS_LIKE("sounds like"), LIKE("like") the query actions returns a "null operator" error.

michael-conway commented 8 years ago

jargon log


2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.AbstractIRODSMidLevelProtocol  - shutting down, need to send disconnect to irods
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.AbstractIRODSMidLevelProtocol  - sending disconnect message
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.AbstractIRODSMidLevelProtocol  - functionID: 0
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.AbstractIRODSMidLevelProtocol  - header:<MsgHeader_PI><type>RODS_DISCONNECT</type><msgLen>0</msgLen><errorLen>0</errorLen><bsLen>0</bsLen><intInfo>0</intInfo></MsgHeader_PI>
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.AbstractIRODSMidLevelProtocol  - finally, shutdown is being called on the given connection
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.IRODSBasicTCPConnection  - shutting down connection: true
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.IRODSBasicTCPConnection  - is connected for : irods://test1.tempZone@localhost:1247/http-bio-8080-exec-7/1463689413643
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.IRODSBasicTCPConnection  - now disconnected
2016-05-19 16:23:34,434 [http-bio-8080-exec-7] DEBUG connection.IRODSSession  - all sessions closed for this Thread
2016-05-19 16:23:35,733 [http-bio-8080-exec-4] DEBUG connection.IRODSSession  - closing all irods sessions
2016-05-19 16:23:35,733 [http-bio-8080-exec-4] WARN  connection.IRODSSession  - closing session that is already closed, silently ignore
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionFactoryImpl  - instanceExecutor()
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionFactoryImpl  - virtualCollection:AbstractVirtualCollection [parameters=[], pagingStyle=CONTINUOUS, type=MD_QUERY, uniqueName=5b3faa20-1df9-11e6-825e-6f9a7b3a1637, description=fish, i18Name=virtual.collection.default.name, i18Description=virtual.collection.default.description, i18icon=virtual.collection.default.icon, pathHintable=false]
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionFactoryImpl  - finding executor for vc...
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionExecutorImpl  - queryAll(String, int)
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionExecutorImpl  - queryAll()
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionExecutorImpl  - path:
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  impl.VirtualCollectionExecutorImpl  - offset:48
2016-05-19 16:23:35,733 [http-bio-8080-exec-7] INFO  types.MetadataQueryVirtualCollectionExecutor  - queryAll()
2016-05-19 16:23:35,736 [http-bio-8080-exec-7] INFO  service.MetadataQueryServiceImpl  - executeQuery()
2016-05-19 16:23:35,736 [http-bio-8080-exec-7] INFO  service.MetadataQueryServiceImpl  - metadataQuery:MetadataQuery [targetZone=, queryType=BOTH, pathHint=, metadataQueryElements=[MetadataQueryElement [attributeName=dog, operator=SOUNDS_LIKE, value=[fisch], connector=AND]]]
2016-05-19 16:23:35,736 [http-bio-8080-exec-7] INFO  service.MetadataQueryServiceImpl  - queryCollections()
2016-05-19 16:23:35,736 [http-bio-8080-exec-7] INFO  service.MetadataQueryServiceImpl  - element:MetadataQueryElement [attributeName=dog, operator=SOUNDS_LIKE, value=[fisch], connector=AND]
2016-05-19 16:23:35,736 [http-bio-8080-exec-7] INFO  service.MetadataQueryServiceImpl  - single value operation
Error |
2016-05-19 16:23:35,742 [http-bio-8080-exec-7] ERROR errors.GrailsExceptionResolver  - IllegalArgumentException occurred when processing request: [GET] /irods-cloud-backend/collection/5b3faa20-1df9-11e6-825e-6f9a7b3a1637 - parameters:
path: 
offset: 0
null operator. Stacktrace follows:
Message: null operator
    Line | Method
->>  331 | addConditionAsGenQueryField in org.irods.jargon.core.query.IRODSGenQueryBuilder
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    310 | queryCollections            in org.irods.jargon.mdquery.service.MetadataQueryServiceImpl
|    116 | executeQuery . . . . . . .  in     ''
|     78 | executeQuery                in     ''
|     52 | queryAll . . . . . . . . .  in org.irods.jargon.vircoll.types.MetadataQueryVirtualCollectionExecutor
|    118 | queryAll                    in org.irods.jargon.vircoll.impl.VirtualCollectionExecutorImpl
|    100 | queryAll . . . . . . . . .  in     ''
|    177 | virtualCollectionListing    in org.irods.jargon.idrop.web.services.VirtualCollectionService
|     59 | show . . . . . . . . . . .  in org.irods.jargon.idrop.web.controllers.CollectionController
|    198 | doFilter                    in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter . . . . . . . . .  in grails.plugin.cache.web.filter.AbstractFilter
|     82 | doFilter                    in com.brandseye.cors.CorsFilter
|   1142 | runWorker . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
|    617 | run                         in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run . . . . . . . . . . . . in java.lang.Thread
Error |
2016-05-19 16:23:35,744 [http-bio-8080-exec-7] ERROR controllers.ErrorController  - error controller triggered for exception:java.lang.IllegalArgumentException: nu
michael-conway commented 8 years ago

sounds like issue is https://github.com/DICE-UNC/jargon/issues/179

michael-conway commented 8 years ago

Hey Cesar, after some looking, I don't even see 'sounds like' supported in general_query.cpp.

Let's take sounds like and not sounds like out of the options

chexare commented 8 years ago

After some testing there are several error that need to be addressed:

operators: numeric <=, numeric >=, numeric <, numeric >, numeric =, <=, >= give 500 error. operators: >, and < evaluate only the first digit of a number ( 3 is greater than 10000 )