sdml_core/stdlib/dc/
mod.rs1use crate::model::HasBody;
6use crate::model::{annotations::AnnotationBuilder, modules::Module};
7use crate::stdlib::{rdf, rdfs};
8use url::Url;
9
10pub const MODULE_NAME: &str = "dc";
15pub const MODULE_URL: &str = "http://purl.org/dc/elements/1.1/";
16
17pub const CONTRIBUTOR: &str = "contributor";
18pub const COVERAGE: &str = "coverage";
19pub const CREATOR: &str = "creator";
20pub const DATE: &str = "date";
21pub const DESCRIPTION: &str = "description";
22pub const FORMAT: &str = "format";
23pub const IDENTIFIER: &str = "identifier";
24pub const LANGUAGE: &str = "language";
25pub const PUBLISHER: &str = "publisher";
26pub const RELATION: &str = "relation";
27pub const RIGHTS: &str = "rights";
28pub const SOURCE: &str = "source";
29pub const SUBJECT: &str = "subject";
30pub const TITLE: &str = "title";
31pub const TYPE: &str = "type";
32
33pub fn module() -> Module {
38 #[allow(non_snake_case)]
39 let MODULE_IRI: url::Url = url::Url::parse(MODULE_URL).unwrap();
40 let mut module = Module::empty(id!(MODULE_NAME)).with_base_uri(Url::parse(MODULE_URL).unwrap());
41
42 module
43 .body_mut()
44 .add_to_imports(import!(id!(rdf::MODULE_NAME), id!(rdfs::MODULE_NAME)));
45
46 module.body_mut().extend_definitions(vec]. Where appropriate, named places or time periods may be used in preference to numeric identifiers such as sets of coordinates or date ranges."@en)
59 )
60 .into(),
61 rdf!(property CREATOR, MODULE_IRI)
62 .with_comment(lstr!("An entity primarily responsible for making the resource."@en))
63 .with_predicate(
64 id!(DESCRIPTION),
65 lstr!("Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity."@en)
66 )
67 .into(),
68 rdf!(property DATE, MODULE_IRI)
69 .with_comment(lstr!("A point or period of time associated with an event in the lifecycle of the resource."@en))
70 .with_predicate(
71 id!(DESCRIPTION),
72 lstr!("Date may be used to express temporal information at any level of granularity. Recommended practice is to express the date, date/time, or period of time according to ISO 8601-1 [[ISO 8601-1](https://www.iso.org/iso-8601-date-and-time-format.html)] or a published profile of the ISO standard, such as the W3C Note on Date and Time Formats [[W3CDTF](https://www.w3.org/TR/NOTE-datetime)] or the Extended Date/Time Format Specification [[EDTF](http://www.loc.gov/standards/datetime/)]. If the full date is unknown, month and year (YYYY-MM) or just year (YYYY) may be used. Date ranges may be specified using ISO 8601 period of time specification in which start and end dates are separated by a '/' (slash) character. Either the start or end date may be missing."@en)
73 )
74 .into(),
75 rdf!(property DESCRIPTION, MODULE_IRI)
76 .with_comment(lstr!("An account of the resource."@en))
77 .with_predicate(
78 id!(DESCRIPTION),
79 lstr!("Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource."@en)
80 )
81 .into(),
82 rdf!(property FORMAT, MODULE_IRI)
83 .with_comment(lstr!("The file format, physical medium, or dimensions of the resource."@en))
84 .with_predicate(
85 id!(DESCRIPTION),
86 lstr!("Recommended practice is to use a controlled vocabulary where available. For example, for file formats one could use the list of Internet Media Types [[MIME](https://www.iana.org/assignments/media-types/media-types.xhtml)]."@en)
87 )
88 .into(),
89 rdf!(property IDENTIFIER, MODULE_IRI)
90 .with_comment(lstr!("An unambiguous reference to the resource within a given context."@en))
91 .with_predicate(
92 id!(DESCRIPTION),
93 lstr!("Recommended practice is to identify the resource by means of a string conforming to an identification system."@en)
94 )
95 .into(),
96 rdf!(property LANGUAGE, MODULE_IRI)
97 .with_comment(lstr!("A language of the resource."@en))
98 .with_predicate(
99 id!(DESCRIPTION),
100 lstr!("Recommended practice is to use either a non-literal value representing a language from a controlled vocabulary such as ISO 639-2 or ISO 639-3, or a literal value consisting of an IETF Best Current Practice 47 [[IETF-BCP47](https://tools.ietf.org/html/bcp47)] language tag."@en)
101 )
102 .into(),
103 rdf!(property PUBLISHER, MODULE_IRI)
104 .with_comment(lstr!("An entity responsible for making the resource available."@en))
105 .with_predicate(
106 id!(DESCRIPTION),
107 lstr!("Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity."@en)
108 )
109 .into(),
110 rdf!(property RELATION, MODULE_IRI)
111 .with_comment(lstr!("A related resource."@en))
112 .with_predicate(
113 id!(DESCRIPTION),
114 lstr!("Recommended practice is to identify the related resource by means of a URI. If this is not possible or feasible, a string conforming to a formal identification system may be provided."@en)
115 )
116 .into(),
117 rdf!(property RIGHTS, MODULE_IRI)
118 .with_comment(lstr!("Information about rights held in and over the resource."@en))
119 .with_predicate(
120 id!(DESCRIPTION),
121 lstr!("Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights."@en)
122 )
123 .into(),
124 rdf!(property SOURCE, MODULE_IRI)
125 .with_comment(lstr!("A related resource from which the described resource is derived."@en))
126 .with_predicate(
127 id!(DESCRIPTION),
128 lstr!("The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system."@en)
129 )
130 .into(),
131 rdf!(property SUBJECT, MODULE_IRI)
132 .with_comment(lstr!("The topic of the resource."@en))
133 .with_predicate(
134 id!(DESCRIPTION),
135 lstr!("Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary."@en)
136 )
137 .into(),
138 rdf!(property TITLE, MODULE_IRI)
139 .with_comment(lstr!("A name given to the resource."@en))
140 .into(),
141 rdf!(property TYPE, MODULE_IRI)
142 .with_comment(lstr!("The nature or genre of the resource."@en))
143 .with_predicate(
144 id!(DESCRIPTION),
145 lstr!("Recommended practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [[DCMI-TYPE](http://dublincore.org/documents/dcmi-type-vocabulary/)]. To describe the file format, physical medium, or dimensions of the resource, use the Format element."@en)
146 )
147 .into(),
148 ]).unwrap();
149
150 module
151}
152
153pub mod am;
158
159pub mod terms;
160
161pub mod types;