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

search_node() API is not working #14

Closed
rodriguesk opened this issue Jul 26, 2020 · 2 comments · Fixed by #15
Closed

search_node() API is not working #14

rodriguesk opened this issue Jul 26, 2020 · 2 comments · Fixed by #15
Assignees
Labels
bug Something isn't working

Comments

@rodriguesk
Copy link
Member

The API should take in any node in the ontology and then returns JSON that represents all relevant data stored in the ontology.

Currently this is what happens:
Screen Shot 2020-07-25 at 9 49 11 PM

Additionally, the error screen showing I think is also the wrong error screen? I think the error should be showing the search_node API error message if there is an issue.

climatemind-backend-master$ env FLASK_APP=climatemind.py flask run
 * Serving Flask app "climatemind.py"
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
* Owlready2 * Warning: optimized Cython parser module 'owlready2_optimized' is not available, defaulting to slower Python implementation
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [25/Jul/2020 21:29:03] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [25/Jul/2020 21:29:03] "GET /favicon.ico HTTP/1.1" 404 -
[2020-07-25 21:30:31,145] ERROR in app: Exception on /ontology [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/kameronr/Documents/personal/climate change outreach/new uploads/climatemind-backend-master/knowledge_graph/routes.py", line 21, in query
    mind = app.config["MIND"]
KeyError: 'MIND'
127.0.0.1 - - [25/Jul/2020 21:30:31] "GET /ontology?query=coal+mining HTTP/1.1" 500 -
@rodriguesk rodriguesk added the bug Something isn't working label Jul 26, 2020
@rodriguesk
Copy link
Member Author

rodriguesk commented Jul 26, 2020

The fix may run into issues with code recently merged to master. If this happens, feel free to copy old working code and rename them as separate functions and change the API to work accordingly. The new changes merged to master are meant to be used for a different API endpoint (the multiparameter endpoint). When we merged to master, I forgot about ensuring the code works with our old single-node endpoint.

We need to get CI/CD working for backend too. Ideally the recent merges to master shouldn't have even been allowed. @rolandoldengarm Please let us know what we need to do on the backend to get standards in line with what's needed for CI/CD. I'm assuming having certain kinds of tests and protocols for merging are expected, just not sure what exactly.

@seanmajorpayne
Copy link
Member

It's fixed.

@rodriguesk rodriguesk linked a pull request Jul 26, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants