RdfCrate
RO-Crate builder that uses RDF concepts.
Detailed documentation available here.
Advantages
- Simple API that doesn’t require understanding JSON-LD
- Library of types and properties to speed up development and ensure correctness
- Valid JSON-LD guaranteed
- Type checker friendly
Installation
pip install rdfcrate
Example
Let’s say you have a directory with one file in it, which you want to document. Here’s how you could make an RO-Crate using RdfCrate:
from rdfcrate import AttachedCrate, uris
from rdflib import Literal
crate = AttachedCrate("/path/to/crate")
crate.register_file("salvatore.jpg", [
(uris.name, Literal("Salvatore the Seal"))
])
print(crate.compile())
{
"@context": "https://w3id.org/ro/crate/1.1/context",
"@graph": [
{
"@id": "./",
"@type": "Dataset",
"datePublished": "2025-01-17T15:58:23.852731"
},
{
"@id": "salvatore.jpg",
"@type": "File",
"encodingFormat": "image/jpeg",
"name": "Salvatore the Seal"
},
{
"@id": "ro-crate-metadata.json",
"@type": "CreativeWork",
"about": {
"@id": "./"
},
"conformsTo": {
"@id": "https://w3id.org/ro/crate/1.1"
}
}
]
}
Metadata
Release files for rdfcrate 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rdfcrate-0.2.0.tar.gz | 3.7 MB | Without provenance | Details for rdfcrate-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rdfcrate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for rdfcrate-0.2.0-py3-none-any.whl |
Total release size: 3.8 MB
Release files / rdfcrate-0.2.0.tar.gz
| Download URL | rdfcrate-0.2.0.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43efd7d8aad72a1f260547224f0fb0a71c06698a73e3791385ccc4b52cbbb1be
|
|
BLAKE2b-256 checksum How to use checksums |
a5d47b7cf4abd07cc55d598f57748e68d5801887d02ef697c348ba8df156173c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.20
|
Release files / rdfcrate-0.2.0-py3-none-any.whl
| Download URL | rdfcrate-0.2.0-py3-none-any.whl |
|---|---|
| Size | 32.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1bb7f61b51f6e5de88fe9751bdcd9168839aa0eaecf9cd465c5e8166fa45231
|
|
BLAKE2b-256 checksum How to use checksums |
72532228fcbcfc7da26f2460d2c295bd98e5a2bbef01563435a8313ca92f8d80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.4.20
|
Security for rdfcrate 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.