Skip to main content

oxrdf/
vocab.rs

1//! Provides ready to use [`NamedNodeRef`](super::NamedNodeRef)s for basic RDF vocabularies.
2
3pub mod rdf {
4    //! [RDF](https://www.w3.org/TR/rdf11-concepts/) vocabulary.
5    use crate::named_node::NamedNodeRef;
6
7    /// The class of containers of alternatives.
8    pub const ALT: NamedNodeRef<'_> =
9        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt");
10    /// The class of unordered containers.
11    pub const BAG: NamedNodeRef<'_> =
12        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag");
13    /// The class of language-tagged string literal values with a base direction.
14    #[cfg(feature = "rdf-12")]
15    pub const DIR_LANG_STRING: NamedNodeRef<'_> =
16        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString");
17    /// The first item in the subject RDF list.
18    pub const FIRST: NamedNodeRef<'_> =
19        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#first");
20    /// The class of HTML literal values.
21    pub const HTML: NamedNodeRef<'_> =
22        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML");
23    /// The datatype of RDF literals storing JSON content.
24    #[cfg(feature = "rdf-12")]
25    pub const JSON: NamedNodeRef<'_> =
26        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON");
27    pub const LANG_STRING: NamedNodeRef<'_> =
28        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");
29    /// The class of RDF lists.
30    pub const LIST: NamedNodeRef<'_> =
31        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#List");
32    /// The empty list.
33    pub const NIL: NamedNodeRef<'_> =
34        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil");
35    /// The object of the subject RDF statement.
36    pub const OBJECT: NamedNodeRef<'_> =
37        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#object");
38    /// The predicate of the subject RDF statement.
39    pub const PREDICATE: NamedNodeRef<'_> =
40        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate");
41    /// The class of RDF properties.
42    pub const PROPERTY: NamedNodeRef<'_> =
43        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#Property");
44    /// Associate a resource (reifier) with a triple (proposition).
45    #[cfg(feature = "rdf-12")]
46    pub const REIFIES: NamedNodeRef<'_> =
47        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies");
48    /// The rest of the subject RDF list after the first item.
49    pub const REST: NamedNodeRef<'_> =
50        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest");
51    /// The class of ordered containers.
52    pub const SEQ: NamedNodeRef<'_> =
53        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq");
54    /// The class of RDF statements.
55    pub const STATEMENT: NamedNodeRef<'_> =
56        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement");
57    /// The subject of the subject RDF statement.
58    pub const SUBJECT: NamedNodeRef<'_> =
59        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject");
60    /// The subject is an instance of a class.
61    pub const TYPE: NamedNodeRef<'_> =
62        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
63    /// Idiomatic property used for structured values.
64    pub const VALUE: NamedNodeRef<'_> =
65        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#value");
66    /// The class of XML literal values.
67    pub const XML_LITERAL: NamedNodeRef<'_> =
68        NamedNodeRef::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
69}
70
71pub mod rdfs {
72    //! [RDFS](https://www.w3.org/TR/rdf-schema/) vocabulary.
73    use crate::named_node::NamedNodeRef;
74
75    /// The class of classes.
76    pub const CLASS: NamedNodeRef<'_> =
77        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#Class");
78    /// A description of the subject resource.
79    pub const COMMENT: NamedNodeRef<'_> =
80        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#comment");
81    /// The class of RDF containers.
82    pub const CONTAINER: NamedNodeRef<'_> =
83        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#Container");
84    /// The class of container membership properties, `rdf:_1`, `rdf:_2`, ..., all of which are sub-properties of `member`.
85    pub const CONTAINER_MEMBERSHIP_PROPERTY: NamedNodeRef<'_> = NamedNodeRef::new_unchecked(
86        "http://www.w3.org/2000/01/rdf-schema#ContainerMembershipProperty",
87    );
88    /// The class of RDF datatypes.
89    pub const DATATYPE: NamedNodeRef<'_> =
90        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#Datatype");
91    /// A domain of the subject property.
92    pub const DOMAIN: NamedNodeRef<'_> =
93        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#domain");
94    /// The definition of the subject resource.
95    pub const IS_DEFINED_BY: NamedNodeRef<'_> =
96        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#isDefinedBy");
97    /// A human-readable name for the subject.
98    pub const LABEL: NamedNodeRef<'_> =
99        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#label");
100    /// The class of literal values, e.g. textual strings and integers.
101    pub const LITERAL: NamedNodeRef<'_> =
102        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#Literal");
103    /// A member of the subject resource.
104    pub const MEMBER: NamedNodeRef<'_> =
105        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#member");
106    /// A range of the subject property.
107    pub const RANGE: NamedNodeRef<'_> =
108        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#range");
109    /// The class resource, everything.
110    pub const RESOURCE: NamedNodeRef<'_> =
111        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#Resource");
112    /// Further information about the subject resource.
113    pub const SEE_ALSO: NamedNodeRef<'_> =
114        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#seeAlso");
115    /// The subject is a subclass of a class.
116    pub const SUB_CLASS_OF: NamedNodeRef<'_> =
117        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#subClassOf");
118    /// The subject is a subproperty of a property.
119    pub const SUB_PROPERTY_OF: NamedNodeRef<'_> =
120        NamedNodeRef::new_unchecked("http://www.w3.org/2000/01/rdf-schema#subPropertyOf");
121}
122
123pub mod xsd {
124    //! [RDF compatible XSD datatypes](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-compatible-xsd-types).
125    use crate::named_node::NamedNodeRef;
126
127    /// Absolute or relative URIs and IRIs.
128    pub const ANY_URI: NamedNodeRef<'_> =
129        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#anyURI");
130    /// Base64-encoded binary data.
131    pub const BASE_64_BINARY: NamedNodeRef<'_> =
132        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#base64Binary");
133    /// true, false.
134    pub const BOOLEAN: NamedNodeRef<'_> =
135        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#boolean");
136    /// 128…+127 (8 bit).
137    pub const BYTE: NamedNodeRef<'_> =
138        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#byte");
139    /// Dates (yyyy-mm-dd) with or without timezone.
140    pub const DATE: NamedNodeRef<'_> =
141        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#date");
142    /// Duration of time (days, hours, minutes, seconds only).
143    pub const DAY_TIME_DURATION: NamedNodeRef<'_> =
144        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#dayTimeDuration");
145    /// Date and time with or without timezone.
146    pub const DATE_TIME: NamedNodeRef<'_> =
147        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#dateTime");
148    /// Date and time with required timezone.
149    pub const DATE_TIME_STAMP: NamedNodeRef<'_> =
150        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#dateTimeStamp");
151    /// Arbitrary-precision decimal numbers.
152    pub const DECIMAL: NamedNodeRef<'_> =
153        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#decimal");
154    /// 64-bit floating point numbers incl. ±Inf, ±0, NaN.
155    pub const DOUBLE: NamedNodeRef<'_> =
156        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#double");
157    /// Duration of time.
158    pub const DURATION: NamedNodeRef<'_> =
159        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#duration");
160    /// 32-bit floating point numbers incl. ±Inf, ±0, NaN.
161    pub const FLOAT: NamedNodeRef<'_> =
162        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#float");
163    /// Gregorian calendar day of the month.
164    pub const G_DAY: NamedNodeRef<'_> =
165        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#gDay");
166    /// Gregorian calendar month.
167    pub const G_MONTH: NamedNodeRef<'_> =
168        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#gMonth");
169    /// Gregorian calendar month and day.
170    pub const G_MONTH_DAY: NamedNodeRef<'_> =
171        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#gMonthDay");
172    /// Gregorian calendar year.
173    pub const G_YEAR: NamedNodeRef<'_> =
174        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#gYear");
175    /// Gregorian calendar year and month.
176    pub const G_YEAR_MONTH: NamedNodeRef<'_> =
177        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#gYearMonth");
178    /// Hex-encoded binary data.
179    pub const HEX_BINARY: NamedNodeRef<'_> =
180        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#hexBinary");
181    /// -2147483648…+2147483647 (32 bit).
182    pub const INT: NamedNodeRef<'_> =
183        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#int");
184    /// Arbitrary-size integer numbers.
185    pub const INTEGER: NamedNodeRef<'_> =
186        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#integer");
187    /// Language tags per [BCP47](http://tools.ietf.org/html/bcp47).
188    pub const LANGUAGE: NamedNodeRef<'_> =
189        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#language");
190    /// -9223372036854775808…+9223372036854775807 (64 bit).
191    pub const LONG: NamedNodeRef<'_> =
192        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#long");
193    /// XML Names.
194    pub const NAME: NamedNodeRef<'_> =
195        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#Name");
196    /// XML NCName.
197    pub const NC_NAME: NamedNodeRef<'_> =
198        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#NCName");
199    /// Integer numbers <0.
200    pub const NEGATIVE_INTEGER: NamedNodeRef<'_> =
201        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#negativeInteger");
202    /// XML NMTOKENs.
203    pub const NMTOKEN: NamedNodeRef<'_> =
204        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#NMTOKEN");
205    /// Integer numbers ≥0.
206    pub const NON_NEGATIVE_INTEGER: NamedNodeRef<'_> =
207        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#nonNegativeInteger");
208    /// Integer numbers ≤0.
209    pub const NON_POSITIVE_INTEGER: NamedNodeRef<'_> =
210        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#nonPositiveInteger");
211    /// Whitespace-normalized strings.
212    pub const NORMALIZED_STRING: NamedNodeRef<'_> =
213        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#normalizedString");
214    /// Integer numbers >0.
215    pub const POSITIVE_INTEGER: NamedNodeRef<'_> =
216        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#positiveInteger");
217    /// Times (hh:mm:ss.sss…) with or without timezone.
218    pub const TIME: NamedNodeRef<'_> =
219        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#time");
220    /// -32768…+32767 (16 bit).
221    pub const SHORT: NamedNodeRef<'_> =
222        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#short");
223    /// Character strings (but not all Unicode character strings).
224    pub const STRING: NamedNodeRef<'_> =
225        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#string");
226    /// Tokenized strings.
227    pub const TOKEN: NamedNodeRef<'_> =
228        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#token");
229    /// 0…255 (8 bit).
230    pub const UNSIGNED_BYTE: NamedNodeRef<'_> =
231        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#unsignedByte");
232    /// 0…4294967295 (32 bit).
233    pub const UNSIGNED_INT: NamedNodeRef<'_> =
234        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#unsignedInt");
235    /// 0…18446744073709551615 (64 bit).
236    pub const UNSIGNED_LONG: NamedNodeRef<'_> =
237        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#unsignedLong");
238    /// 0…65535 (16 bit).
239    pub const UNSIGNED_SHORT: NamedNodeRef<'_> =
240        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#unsignedShort");
241    /// Duration of time (months and years only).
242    pub const YEAR_MONTH_DURATION: NamedNodeRef<'_> =
243        NamedNodeRef::new_unchecked("http://www.w3.org/2001/XMLSchema#yearMonthDuration");
244}
245
246pub mod geosparql {
247    //! [GeoSpatial](https://opengeospatial.github.io/ogc-geosparql/) vocabulary.
248    use crate::named_node::NamedNodeRef;
249
250    /// Geospatial datatype like `"Point({longitude} {latitude})"^^geo:wktLiteral`
251    pub const WKT_LITERAL: NamedNodeRef<'_> =
252        NamedNodeRef::new_unchecked("http://www.opengis.net/ont/geosparql#wktLiteral");
253}