Crates.io | rdf_vocabularies |
lib.rs | rdf_vocabularies |
version | 0.2.0 |
source | src |
created_at | 2022-01-26 10:58:59.14084 |
updated_at | 2023-07-05 14:59:26.940055 |
description | This crate is a distribution of few most commonly used RDF vocabularies. It also provides sophia terms for each vocabulary's terminology. |
homepage | |
repository | https://github.com/manomayam/rdf_vocabularies |
max_upload_size | |
id | 521519 |
size | 36,050,805 |
This crate is a distribution of few most commonly used RDF vocabularies. It also provides sophia terms for each vocabulary's terminology.
For each vocabulary with prefix vocab_prefix
, it provides a module rdf_vocabularies::ns::{vocab_prefix}
, that provides sophia terms for entities defined in that vocab's namespace. These modules are behind cargo features `ns-{vocab_prefix}respectively for each vocab. This way you can include only required vocabularies.
Please check documentation for included vocabularies, and their terms. These are generated from their ontologies, and also includes doc-comments for quick reference.
Include the crate in your project dependencies, with features corresponding to required ontologies
[dependencies]
# includes namespaces for vocabularies `rdf`, `foaf`, `solid`.
rdf_vocabularies = { version = "0.2.0", features=["ns-rdf", "ns-foaf", "ns-solid"] }
And then use them.
use rdf_vocabularies::{ns::{rdf, foaf, solid}};
use sophia_api::prelude::*;
assert!(Term::eq(&foaf::Agent, &Iri::new_unchecked("http://xmlns.com/foaf/0.1/Agent")));
assert!(Term::eq(&rdf::subject, &Iri::new_unchecked("http://www.w3.org/1999/02/22-rdf-syntax-ns#subject")));
License: MIT OR Apache-2.0