# RDFtk: Names ![names](https://img.shields.io/badge/RDFtk-names-BD1B89?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAABGdBTUEAALGPC/xhBQAABBlpQ0NQa0NHQ29sb3JTcGFjZUdlbmVyaWNSR0IAADiNjVVdaBxVFD67c2cjJM5TbDSFdKg/DSUNk1Y0obS6f93dNm6WSTbaIuhk9u7OmMnOODO7/aFPRVB8MeqbFMS/t4AgKPUP2z60L5UKJdrUICg+tPiDUOiLpuuZOzOZabqx3mXufPOd75577rln7wXouapYlpEUARaari0XMuJzh4+IPSuQhIegFwahV1EdK12pTAI2Twt3tVvfQ8J7X9nV3f6frbdGHRUgcR9is+aoC4iPAfCnVct2AXr6kR8/6loe9mLotzFAxC96uOFj18NzPn6NaWbkLOLTiAVVU2qIlxCPzMX4Rgz7MbDWX6BNauuq6OWiYpt13aCxcO9h/p9twWiF823Dp8+Znz6E72Fc+ys1JefhUcRLqpKfRvwI4mttfbYc4NuWm5ERPwaQ3N6ar6YR70RcrNsHqr6fpK21iiF+54Q28yziLYjPN+fKU8HYq6qTxZzBdsS3NVry8jsEwIm6W5rxx3L7bVOe8ufl6jWay3t5RPz6vHlI9n1ynznt6Xzo84SWLQf8pZeUgxXEg4h/oUZB9ufi/rHcShADGWoa5Ul/LpKjDlsv411tpujPSwwXN9QfSxbr+oFSoP9Es4tygK9ZBqtRjI1P2i256uv5UcXOF3yffIU2q4F/vg2zCQUomDCHvQpNWAMRZChABt8W2Gipgw4GMhStFBmKX6FmFxvnwDzyOrSZzcG+wpT+yMhfg/m4zrQqZIc+ghayGvyOrBbTZfGrhVxjEz9+LDcCPyYZIBLZg89eMkn2kXEyASJ5ijxN9pMcshNk7/rYSmxFXjw31v28jDNSpptF3Tm0u6Bg/zMqTFxT16wsDraGI8sp+wVdvfzGX7Fc6Sw3UbbiGZ26V875X/nr/DL2K/xqpOB/5Ffxt3LHWsy7skzD7GxYc3dVGm0G4xbw0ZnFicUd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ZqAivgiGh+C22LRvIs0YrG00IctVhAbrKCiLaI1fhLUVmMajMY0uslms7PzeU/vpMbhzr1z7/mdc/5zzwF4+xABZqiRp6+AmDx7t6aBtXaDjPZEhN0vO8snbOkrayIYJzYTxhulnX9s2nni6hetz+1LcybPC4XHs3/4c8fpc/f3V72DI+P5B+01A2N/bXs93tvsif4K1LFiamGRobxOyhtiwtxs8vj5fWu61mEm02hk54imfHHwy7w7uBqsQbTHxwBUPNDCQIEtTBOAGzpycV5Qv/zQ/FVzd72YyHjswod3RPngB69evQDlQVGwci09kJEbA+kFVOQlVimfa9U2t64+k4nUsfHTLSva1navLDHW188yP+mpSC6xwHgtQxoNiLyAxd4YiZIkT4SVOyadbu86W4PZgykKZTJTXlnXhi1H+n568tW67PNbR3P4tNoLR4A5yXtU9XBLuhoe3m0/89Hwtb79wYDThP/uNtRU5qFtpSBMzP45WVV3ELe29/3S07Et5/bg9pofvx/e82jRvb6uDudxvkE888EBRTi0t4zAtX0iV5bF9P9bC8Gbmjo7o/9NM5zshssbjmfcv0ca8JEHBe0CiL4oNaVAfQGkLwJZnEZ9CsF+qip4bmN+8XDdOfgWFv9uN/yTzXnM5AyBcXJJ6oRRl7BQvxwgRCAlQFi+axNIG2wFAYwqG1ByBFezk1WXqJjJbA7k+4BcRQUHckDq2LoOqAcKPYNPUQUATFQaCCAbMubGUr3T4yVSqIImUCOmpt6CERx9MtSdDD5ziCUgJhJr33PYjGPfLcvNrG1TUxaNTIv5WoTDAzD+TwcGKt01pEI+hSzJl8Tzsn5muvZo0/sCcVVRx+wYu3n8VO5C5hCygd0GPbOcMfALMA7mEIKxIB7SvNITSzfXfpNq+XgIuvYCUjrN4GWa40nwI2Ujvx6pVL1PLiYqra+v/7YRRKH/8LTqBZ8vO/Bpb2TvhFZZ1viZ+g+UE055oMSTLwAAAABJRU5ErkJggg==) 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. [![crates.io](https://img.shields.io/crates/v/rdftk_names.svg)](https://crates.io/crates/rdftk_names) [![docs.rs](https://docs.rs/rdftk_names/badge.svg)](https://docs.rs/rdftk_names) ## 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](https://www.dublincore.org/specifications/dublin-core/abstract-model/) | `http://purl.org/dc/dcam/` | | `dt::dcmi_types` | [DCMI Type Vocabulary](https://www.dublincore.org/specifications/dublin-core/dcmi-type-vocabulary/) | `http://purl.org/dc/dcmitype/` | | `dt::elements`' | [DCMI Terms](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/) | `http://purl.org/dc/elements/1.1/` | | `dt::terms` | [DCMI Terms](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/) legacy elements | `http://purl.org/dc/terms/` | | `foaf` | [Friend of a Friend](http://xmlns.com/foaf/spec/) | `http://xmlns.com/foaf/0.1/` | | `geo` | [Basic Geo Vocabulary](https://www.w3.org/2003/01/geo/) | `http://www.w3.org/2003/01/geo/wgs84_pos#` | | `owl` | [![OWL](https://www.w3.org/Icons/SW/Buttons/sw-owl-blue.png)](http://www.w3.org/2001/sw/wiki/OWL) Web Ontology Language | `http://www.w3.org/2002/07/owl#` | | `rdf` | [![RDF](https://www.w3.org/Icons/SW/Buttons/sw-rdf-blue.png)](http://www.w3.org/2001/sw/wiki/RDF) RDF Syntax | `http://www.w3.org/1999/02/22-rdf-syntax-ns#` | | `rdfs` | [![RDF](https://www.w3.org/Icons/SW/Buttons/sw-rdf-blue.png)](http://www.w3.org/2001/sw/wiki/RDF) RDF Schema | `http://www.w3.org/2000/01/rdf-schema#` | | `xsd` | [XML Schema data types](https://www.w3.org/TR/xmlschema-2) | `http://www.w3.org/2001/XMLSchema#` | | TBD | [![SKOS](https://www.w3.org/Icons/SW/Buttons/sw-skos-blue.png)](http://www.w3.org/2001/sw/wiki/SKOS) Simple Knowledge Organization System (SKOS) | `http://www.w3.org/2004/02/skos/core#` | | TBD | [![PROV](https://www.w3.org/Icons/SW/Buttons/sw-prov-blue.png)](http://www.w3.org/2001/sw/wiki/PROV) PROV | `http://www.w3.org/ns/prov#` | | TBD | [![RDFa](https://www.w3.org/Icons/SW/Buttons/sw-rdfa-blue.png)](http://www.w3.org/2001/sw/wiki/RDFa) RDF in Attributes (RDFa) | `http://www.w3.org/ns/rdfa#` | | TBD | [RDF Calendar](https://www.w3.org/TR/rdfcal/) | `http://www.w3.org/2002/12/cal#` | | TBD | [vCard Ontology](https://www.w3.org/TR/vcard-rdf/) | `http://www.w3.org/2006/vcard/ns#` | | TBD | [The Organization Ontology](https://www.w3.org/TR/vocab-org/) | `http://www.w3.org/ns/org#` | | TBD | [Creative Commons Rights Expression Language](https://wiki.creativecommons.org/wiki/CC_REL) | `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](https://crates.io/crates/paste). ## Example The following example replicates the `geo` module using the `namespace!` macro. ```rust #[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` and `hex_binary` names in `xsd` namespace. ### Version 0.2.2 * Feature: rename `namespace_uri` to simply `namespace`. * 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 the `url::Url` and is more efficient. * Feature: performance improvements in the `namespace` and `nsname` 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. ### Version 0.1.7 * Feature: added missing names in `rdfs` vocabulary. ### Version 0.1.6 * Build: updated [paste](https://crates.io/crates/paste) package dependency. ### Version 0.1.5 * Build: explicit version management. ### Version 0.1.3 * Feature: `namespace` macro now creates a local cache of `Arc` 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.