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

sources endpoint #124

Merged
merged 8 commits into from
May 16, 2024
Merged

sources endpoint #124

merged 8 commits into from
May 16, 2024

Conversation

AlanSimmons
Copy link
Collaborator

sources endpoint: returns information on the sources that can be imported into a UBKG context

@AlanSimmons AlanSimmons requested a review from yuanzhou May 9, 2024 20:46
@AlanSimmons AlanSimmons self-assigned this May 9, 2024
@AlanSimmons AlanSimmons added enhancement New feature or request HuBMAP/SenNet labels May 9, 2024
Copy link
Contributor

@yuanzhou yuanzhou left a 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

@AlanSimmons
Copy link
Collaborator Author

The endpoint works when ubkg-api is installed as an editable package--i.e., requirements.txt shows

https://github.com/x-atlas-consortia/ubkg-api.git@simmons/sources-endpoint

instead of
ubkg-api==<version>

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.

@AlanSimmons
Copy link
Collaborator Author

@yuanzhou I just pushed a MANIFEST.in file. It only contains one statement:

# Add to the package distribution query strings in the Cypher path.

graft src/cypher

@yuanzhou yuanzhou merged commit c9eed1c into dev-integrate May 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HuBMAP/SenNet
Development

Successfully merging this pull request may close these issues.

2 participants