Skip to content
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

Paging? #10

Open
bwalsh opened this issue May 22, 2017 · 3 comments
Open

Paging? #10

bwalsh opened this issue May 22, 2017 · 3 comments

Comments

@bwalsh
Copy link
Collaborator

bwalsh commented May 22, 2017

Q: how to apply the paging pattern?
I see this in the tinkerpop docs ...

http://tinkerpop.apache.org/docs/current/reference/#range-step

@prismofeverything

@prismofeverything
Copy link
Contributor

Hey Brian,

There is a range step in Ophion as well, which works pretty much the same.

`.range(lower, upper)`

@bwalsh
Copy link
Collaborator Author

bwalsh commented Jun 7, 2017

@prismofeverything
Thanks Ryan,

I've tried the following...

 [{"has":{"key":"gid","condition":{"within":[{"s":"project:TCGA-ACC"}]}}},{"out":{"labels":["hasMember"]}},{"lower":1,"upper":10}]

and

 [{"has":{"key":"gid","condition":{"within":[{"s":"project:TCGA-ACC"}]}}},{"out":{"labels":["hasMember"]}},{"lower":0,"upper":10}]

This results in:

roxy to http://bmeg.compbio.ohsu.edu/vertex/query request: [{"has":{"key":"gid","condition":{"within":[{"s":"project:TCGA-ACC"}]}}},{"out":{"labels":["hasMember"]}},{"lower":1,"upper":10}]
ERROR:tornado.application:Uncaught exception POST /vertex/query (::1)
HTTPServerRequest(protocol='http', host='localhost:8080', method='POST', uri='/vertex/query', version='HTTP/1.1', remote_ip='::1', headers={'Origin': 'http://localhost:8080', 'Content-Length': '129', 'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Host': 'localhost:8080', 'Accept': 'application/json', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', 'Dnt': '1', 'Connection': 'keep-alive', 'Referer': 'http://localhost:8080/cohorts/', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Content-Type': 'application/json'})
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 1467, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "proxy.py", line 46, in post
    response = urllib2.urlopen(request)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: Internal Server Error
ERROR:tornado.access:500 POST /vertex/query (::1) 15.12ms

"<title>500: Internal Server Error</title>500: Internal Server Error"

@prismofeverything
Copy link
Contributor

Ah right, the lower/upper are arguments to the range directive, so you would have to nest it like this:

{"range": {"lower": 0, "upper": 10}}

Let me know if that works for you.

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

No branches or pull requests

2 participants