Library for building RO-Crates using rdflib
Project description
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
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"
},
{
"@id": "salvatore.jpg",
"@type": "File",
"encodingFormat": "image/jpeg",
"name": "Salvatore the Seal"
},
{
"@id": "ro-crate-metadata.json",
"@type": "File",
"about": {
"@id": "."
},
"conformsTo": {
"@id": "https://w3id.org/ro/crate/1.1"
},
"encodingFormat": "application/json"
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rdfcrate-0.1.0.tar.gz
(3.7 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rdfcrate-0.1.0-py3-none-any.whl
(32.3 kB
view details)
File details
Details for the file rdfcrate-0.1.0.tar.gz.
File metadata
- Download URL: rdfcrate-0.1.0.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42d0fe713daee9a171085014777b3ca48df8cc4845d3dfca9fe287ad112233f7
|
|
| MD5 |
86235f1a035fdeb9df2b4442b579e8ba
|
|
| BLAKE2b-256 |
816779080ffe74facae71ec6442358601fe9114660f445fefafa6d10ed0fe637
|
File details
Details for the file rdfcrate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rdfcrate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aae7aa81cc5c6558dcdd1b6da2e1b55c8e749cf556076caa65b4bb4474d931d
|
|
| MD5 |
d56a9d2437e5ca06493804ed5fc783ac
|
|
| BLAKE2b-256 |
128c7ba2ddc73f935fb2e9249df2488ac4559e5c5199be0d834549b3862507dd
|