$npx skillfedfor your agent

SPARQLWrapper

SPARQL Endpoint interface to Python

Worth itPyPI Python ModulesReleased Mar 20221.4M downloads / moW3C SOFTWARE NOTICE AND LICENSEPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — SPARQLWrapper-2.0.0-py3-none-any.whl
v2.0.0 · released 2022-03-13 · Python >=3.7 · 1 runtime deps: rdflib

Yes. SPARQLWrapper is a mature, actively maintained library with low install friction and no known vulnerabilities. It's the standard Python tool for SPARQL endpoint access. Install it if you need to query remote RDF data sources; the only caveat is to review the W3C license terms for your use case.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a live SPARQL endpoint URL; queries will fail if the endpoint is unreachable or does not support the requested query type.
  • Low install friction with a single runtime dependency (rdflib).
  • Actively maintained with recent commits and ongoing repository activity.

License · maintenance · safety

W3C SOFTWARE NOTICE AND LICENSE (unclear) — Licensed under W3C SOFTWARE NOTICE AND LICENSE with unclear SPDX mapping. Review the license text before use in proprietary or commercial contexts to confirm compatibility with your project's requirements.

last release 2022-03-13 (1615 days) · last repo commit 2026-04-30 · 565 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,424,048 downloads/mo, #3,919 on PyPI

Verify before relying

from SPARQLWrapper import SPARQLWrapper, JSON

sparql = SPARQLWrapper("http://dbpedia.org/sparql")
sparql.setReturnFormat(JSON)
sparql.setQuery("SELECT * WHERE { ?s ?p ?o } LIMIT 1")
results = sparql.queryAndConvert()
print(results["results"]["bindings"])
  • Whether the W3C SOFTWARE NOTICE AND LICENSE is compatible with common open-source or proprietary licensing frameworks.
  • Current status of the package relative to SPARQL 1.1 specification compliance.
Same gist for agents: .md · .json

What it is and what it does

SPARQLWrapper is a Python client library that abstracts the complexity of communicating with remote SPARQL endpoints over HTTP. It lets you write SPARQL queries (SELECT, ASK, CONSTRUCT, DESCRIBE, UPDATE) in Python code, handles the HTTP protocol details, and automatically converts responses into Python-friendly formats—JSON objects, XML trees, or rdflib Graph objects—depending on the query type and your chosen return format.

The package is built on rdflib and supports multiple authentication methods, HTTP verbs, and result serializations. It includes both a Python API for programmatic use and a command-line tool (rqw) for ad-hoc queries. It's stable (Production/Stable status), supports Python 3.7, 3.8, 3.9, and 3.10, and has been in active maintenance.

Use it for

  • Query DBpedia or other public linked-data endpoints to retrieve structured facts about entities (people, places, concepts).
  • Build a semantic search or knowledge-graph application that needs to fetch RDF data from a remote triple store.
  • Integrate SPARQL queries into data pipelines that combine linked data with other Python data processing libraries.
  • Prototype or test SPARQL queries against a development endpoint before deploying them to production systems.
  • Retrieve and transform RDF graphs from remote endpoints into formats suitable for analysis or visualization.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

SPARQLWrapper is a mature, actively maintained library with low install friction and no known vulnerabilities. It's the standard Python tool for SPARQL endpoint access. Install it if you need to query remote RDF data sources; the only caveat is to review the W3C license terms for your use case.

Install

sparqlwrapper on PyPI

Before you install

Low install friction with a single runtime dependency (rdflib). Actively maintained with recent commits and ongoing repository activity.

Requires a live SPARQL endpoint URL; queries will fail if the endpoint is unreachable or does not support the requested query type.

License in practice

Licensed under W3C SOFTWARE NOTICE AND LICENSE with unclear SPDX mapping. Review the license text before use in proprietary or commercial contexts to confirm compatibility with your project's requirements.

Quickstart

from SPARQLWrapper import SPARQLWrapper, JSON

sparql = SPARQLWrapper("http://dbpedia.org/sparql")
sparql.setReturnFormat(JSON)
sparql.setQuery("SELECT * WHERE { ?s ?p ?o } LIMIT 1")
results = sparql.queryAndConvert()
print(results["results"]["bindings"])

Verify before relying

  • Whether the W3C SOFTWARE NOTICE AND LICENSE is compatible with common open-source or proprietary licensing frameworks.
  • Current status of the package relative to SPARQL 1.1 specification compliance.

Package facts

LicenseW3C SOFTWARE NOTICE AND LICENSE unclear
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
rdflib
MaintenanceActively maintained 1,615 days since the last release
Last repo commit
First released
Downloads1,424,048 / month, #3,919 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: W3C LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules

Evidence: SPARQLWrapper-2.0.0-py3-none-any.whl

Tags

Capabilities
sparql endpoint clientrdf query pythonsemantic web querieslinked data accesssparql wrapperrdf graph queriesw3c sparql protocol
Topics
semantic-weblinked-datardf
PyPI keywords
pythonsparqlrdfrdflib

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “rdf query python”

  • SPARQLWrapperSPARQLWrapper provides a Python interface to query remote SPARQL…
  • rdflibRDFLib is a Python library for parsing, querying, and serializing RDF…
  • pyoxigraphPyoxigraph is a Python library that provides in-memory and disk-based…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also sparqlslurper · rdflib · pymantic · owlrl · CFGraph · rdflib-jsonld · pyoxigraph · pystardog · owlready2 · prefixmaps