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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! Vocabulary type definitions used by the generated Schema.org lookup code.
//!
//! These types are populated at compile time by `build.rs` from the vendored
//! `schemaorg-all-https.jsonld` vocabulary file. All data is stored as
//! `&'static` references -- zero heap allocation at runtime.
/// Definition of a Schema.org type (e.g. `Product`, `Person`, `Event`).
///
/// Each type knows its parent types (for inheritance), its own properties,
/// and the full set of properties including inherited ones.
///
/// # Examples
///
/// ```no_run
/// # #[cfg(feature = "validation")]
/// # {
/// use schemaorg_rs::vocabulary;
///
/// let product = vocabulary::lookup_type("Product").unwrap();
/// assert!(product.has_property("name")); // inherited from Thing
/// assert!(product.has_property("offers")); // own property
/// assert!(!product.has_property("recipeCategory")); // not valid for Product
/// # }
/// ```
/// Definition of a Schema.org property (e.g. `name`, `price`, `image`).
///
/// Each property knows what value types it expects (`expected_types`)
/// and which types it belongs to (`domain_types`).
///
/// # Examples
///
/// ```no_run
/// # #[cfg(feature = "validation")]
/// # {
/// use schemaorg_rs::vocabulary;
///
/// let price = vocabulary::lookup_property("price").unwrap();
/// assert!(price.expected_types.contains(&"Number"));
/// assert!(price.expected_types.contains(&"Text"));
/// assert!(price.domain_types.contains(&"Offer"));
/// # }
/// ```
/// Definition of a Schema.org enumeration member (e.g. `InStock`, `Discontinued`).
///
/// # Examples
///
/// ```no_run
/// # #[cfg(feature = "validation")]
/// # {
/// use schemaorg_rs::vocabulary;
///
/// let member = vocabulary::lookup_enum_member("InStock").unwrap();
/// assert_eq!(member.enum_type, "ItemAvailability");
/// # }
/// ```