--- id: sparqlwrapper version: "2.0.0" license: W3C SOFTWARE NOTICE AND LICENSE license_treatment: unclear maintenance: active --- # SPARQLWrapper — SPARQL Endpoint interface to Python License: unclear · Maintenance: active · Downloads: 1.4M/mo ## 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 above — verify before relying. SPARQLWrapper provides a Python interface to query remote SPARQL endpoints, handling query construction and result conversion into manageable formats like JSON, XML, and RDF graphs. 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 pip install sparqlwrapper uv add sparqlwrapper poetry add sparqlwrapper ## Installing SPARQLWrapper Before you install: Low install friction with a single runtime dependency (rdflib). Actively maintained with recent commits and ongoing repository activity. 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"]) Requires a live SPARQL endpoint URL; queries will fail if the endpoint is unreachable or does not support the requested query type. 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 - License: W3C SOFTWARE NOTICE AND LICENSE (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sparql endpoint client, rdf query python, semantic web queries, linked data access, sparql wrapper, rdf graph queries, w3c sparql protocol, semantic-web, linked-data, rdf [View on SkillFed](https://skillfed.io/packages/sparqlwrapper) · [View on PyPI](https://pypi.org/project/sparqlwrapper/)