standardlib/dto/
json_format.rs

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
use serde::{Deserialize, Serialize};
use serde_json;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Literal {
    pub literal: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct LiteralLanguage {
    pub literal: String,
    pub language: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Uri {
    pub uri: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct UriPrefLabel {
    pub uri: String,
    #[serde(rename = "prefLabel")]
    pub pref_label: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct JsonFormat {
    #[serde(rename = "Id")]
    pub id: String,
    pub dcterms_modified: Literal,
    pub dcterms_subject: UriPrefLabel,
    #[serde(rename = "dcterms_educationLevel")]
    pub dcterms_education_level: serde_json::Value,
    //may be UriPrefLabel or Vec<UriPrefLabel>
    pub dcterms_description: Option<LiteralLanguage>,
    pub dcterms_title: Option<LiteralLanguage>,
    #[serde(rename = "asn_authorityStatus")]
    pub asn_authority_status: Uri,
    #[serde(rename = "asn_indexingStatus")]
    pub asn_indexing_status: Uri,
    #[serde(rename = "asn_statementLabel")]
    pub asn_statement_label: LiteralLanguage,
    #[serde(rename = "asn_statementNotation")]
    pub asn_statement_notation: Option<LiteralLanguage>,
    #[serde(rename = "asn_skillEmbodied")]
    pub asn_skill_embodied: Option<serde_json::Value>,
    #[serde(rename = "asn_conceptTerm")]
    pub asn_concept_term: Option<serde_json::Value>,
    //may be UriPrefLabel or Vec<UriPrefLabel>
    pub cls: Option<String>,
    pub text: Option<String>,
    pub leaf: Option<String>,
    pub children: Option<Vec<JsonFormat>>,
}