1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! # ro-crate-rs
//!
//! 'ro-crate-rs' is a rust library for defining RO-Crates
//! (<https://www.researchobject.org/ro-crate/1.1/>) for research data. It enables
//! the reading, creation, modification, writing and archiving of ro-crate-metadata.json
//! files.
//!
//! This is not meant to be used for rapid prototyping, but more so for defined
//! pipelines, regular workflows or cases where validation or performance is
//! required. For rapid prototyping, either use the Python bindings for this library
//! or the native python library for RO-Crates (<https://github.com/ResearchObject/ro-crate-py/>).
//!
//! # Usage
//!
//! Create a basic crate with no entities:
//!
//! ```rust
//! let mut rocrate = RoCrate {
//! context: RoCrateContext::ReferenceContext(
//! "https://w3id.org/ro/crate/1.1/context".to_string(),
//! ),
//! graph: Vec::new(),
//! };
//!
//! let description = MetadataDescriptor {
//! id: "ro-crate-metadata.json".to_string(),
//! type_: DataType::Term("CreativeWork".to_string()),
//! conforms_to: Id::Id(IdValue {
//! id: "https://w3id.org/ro/crate/1.1".to_string(),
//! }),
//! about: Id::Id(IdValue {
//! id: "./".to_string(),
//! }),
//! dynamic_entity: None,
//! };
//!
//! let root_data_entity = RootDataEntity {
//! id: "./".to_string(),
//! type_: DataType::Term("Dataset".to_string()),
//! date_published: Option::Some("2024".to_string()),
//! license: Some(License::Id(Id::Id(IdValue {
//! id: "MIT LICENSE".to_string(),
//! }))),
//! dynamic_entity: None,
//! };
//! ```
//!