-
Notifications
You must be signed in to change notification settings - Fork 0
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
sources endpoint #124
sources endpoint #124
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlanSimmons I tested with installing your branch as a dependency in hs-ontology-api
and noticed this error:
[2024-05-15 14:27:00] ERROR in app:1449: Exception on /sources [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1519, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1517, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1503, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.9/site-packages/ubkg_api/common_routes/sources/sources_controller.py", line 27, in sources_get
result = sources_get_logic(neo4j_instance, sab=sab, context=context)
File "/usr/local/lib/python3.9/site-packages/ubkg_api/common_routes/common_neo4j_logic.py", line 1057, in sources_get_logic
querytxt = loadquerystring('sources.cypher')
File "/usr/local/lib/python3.9/site-packages/ubkg_api/common_routes/common_neo4j_logic.py", line 71, in loadquerystring
f = open(fpath, "r")
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/ubkg_api/cypher/sources.cypher'
[pid: 53|app: 0|req: 1/10] 172.31.17.198 () {68 vars in 1798 bytes} [Wed May 15 14:27:00 2024] GET /sources => generated 265 bytes in 7 msecs (HTTP/1.1 500) 2 headers in 99 bytes (1 switches on core 0)
The cypher
directory is not there after package installation, which also means all the endpoints in ubkg-api
will not work when accessing them from hs-ontology-api
. We definitely need to address this issue before making them available via x-atlas-consortia/hs-ontology-api#94
The endpoint works when ubkg-api is installed as an editable package--i.e., requirements.txt shows
instead of where 2.1.2 would be the (bumped) version of ubkg-api. If this does not work when ubkg-api is compiled as a package, I think that we'll need to add the cypher folder to a MANIFEST.in file in the src path, as described here. I can create the MANIFEST.in file; however, I would not be able to test it, because I don't have privileges to create packages in PyPi. |
@yuanzhou I just pushed a MANIFEST.in file. It only contains one statement:
|
sources endpoint: returns information on the sources that can be imported into a UBKG context