-
Notifications
You must be signed in to change notification settings - Fork 53
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
Issue querying the Bioregistry SPARQL endpoint from various triplestores #775
Comments
Hi @cthoyt, I realized after writing vemonet/rdflib-endpoint#8 that you were talking about integrating the curie mapping endpoint to the bioregistry flask app 😅 I implemented the use of You can find the changes done in the branch Let me know if it fits your requirements, I did not see any impact on performance when serving the flask app locally through FastAPI Using I am facing issues when deploying with the current gunicorn config though, I think you will need to change the workers class to
I also implemented the custom processor in PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT REDUCED * WHERE {
?child owl:sameAs ?child_mapped .
}
VALUES (?child) {
(<http://purl.obolibrary.org/obo/CHEBI_1>)
(<http://purl.obolibrary.org/obo/CHEBI_2>)
} I'll clean up the code and send a pull request if this implementation works for you |
Let's plan to chat on monday morning - I want to make sure any changes in |
Yes, let's do this on monday
It is possible with FastAPI :) you can mount any thing on it as far as I know, then just serve with uvicorn/gunicorn (FastAPI just leverage existing standard to describe your API, it's quite well built). I even serve pre-compiled React progressive web apps with it in production without issues! I am not sure it is possible to do with Flask though (could be, but I did not find anything in my searches) The switch to use FastAPI adds just 2 clear lines of code in bio2registry, and does not loose any existing capabilities of the webapp (to be tested more though!)
For serving gunicorn/uvicorn etc is quite simple, and you have already done 99% of the job since it is already served through gunicorn, so you just need to enable to use the uvicorn worker class in your gunicorn setup |
Closes biopragmatics/bioregistry#775. This PR adds handling of headers to both the Flask and FastAPI implementations of the apps. - [x] Add Flask implementation - [x] Add FastAPI implementation - [x] Add Flask tests - [x] Add FastAPI tests - [ ] Should the `output` parameter be supported? CC @vemonet. Ideally, I'd like to use https://github.com/vemonet/rdflib-endpoint and not re-implement this code, but we'll have to work through a few issues first (improving code modularity, documentation, and figuring out Flask suppot) before I can give that a try
I implemented a more principled approach for handling content types in biopragmatics/curies#46 and improved response types, but I will re-open this since there are other solutions possible. @vemonet how about 13.00 CET on monday? i'll email you a zoom link |
I think https://flask.palletsprojects.com/en/2.2.x/patterns/appdispatch/#combining-applications might be appropriate for mounting fastapi on to flask |
Interesting, that might be a solution but will probably require some additional patching, because FastAPI is ASGI, and this is for WSGI apps This question seems to contain some interesting remarks: https://stackoverflow.com/questions/68769247/how-do-i-write-an-asgi-compliant-middleware-while-staying-framework-agnostic |
As of #780, this appears to be fixed 🚀 |
Hi @cthoyt
This issue follows up on #686 and #773
I tried to run federated queries to the new Bioregistry SPARQL endpoint from various triplestores using a simple SPARQL query:
From OpenLink Virtuoso
From a Virtuoso triplestore v7.2.9: https://bio2rdf.org/sparql (latest version of open source virtuoso) we get the following response:
It seems like the query is well processed, but the results are sent with the wrong content-type (
text/html
)From Ontotext GraphDB
GraphDB 10.1.0 using RDF4J 4.2.0: https://graphdb.dumontierlab.com/repositories/test
From Blazegraph
Not sure which version: http://kg-hub-rdf.berkeleybop.io/blazegraph/sparql
I think it's mostly related to the content-types they are expecting
The text was updated successfully, but these errors were encountered: