SparqlModel documentation
The SQLModel of SPARQL — version 0.13.1
SparqlModel is a session-first ORM for RDF triple stores: Pydantic v2 SPARQLModel classes, SPARQLSession as the unit of work, and Python filters that compile to SPARQL. Run on in-memory graphs or remote SPARQL 1.1 endpoints.
Mapping (literals, terms, file I/O) is provided by the required dependency TripleModel — also Pydantic-based.
Start here
Python versions, extras ( |
|
First models, session, and query in minutes |
|
Nobel, DCAT, Wikidata, Schema.org — runnable |
|
Pydantic models, sessions, query DSL, FastAPI |
By role
You are… |
Start with |
|---|---|
Application developer |
Getting started → Real-world examples → Guides → SparqlModel ORM guide |
API / platform engineer |
|
Contributor / reviewer |
SparqlModel Technical Specification → SparqlModel (ORM) + TripleModel (mapping engine) → API reference |
Operator |
Feature overview
Area |
Capabilities (0.13.1) |
|---|---|
Pydantic |
|
Models |
|
Session |
Sync |
Queries |
|
Stores |
|
FastAPI |
|
Tip
Production checklist and 0.3–1.0 milestones: SparqlModel Technical Specification and SparqlModel Roadmap.
External links
Get started
Guides
- Guides
- Real-world examples
- SparqlModel ORM guide
- Two packages, one stack
- Pydantic integration
- Choose your package
- What you import from SparqlModel
- ORM lifecycle
- Async session (0.6+)
- Composition and cascade
- Query DSL
- Hydration
- HttpStore and the local mirror
- Export and file I/O
- Current integration status
- Production readiness
- When not to use SparqlModel
- Further reading
- SparqlModel production guide
- SparqlModel (ORM) + TripleModel (mapping engine)
Reference
- SparqlModel Technical Specification
- Production ORM checklist (1.3 GA gate)
- SPARQLSession
- Query builder
- SPARQL compilation
- Hydration
- SPARQLModel
- Relationships
- Persistence policy
- Mapping integration (TripleModel)
- HttpStore
- Security (SPARQL generation)
- Async API (target 0.6)
- Known limitations
- Optional: export and files
- FastAPI (optional extra)
- Feature ownership
- Maintainer boundaries
- Package layout
- Dependencies
- Related projects
- API reference
- Glossary
- Troubleshooting
executereturns IRIs thatgetcannot load- Stale mirror after an external writer updated the remote
- Mirror out of date after external bulk load
- Duplicate triples after UPDATE retry
- Transient HTTP errors (503 / timeouts)
- Large
put/ cascade UPDATE fails or times out - SELECT over GET and URL length
query().all()returns fewer rows than the remote SELECT- Stale data after
put - Exception in
withblock leaves session open - Pending
putnot visible inget QueryErroronNoneor wrong model classQueryError: Cannot combine OR and AND- Remote and mirror diverge after editing
session.graph !=behaves unexpectedly- URL strings become IRIs
RuntimeError: Cannot use a closed SPARQLSession- Thread safety / corrupted session state
- Build / import errors
- Getting help
Project
- SparqlModel Roadmap
- SparqlModel Project Plan
- Production ORM definition (1.3 GA north star)
- Parity tiers
- Competitive positioning
- Product positioning
- ORM thesis
- Architecture (Option A)
- Integration strategy
- Primary goals
- Target users
- Technology stack
- Releases (summary)
- Risks
- Strategy
- Plan: Fully Async, Rust-Backed RDF for Python
- Changelog
- Changelog
- Building documentation locally