tools4RDF is a Python toolkit for working with RDF data, SPARQL queries, and semantic networks.
It allows one or more ontologies to be parsed and represented as Python classes, making it easier to navigate and explore their structure through features like autocompletion in interactive environments such as Jupyter notebooks.
The aim is to make querying knowledge graphs with SPARQL more accessible to users without deep expertise in semantic web technologies.
🚀 Features
- Load and serialize RDF graphs (Turtle, RDF/XML, N-Triples, etc.)
- Compose and run SPARQL queries programmatically
- Auto-discover ontology terms via dot-access
- Query graphs and return results as
pandasDataFrames - Perform graph merging and basic path reasoning
📦 Installation
pip install tools4rdf
Or:
conda install -c conda-forge tools4rdf
📘 Example
from tools4rdf import OntologyNetwork
onto = OntologyNetwork('http://xmlns.com/foaf/0.1/')
df = onto.query(
'https://dbpedia.org/sparql',
onto.terms.foaf.Person,
onto.terms.foaf.familyName,
limit=10,
)
More examples available in the docs.
📄 License
MIT License
🤝 Contributing
Issues and pull requests are welcome! Feel free to suggest new utilities or improvements.
📌 Acknowledgement
This work is supported by the NFDI-Matwerk consortia.
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under the National Research Data Infrastructure – NFDI 38/1 – project number 460247524
Metadata
Release files for tools4rdf 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tools4rdf-0.3.8.tar.gz | 45.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tools4rdf-0.3.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 85.6 kB
Release files / tools4rdf-0.3.8.tar.gz
| Download URL | tools4rdf-0.3.8.tar.gz |
|---|---|
| Size | 45.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07e2d10e10dbb78ef18192f504eab4c407a5bc8d637acd999923d819d397e548
|
|
BLAKE2b-256 checksum How to use checksums |
1d7ca1a0497531e85de654d068064dbde01be24c424f4d9f72427a1242ee25f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / tools4rdf-0.3.8-py3-none-any.whl
| Download URL | tools4rdf-0.3.8-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bb129c6266b2f7d8337de63fdd415065531d3d66d085a8b01f1734177ae2da9
|
|
BLAKE2b-256 checksum How to use checksums |
18ce65143496431638ee0182a82b06fe86672b00567acd817b42380e9893dae4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|