Skip to content

Commit

Permalink
feat: add skos namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstonskj committed Oct 16, 2024
1 parent 52f6b69 commit 541f945
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rdftk_names/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rdftk_names"
version = "0.2.3"
version = "0.2.4"
authors = ["Simon Johnston <[email protected]>"]
edition = "2021"
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."
Expand Down
4 changes: 4 additions & 0 deletions rdftk_names/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ namespace! {

## Changes

### Version 0.2.4

* Feature: add `skos` namespaces.

### Version 0.2.3

* Feature: added missing `date` and `hex_binary` names in `xsd` namespace.
Expand Down
2 changes: 2 additions & 0 deletions rdftk_names/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ pub mod rdf;

pub mod rdfs;

pub mod skos;

pub mod xsd;

// ------------------------------------------------------------------------------------------------
Expand Down
104 changes: 104 additions & 0 deletions rdftk_names/src/skos.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*!
Namespaces for SKOS, SKOS eXtension for Labels (SKOS-XL), and the ISO-25964 thesaurus vocabulary.
*/

namespace! {
"skos",
"http://www.w3.org/2004/02/skos/core#",
{
collection, "Collection",
concept, "Concept",
concept_scheme, "ConceptScheme",
ordered_collection, "OrderedCollection",

alt_label, "altLabel",
broad_match, "broadMatch",
broader, "broader",
broader_transitive, "broaderTransitive",
change_note, "changeNote",
close_match, "closeMatch",
definition, "definition",
editorial_note, "editorialNote",
exact_match, "exactMatch",
example, "example",
has_top_concept, "hasTopConcept",
hidden_label, "hiddenLabel",
history_note, "historyNote",
in_scheme, "inScheme",
mapping_relation, "mappingRelation",
member, "member",
member_list, "memberList",
narrow_match, "narrowMatch",
narrower, "narrower",
narrower_transitive, "narrowerTransitive",
notation, "notation",
note, "note",
pref_label, "prefLabel",
related, "related",
related_match, "relatedMatch",
scope_note, "scopeNote",
semantic_relation, "semanticRelation",
top_concept_of, "topConceptOf"
}
}

/// SKOS eXtension for Labels (SKOS-XL)
pub mod xl {
namespace! {
"skosxl",
"http://www.w3.org/2008/05/skos-xl#",
{
label, "Label",
literal_form, "literalForm",
pref_label, "prefLabel",
alt_label, "altLabel",
label_relation, "labelRelation"
}
}
}

/// ISO-25964 thesaurus vocabulary
pub mod iso {
namespace! {
"isothes",
"http://purl.org/iso25964/skos-thes#",
{
compound_equivalence, "CompoundEquivalence",
concept_group, "ConceptGroup",
preferred_term, "PreferredTerm",
thesaurus_array, "ThesaurusArray",

micro_thesaurus_of, "microThesaurusOf",
plus_uf_term, "plusUFTerm",
plus_use_term, "plusUseTerm",
sub_group, "subGroup",
subordinate_array, "subordinateArray",
super_group, "superGroup",
super_ordinate, "superOrdinate",

broader_generic, "broaderGeneric",
broader_instantial, "broaderInstantial",
broader_partitive, "broaderPartitive",
narrower_generic, "narrowerGeneric",
narrower_instantial, "narrowerInstantial",
narrower_partitive, "narrowerPartitive"
}
}
}

/// See https://www.w3.org/2003/06/sw-vocab-status/note.html
pub mod term_status {
namespace! {
"status",
"http://www.w3.org/2003/06/sw-vocab-status/ns#",
{
term_status, "term_status"
}
}
pub const STATUS_ARCHAIC: &str = "archaic";

Check failure on line 98 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:98:5 | 98 | pub const STATUS_ARCHAIC: &str = "archaic"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D missing-docs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(missing_docs)]`
pub const STATUS_DEPRECATED: &str = "deprecated";

Check failure on line 99 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:99:5 | 99 | pub const STATUS_DEPRECATED: &str = "deprecated"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub const STATUS_PROPOSED: &str = "proposed";

Check failure on line 100 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:100:5 | 100 | pub const STATUS_PROPOSED: &str = "proposed"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub const STATUS_STABLE: &str = "stable";

Check failure on line 101 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:101:5 | 101 | pub const STATUS_STABLE: &str = "stable"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub const STATUS_TESTING: &str = "testing";

Check failure on line 102 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:102:5 | 102 | pub const STATUS_TESTING: &str = "testing"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pub const STATUS_UNSTABLE: &str = "unstable";

Check failure on line 103 in rdftk_names/src/skos.rs

View workflow job for this annotation

GitHub Actions / clippy

missing documentation for a constant

error: missing documentation for a constant --> rdftk_names/src/skos.rs:103:5 | 103 | pub const STATUS_UNSTABLE: &str = "unstable"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

0 comments on commit 541f945

Please sign in to comment.