Hi,
I need to know if it is possible to build a web app on a sparql endpoint, using Anvil.
The SPARQL endpoint will be retrieving the information from an RDF triple storage (graph database)
If it is possible, where can I find documentation or tutorials that show how to do it?
Or if it is not a standard functionallity, if there is any workaround to achieve it?
Thank you very much
Regards
I don’t know if you are trying to create an app that consumes data from a SPARQL endpoint, or an app that provides a SPARQL endpoint to other apps.
To consume data you’d just make the required HTTP requests from an Anvil app’s server module. I’m sure you could get the Python sparql-client installed to make that easier.
Hi,
I’m trying to consume data from a SPARQL endpoint.
To clarify, I want to make an app that offers the user an input form with some fields that will be the criteria for filtering in the query. Send the query, retrieve the answer data set, and show it to the user in a nice format.
My uncertainty is that in general to request information from a SPARQL endpoint, you send a SPARQL query, and the endpoint returns the information in a RDF serialization format (XML, Turtle, or others).
And I’m a bit lost in how to handle either sending the query or processing the answer to show back to the user, using the Anvil environment, and how it ties to the UI.
My apologies if the question is too basic, but this is my first time with Anvil.
Thank you!!
You would want to use the Python SPARQL client wrapper. That abstracts away the parsing of the result and provides you a more Pythonic interface to it: sparql-client · PyPI
That client is not available on the server at the moment, so you’d need to request it be installed from Anvil support.
Great answer!
As an alternative to run it on the web, and have to trigger a server installation from support team, can I do a local installation of the open source Anvil server, and install the library on my local Anvil/Python environment? (if you feel this is a whole different question ,please let me know, and I will open a new topic)
Thank you!!!
Yes, of course, you could do it that way, too. Probably as long as you’ve got the package installed in the same virtual environment that Anvil is running on, you’d be able to access it.
2 Likes