How odysa/rdf4j-python works
Project type and purpose
• rdf4j-python is a Python SDK / client library that provides both synchronous and asynchronous Pythonic interfaces to the Java-based Eclipse RDF4J HTTP API.
• Its goal is to allow Python applications to manage RDF4J repositories, execute SPARQL queries/updates, and manipulate RDF data without leaving Python.
File structure
Top-level:
• .github/workflows – CI and release pipelines
• docs – Sphinx documentation setup
• examples – usage snippets
• pyproject.toml – packaging and dependencies
• rdf4j_python – main package
– _client: high-level AsyncRdf4j/Rdf4jContext classes
– _driver: low-level wrappers around HTTP endpoints for repositories, graphs, etc.
– model: data models (Namespace, RepositoryConfig, Term, Vocabulary)
– exception: custom exceptions for repository errors
– utils: constants and helper functions
• tests – pytest suite (unit tests, docker-compose for integration)
README for insights
• Supports async/await and sync usage
• Core features: repository management, SPARQL execution, triple add/get
• Dependencies: HTTP transport to RDF4J server; Python 3.8+
Detail
• Transport protocols (HTTP methods, endpoints, MIME types)
• Both async and sync paths if desired (e.g., two parallel flows)
• Notes on configuration points (pyproject.toml, environment variables, default ports)