Install & Compatibility
Where this runs
tested against v0.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.348s · 23.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.3s · import 0.314s · 24MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SlurpyGraph
✓ from sparqlslurper import SlurpyGraph
✗ from sparqlslurper import SlurperGraph
Common typo: 'SlurperGraph' does not exist; use 'SlurpyGraph'.
Load an RDF graph, slurp SPARQL results, and iterate rows.
from sparqlslurper import SlurpyGraph
from rdflib import Graph
g = Graph()
g.parse('https://example.org/data.ttl', format='turtle')
slurper = SlurpyGraph(g)
for row in slurper.query('SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10'):
print(row.s, row.p, row.o)
Errors
Common errors & fixes
ImportError: cannot import name 'SlurpyGraph' from 'sparqlslurper'
Installed version is too old (pre-0.5.0) or package name mismatch.
fixUpgrade sparqlslurper: pip install --upgrade sparqlslurper. Correct import: from sparqlslurper import SlurpyGraph.
AttributeError: 'NoneType' object has no attribute 's'
SPARQL query returned no results; .s attribute is accessed on None row.
fixCheck if query returns results: for row in results: ... or handle with if results:.
sparqlslurper.SPARQLQueryError: (sparqlslurper) Query error: ...
Invalid SPARQL syntax or endpoint issues.
fixVerify SPARQL syntax with an online validator or endpoint URL. Ensure prefixes are declared.
Upgrade
Version history
0.5.1latest on PyPI · released Dec 21, 2021
Audit
Dependencies
rdflibrequiredCore dependency for RDF graph handling and SPARQL query engine.
SPARQLWrapperoptionalOptional: used for remote SPARQL endpoints.