sdml_core/stdlib/dc/
terms.rs

1/*!
2This Rust module contains the SDML model of the SDML library module `dc_terms`.
3*/
4
5use crate::model::HasBody;
6use crate::model::{annotations::AnnotationBuilder, modules::Module};
7use crate::stdlib::{rdf, rdfs};
8use url::Url;
9
10// ------------------------------------------------------------------------------------------------
11// Public Macros
12// ------------------------------------------------------------------------------------------------
13
14// ------------------------------------------------------------------------------------------------
15// Public Types
16// ------------------------------------------------------------------------------------------------
17
18pub const MODULE_NAME: &str = "dc_terms";
19pub const MODULE_URL: &str = "http://purl.org/dc/terms/";
20
21pub const CONTRIBUTOR: &str = "contributor";
22pub const COVERAGE: &str = "coverage";
23pub const CREATOR: &str = "creator";
24pub const DATE: &str = "date";
25pub const DESCRIPTION: &str = "description";
26pub const FORMAT: &str = "format";
27pub const IDENTIFIER: &str = "identifier";
28pub const LANGUAGE: &str = "language";
29pub const PUBLISHER: &str = "publisher";
30pub const RELATION: &str = "relation";
31pub const RIGHTS: &str = "rights";
32pub const SOURCE: &str = "source";
33pub const SUBJECT: &str = "subject";
34pub const TITLE: &str = "title";
35pub const TYPE: &str = "type";
36
37// ------------------------------------------------------------------------------------------------
38// Public Functions
39// ------------------------------------------------------------------------------------------------
40
41pub fn module() -> Module {
42    #[allow(non_snake_case)]
43    let MODULE_IRI: url::Url = url::Url::parse(MODULE_URL).unwrap();
44    let mut module = Module::empty(id!(MODULE_NAME)).with_base_uri(Url::parse(MODULE_URL).unwrap());
45
46    module
47        .body_mut()
48        .add_to_imports(import!(id!(rdf::MODULE_NAME), id!(rdfs::MODULE_NAME)));
49
50    module.body_mut().extend_definitions(vec![
51        rdf!(property CONTRIBUTOR, MODULE_IRI)
52            .with_comment(lstr!("An entity responsible for making contributions to the resource."@en))
53            .with_predicate(
54                id!(DESCRIPTION),
55                lstr!("The guidelines for using names of persons or organizations as creators also apply to contributors.  Typically, the name of a Contributor should be used to indicate the entity."@en)
56            )
57            .into(),
58        rdf!(property COVERAGE, MODULE_IRI)
59            .with_comment(lstr!("The spatial or temporal topic of the resource, spatial applicability of the resource, or jurisdiction under which the resource is relevant."@en))
60            .with_predicate(
61                id!(DESCRIPTION),
62                lstr!("Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended practice is to use a controlled vocabulary such as the Getty Thesaurus of Geographic Names [[TGN](https://www.getty.edu/research/tools/vocabulary/tgn/index.html)]. Where appropriate, named places or time periods may be used in preference to numeric identifiers such as sets of coordinates or date ranges."@en)
63            )
64            .into(),
65        rdf!(property CREATOR, MODULE_IRI)
66            .with_comment(lstr!("An entity primarily responsible for making the resource."@en))
67            .with_predicate(
68                id!(DESCRIPTION),
69                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)
70            )
71            .into(),
72        rdf!(property DATE, MODULE_IRI)
73            .with_comment(lstr!("A point or period of time associated with an event in the lifecycle of the resource."@en))
74            .with_predicate(
75                id!(DESCRIPTION),
76                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)
77            )
78            .into(),
79        rdf!(property DESCRIPTION, MODULE_IRI)
80            .with_comment(lstr!("An account of the resource."@en))
81            .with_predicate(
82                id!(DESCRIPTION),
83                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)
84            )
85            .into(),
86        rdf!(property FORMAT, MODULE_IRI)
87            .with_comment(lstr!("The file format, physical medium, or dimensions of the resource."@en))
88            .with_predicate(
89                id!(DESCRIPTION),
90                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)
91            )
92            .into(),
93        rdf!(property IDENTIFIER, MODULE_IRI)
94            .with_comment(lstr!("An unambiguous reference to the resource within a given context."@en))
95            .with_predicate(
96                id!(DESCRIPTION),
97                lstr!("Recommended practice is to identify the resource by means of a string conforming to an identification system."@en)
98            )
99            .into(),
100        rdf!(property LANGUAGE, MODULE_IRI)
101            .with_comment(lstr!("A language of the resource."@en))
102            .with_predicate(
103                id!(DESCRIPTION),
104                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)
105            )
106            .into(),
107        rdf!(property PUBLISHER, MODULE_IRI)
108            .with_comment(lstr!("An entity responsible for making the resource available."@en))
109            .with_predicate(
110                id!(DESCRIPTION),
111                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)
112            )
113            .into(),
114        rdf!(property RELATION, MODULE_IRI)
115            .with_comment(lstr!("A related resource."@en))
116            .with_predicate(
117                id!(DESCRIPTION),
118                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)
119            )
120            .into(),
121        rdf!(property RIGHTS, MODULE_IRI)
122            .with_comment(lstr!("Information about rights held in and over the resource."@en))
123            .with_predicate(
124                id!(DESCRIPTION),
125                lstr!("Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights."@en)
126            )
127            .into(),
128        rdf!(property SOURCE, MODULE_IRI)
129            .with_comment(lstr!("A related resource from which the described resource is derived."@en))
130            .with_predicate(
131                id!(DESCRIPTION),
132                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)
133            )
134            .into(),
135        rdf!(property SUBJECT, MODULE_IRI)
136            .with_comment(lstr!("The topic of the resource."@en))
137            .with_predicate(
138                id!(DESCRIPTION),
139                lstr!("Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary."@en)
140            )
141            .into(),
142        rdf!(property TITLE, MODULE_IRI)
143            .with_comment(lstr!("A name given to the resource."@en))
144            .into(),
145        rdf!(property TYPE, MODULE_IRI)
146            .with_comment(lstr!("The nature or genre of the resource."@en))
147            .with_predicate(
148                id!(DESCRIPTION),
149                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)
150            )
151            .into(),
152    ]).unwrap();
153
154    module
155}
156
157// ------------------------------------------------------------------------------------------------
158// Private Macros
159// ------------------------------------------------------------------------------------------------
160
161// ------------------------------------------------------------------------------------------------
162// Private Types
163// ------------------------------------------------------------------------------------------------
164
165// ------------------------------------------------------------------------------------------------
166// Implementations
167// ------------------------------------------------------------------------------------------------
168
169// ------------------------------------------------------------------------------------------------
170// Private Functions
171// ------------------------------------------------------------------------------------------------
172
173// ------------------------------------------------------------------------------------------------
174// Modules
175// ------------------------------------------------------------------------------------------------