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
/*!
Functions that create IRIs for the [RDF](https://www.w3.org/TR/rdf11-concepts/) namespace.
*/

namespace! {
    "rdf",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    {
        html, "HTML",
        lang_string, "langString",
        plain_literal, "PlainLiteral",
        a_type, "type",
        property, "Property",
        statement, "Statement",
        subject, "subject",
        predicate, "predicate",
        object, "object",
        bag, "Bag",
        seq, "Seq",
        alt, "Alt",
        value, "value",
        list, "List",
        nil, "nil",
        first, "first",
        rest, "rest",
        li, "li",
        xml_literal, "XMLLiteral",
        json, "JSON",
        compound_literal, "CompoundLiteral",
        language, "language",
        direction, "direction"
    }
}

/// Create a numbered member in a container
#[inline]
pub fn member(index: usize) -> IRIRef {
    IRI::from_str(&format!("{}_{}", NAMESPACE, index))
        .unwrap()
        .into()
}

/// Create a numbered member in a container
#[inline]
pub fn member_qname(index: usize) -> String {
    format!("{}:_{}", PREFIX, index)
}