sparqlslurper
SPARQL Slurper for rdflib
What it is and what it does
SPARQL Slurper bridges rdflib and remote SPARQL endpoints by implementing an rdflib Graph subclass that translates the standard Graph.triples() interface into SPARQL queries. When you call triples() with a pattern, it converts that pattern to a SPARQL query, sends it to a configured endpoint, and returns the results as if they were local RDF data. This lets you work with remote RDF data using familiar rdflib code without manually writing SPARQL queries.
The package depends on rdflib for RDF handling, sparqlwrapper for endpoint communication, and rdflib-shim as a compatibility layer. It includes special handling for blank nodes (BNodes) through optional persistent_bnodes mode and a GraphDBSlurpyGraph variant for GraphDB stores. However, the project has been abandoned since late 2021 with no recent maintenance, so compatibility with current library versions is uncertain.
Use it for:
- Query a remote SPARQL endpoint using rdflib's familiar Graph API without writing SPARQL manually.
- Cache and filter RDF data from a semantic web endpoint by translating triple patterns into SPARQL WHERE clauses.
- Build RDF applications that work with both local and remote graphs using a unified interface.
- Explore linked data from public SPARQL endpoints (DBpedia, Wikidata) through standard rdflib operations.
- Prototype semantic web applications that may later migrate between local and remote data sources.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Translates rdflib Graph.triples() calls into SPARQL queries and resolves them against a remote SPARQL endpoint, acting as a caching layer for RDF data.
No—this package is abandoned (last release 2021-12-21, no commits since). While install friction is low and the license is permissive, the lack of maintenance means no fixes for compatibility issues with current rdflib or sparqlwrapper versions. Use only if you are maintaining legacy code already depending on it; for new projects, consider actively maintained SPARQL clients or rdflib's own query capabilities.
Install
sparqlslurper on PyPI
pip
pip install sparqlslurperuv
uv add sparqlslurperpoetry
poetry add sparqlslurperInstalling sparqlslurper
Before you install
Low install friction with only three runtime dependencies (rdflib, sparqlwrapper, rdflib-shim). However, the package is abandoned—last release was 2021-12-21 with no commits since then, so expect no maintenance or bug fixes.
License in practice
CC0 1.0 Universal is a public-domain dedication with no restrictions; you may use, modify, and distribute the code freely with no attribution or license notice required.
Quickstart
pip install sparqlslurper
from sparqlslurper import SlurpyGraph
graph = SlurpyGraph(sparql_endpoint_url)
for s, p, o in graph.triples((None, None, None)):
print(s, p, o)
Requires Python 3.7.4 or higher and a working SPARQL endpoint URL to connect to.
Verify before relying
- Current compatibility with modern rdflib and sparqlwrapper versions (last tested 2021).
- Whether BNode handling workarounds (persistent_bnodes, GraphDBSlurpyGraph) are production-ready or experimental.
- Performance characteristics and memory footprint for large result sets from endpoints.
Package facts
| License | CC0 1.0 Universal (permissive) |
| Python support | supports the current Python release (>=3.7.4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — rdflib-shim, rdflib, sparqlwrapper |
| Maintenance | abandoned — 1,697 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 262,255/month — #8,377 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sparqlslurper-0.5.1-py3-none-any.whl
Keywords: SPARQL, ShEx, RDF, rdflib
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
SPARQLWrapperSPARQLWrapper provides a Python interface to…
unclear · top 5,000 on PyPI
CFGraphCFGraph extends rdflib's Graph to read RDF…
permissive · top 15,000 on PyPI
rdflibRDFLib is a Python library for parsing,…
permissive · top 1,000 on PyPI
pymanticPymantic parses and queries RDF and semantic…
permissive · top 15,000 on PyPI
owlrlImplements OWL2 RL Profile and RDFS inference…
unclear · top 5,000 on PyPI
pyoxigraphPyoxigraph is a Python library that provides…
permissive · top 15,000 on PyPI
rdflib-jsonldProvides JSON-LD parsing and serialization for…
permissive · top 15,000 on PyPI
pyshaclValidates RDF graphs against SHACL shape…
permissive · top 5,000 on PyPI
pyrdfa3Parses RDFa markup embedded in HTML documents…
unclear · top 15,000 on PyPI
pystardogPython client library for querying and managing…
permissive · top 15,000 on PyPI