15 releases
0.2.5 | Oct 16, 2024 |
---|---|
0.2.4 | Oct 16, 2024 |
0.2.2 | Sep 6, 2024 |
0.1.9 | Jun 8, 2021 |
0.1.2 | Jul 28, 2020 |
#166 in Rust patterns
154 downloads per month
Used in 11 crates
(6 directly)
82KB
1K
SLoC
RDFtk: Names
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.
Vocabularies
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 |
Web Ontology Language | http://www.w3.org/2002/07/owl# |
rdf |
RDF Syntax | http://www.w3.org/1999/02/22-rdf-syntax-ns# |
rdfs |
RDF Schema | http://www.w3.org/2000/01/rdf-schema# |
xsd |
XML Schema data types | http://www.w3.org/2001/XMLSchema# |
TBD | Simple Knowledge Organization System (SKOS) | http://www.w3.org/2004/02/skos/core# |
TBD | PROV | http://www.w3.org/ns/prov# |
TBD | RDF in Attributes (RDFa) | 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
The namespace!
macro takes three parameters:
- The common prefix for the module,
- The namespace IRI for the module,
- A list of pairs where the first is the name of the function to return the IRI for the name, and the second is the string name of the vocabulary element.
Note that as this macro uses paste::item
the client will need to have a
dependency on the paste crate.
Example
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"
}
}
Changes
Version 0.2.4
- Fix: add comments to
skos
module members to remove build warnings.
Version 0.2.4
- Feature: add
skos
namespaces.
Version 0.2.3
- Feature: added missing
date
andhex_binary
names inxsd
namespace.
Version 0.2.2
- Feature: rename
namespace_uri
to simplynamespace
. - Feature: new version of the iri package requires validation of names.
- Feature: add new
$name _str
function for namespace members.
Version 0.2.1
- Build: cargo audit/outdated/udeps
Version 0.2.0
- Feature: moved to new
rdftk_iri
package which uses theurl::Url
and is more efficient. - Feature: performance improvements in the
namespace
andnsname
macros. - Feature: removed need for any
use
statements in either macro or client. - Build: updated Rust edition from 2018 to 2021.
- Docs: run markuplint on
README.md
.
Version 0.1.9
- Build:
rdftk_iri
dependency reset to only major/minor.
Version 0.1.8
- Style:
- applied a lot more warnings in
lib.rs
, - applied resulting warnings and Clippy suggestions,
- reformatted macro layout.
- applied a lot more warnings in
Version 0.1.7
- Feature: added missing names in
rdfs
vocabulary.
Version 0.1.6
- Build: updated paste package dependency.
Version 0.1.5
- Build: explicit version management.
Version 0.1.3
- Feature:
namespace
macro now creates a local cache ofArc<IRI>
instances to reduce memory consumption.
Version 0.1.2
- Feature: added
rdf:li
.
Version 0.1.1
- Feature: made
nsname
macro public.
Version 0.1.0
- First release.
Dependencies
~2.3–3.5MB
~60K SLoC