Question:
I am in a learning phase of SPARQL so excuse if the question sounds basic. I am exploring SPARQLWrapper to connect to a SPARQL endpoint to fetch some data. Below is the query.Answer:
To be able to query a graph with SPARQLWrapper, you need to load this graph in a SPARQL endpoint. Such an endpoint could be hosted locally, e.g.:Instead of using SPARQLWrapper, you could consider using RDFLib (which gets used by SPARQLWrapper, and comes from the same developers), which allows you to query endpoints (using
SERVICE
) as well as files (no need to load them in an endpoint).If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review