-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/query #44
Feature/query #44
Conversation
There are new query endpoints, see http://portal.shore.mbari.org:8100/docs/#/Query. GoalsThese endpoints are to allow app-developers and some users to fetch annotation or annotation data in a flexible manner. The primary use case is the new VARS web query. Secondary use would be to replace SQL used in vars-gridview. Non-goals include specialized queries for reporting. NotesThese endpoints operate against the The query endpoint is relatively dynamic, so we can add or remove columns from the annotations view as we see fit. Note that the
|
If I want to constrain a query by date, how can I do that using this API? Is it something like this -- this doesn't work? |
@hohonuuli If I update the query so there is no limit (i.e., fetch all the data) when I do a big query (i.e., Nanomia bijuga) I get a time out error. Is that expected or should I be able to get all the data? |
I may have crashed VARS.... |
That unbounded query will return a little over a half-million rows ('cause table joins). The service converts that to 1. an in memory data structure which is 2. converted to a String to be written back to the client. I'm pretty sure I haven't configured the service with enough memory to handle that query. |
The proper order to fetch large sets is:
|
It's suppose to be the following, but it might be broken ATM as I'm changing the API. {
"column": "index_recorded_timestamp",
"between": [
"1996-01-01T00:00:00Z",
"2002-01-01T00:00:00Z"
]
} |
@lonnylundsten @kevinsbarnard I've updated the query params the Get localizations of Nanomia that are missing an image, but one could be fetched using beholder.curl -X 'POST' \
'http://m3.shore.mbari.org/anno/v1/query/run' \
-H 'Content-Type: application/json' \
-d '{
"select": [
"concept",
"index_recorded_timestamp",
"video_sequence_name",
"video_uri",
"image_url",
"link_value"
],
"where": [
{
"column": "concept",
"in":["Nanomia", "Nanomia bijuga"]
},
{
"column": "index_elapsed_time_millis",
"isnull": false
},
{
"column": "image_url",
"isnull": true
},
{
"column": "link_name",
"in": ["bounding box"]
},
{
"column": "video_uri",
"like": "http%"
}
],
"distinct": true,
"limit": 5000,
"offset": 0,
"concurrentObservations": true,
"relatedAssociations": false
}
' Get all concept names used in annotationscurl -X 'POST' \
'http://m3.shore.mbari.org/anno/v1/query/run' \
-H 'Content-Type: application/json' \
-d '{
"select": [
"concept"
],
"where": [
{
"column": "concept",
"isnull": false
}
],
"strict": true,
"orderby": ["concept"],
"distinct": true
}
' These changes have been deployed internally as v1.2.1 |
Released as v1.2.2 |
This branch adds support for ad-hoc queries against the
annotations
view in the database. This feature is needed to support the upcoming vars query web ui.The endpoints for these new features will be under
v1/query
distinct
as a flag. Default should be true.strict
(?) as a flag. Default is false. Whenfalse
adds theobservation_uuid
andindex_recorded_timestamp
columns and sorts by those.orderby
param. This should be ignored when strict is true (verify that this is the behavior we want)equals
operatorlike
tocontains
and retain current behaviorlike
that takes a sql like string (e.g.http%
)