| Crates.io | rdftk_names |
| lib.rs | rdftk_names |
| version | 0.2.5 |
| created_at | 2020-07-28 17:37:31.85655+00 |
| updated_at | 2024-10-16 03:29:37.54217+00 |
| description | This crate provides a set of modules that contain the `IRI`s and `QName` strings for commonly used vocabularies. It also provides macro support for defining new namespaces in the same style as this library. |
| homepage | |
| repository | https://github.com/johnstonskj/rust-rdftk.git |
| max_upload_size | |
| id | 270555 |
| size | 41,569 |
This crate provides a set of modules that contain the
IRIs and QName
strings for commonly used vocabularies. It also provides macro support for
defining new namespaces in the same style as this library.
Te following table shows the set of namespaces supported, those with "TBD" in the module column are yet to be encoded.
| Module | Vocabulary | Namespace |
|---|---|---|
dt::dcam |
DCMI Abstract Model | http://purl.org/dc/dcam/ |
dt::dcmi_types |
DCMI Type Vocabulary | http://purl.org/dc/dcmitype/ |
dt::elements' |
DCMI Terms | http://purl.org/dc/elements/1.1/ |
dt::terms |
DCMI Terms legacy elements | http://purl.org/dc/terms/ |
foaf |
Friend of a Friend | http://xmlns.com/foaf/0.1/ |
geo |
Basic Geo Vocabulary | http://www.w3.org/2003/01/geo/wgs84_pos# |
owl |
http://www.w3.org/2002/07/owl# |
|
rdf |
http://www.w3.org/1999/02/22-rdf-syntax-ns# |
|
rdfs |
http://www.w3.org/2000/01/rdf-schema# |
|
xsd |
XML Schema data types | http://www.w3.org/2001/XMLSchema# |
| TBD | http://www.w3.org/2004/02/skos/core# |
|
| TBD | http://www.w3.org/ns/prov# |
|
| TBD | http://www.w3.org/ns/rdfa# |
|
| TBD | RDF Calendar | http://www.w3.org/2002/12/cal# |
| TBD | vCard Ontology | http://www.w3.org/2006/vcard/ns# |
| TBD | The Organization Ontology | http://www.w3.org/ns/org# |
| TBD | Creative Commons Rights Expression Language | http://creativecommons.org/ns# |
The namespace! macro takes three parameters:
Note that as this macro uses paste::item the client will need to have a
dependency on the paste crate.
The following example replicates the geo module using the namespace! macro.
#[macro_use]
extern crate rdftk_names;
use rdftk_names::Vocabulary;
namespace! {
GeoSpatialVocabulary,
"geo",
"http://www.w3.org/2003/01/geo/wgs84_pos#",
{
spatial_thing, "SpatialThing",
temporal_thing, "TemporalThing",
event, "Event",
point, "Point",
lat, "lat",
location, "location",
long, "long",
alt, "alt",
lat_long, "lat_long"
}
}
skos module members to remove build warnings.skos namespaces.date and hex_binary names in xsd namespace.namespace_uri to simply namespace.$name _str function for namespace members.rdftk_iri package which uses the url::Url and is more
efficient.namespace and nsname macros.use statements in either macro or client.README.md.rdftk_iri dependency reset to only major/minor.lib.rs,rdfs vocabulary.namespace macro now creates a local cache of Arc<IRI> instances to
reduce memory consumption.rdf:li.nsname macro public.