1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use crate::BlankId;
use iref::Iri;
mod index;
mod none;
pub use index::*;
pub use none::*;
pub trait Vocabulary: IriVocabulary + BlankIdVocabulary {}
pub trait VocabularyMut: Vocabulary + IriVocabularyMut + BlankIdVocabularyMut {}
impl<V: IriVocabulary + BlankIdVocabulary> Vocabulary for V {}
impl<V: IriVocabularyMut + BlankIdVocabularyMut> VocabularyMut for V {}
pub trait IriVocabulary {
type Iri;
fn iri<'i>(&'i self, id: &'i Self::Iri) -> Option<Iri<'i>>;
fn get(&self, iri: Iri) -> Option<Self::Iri>;
}
pub trait IriVocabularyMut: IriVocabulary {
fn insert(&mut self, iri: Iri) -> Self::Iri;
}
pub trait BlankIdVocabulary {
type BlankId;
fn blank_id<'b>(&'b self, id: &'b Self::BlankId) -> Option<&'b BlankId>;
fn get_blank_id(&self, id: &BlankId) -> Option<Self::BlankId>;
}
pub trait BlankIdVocabularyMut: BlankIdVocabulary {
fn insert_blank_id(&mut self, id: &BlankId) -> Self::BlankId;
}