RDFLib is a pure Python package work working with RDF. RDFLib contains most things you need to work with RDF, including:
- parsers and serializers for RDF/XML, N3, NTriples, N-Quads, Turtle, TriX, Trig and JSON-LD (via a plugin).
- a Graph interface which can be backed by any one of a number of Store implementations
- store implementations for in-memory storage and persistent storage on top of the Berkeley DB
- a SPARQL 1.1 implementation - supporting SPARQL 1.1 Queries and Update statements
RDFlib Family of packages
The RDFlib community maintains many RDF-related Python code repositories with different purposes. Most of the currently
operating packages are shown in Figure 1.
Figure 1: Packages within the RDFlib family.
- rdflib-jsonld - an rdflib plugin that is an implementation of JSON-LD
- pymicrodata - This a module to extract RDF from an HTML5 page annotated with microdata
- pyrdfa3 - RDFa 1.1 distiller/parser library: can extract RDFa 1.1 (and RDFa 1.0, if properly set via a @Version attribute) from (X)HTML, SVG, or XML
- SPARQL tools:
- sparqlwrapper - a simple Python wrapper around a SPARQL service to remotely execute your queries
- OWL Reasoning & Documentation:
- OWL-RL - A simple implementation of the OWL2 RL Profile on top of RDFLib
- pyLODE - An OWL ontology documentation tool using Python and templating, based on LODE.
- SHACL validation:
- pySHACL - A Python validator for SHACL
- Linked Data APIs:
- pyLDAPI - A very small module to add Linked Data API functionality to a Python Flask installation
- Derived tools:
- VocPrez - A tool (API and web front-end), based on pyLDAPI, for the read-only delivery system of SKOS vocabularies.
Please see the list of all packages here:
See https://rdflib.readthedocs.io for our documentation built from the code.
For general “how do I…” queries, please use https://stackoverflow.com and tag your question with
rdflib 5.0.0 has just been released and 6.0.0 is now being word on - April 2020.
||29 Jun 2020 (expected)
||This will include major breaking changes such as no support for Python 2 or 3.4, Python 3.5+ only
||18 Apr 2020
||Current stable release.
master contents as of 18 Apr 2020
Last release with Python 2 & 3.4 support
||04 Apr 2020
||This was a pre-release of all changes in
master as of 04 Apr 2020
||30 Jan 2017
||Previous stable release.
||12 Nov 2002
rdflib survives and grows via user contributions! Please consider lodging Pull Requests here:
You can also raise issues here:
If you want to contact the rdflib maintainers, please do so via the rdflib-dev mailing list: