Commit 4010ebb5 authored by Wohlgemuth, Jason's avatar Wohlgemuth, Jason
Browse files

feat: Initial addition of raid metadata schema data modelling

parent a79199a3
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
#![deny(missing_docs)]
//! ## Research activity schema
//!
//! This module provides structs and functions for representing research activity data and performing schema validation.
@@ -30,6 +29,7 @@ use tracing::{debug, error, info, trace};
use validator::{Validate, ValidationErrorsKind};

pub mod graph;
pub mod raid;
pub mod validate;
use graph::*;
use validate::*;
@@ -101,7 +101,6 @@ pub enum MediaObject {
    /// Video format media
    Video(VideoObject),
}
// TODO: How are agency, center, office, and program different?
/// Organization sub type
#[derive(Clone, Debug, Serialize, Deserialize, Display, Hash, PartialEq, PartialOrd, JsonSchema)]
#[serde(rename_all = "lowercase")]
@@ -403,7 +402,7 @@ pub struct Metadata {
    /// - IBM
    /// <div class="warning"><a href="https://code.ornl.gov/research-enablement/acorn/-/blob/main/acorn-lib/assets/constants/partners.csv">Full list of partners</a></div>
    pub partners: Option<Vec<String>>,
    /// Related resarch activity data
    /// Related resarch activity data identifiers of related research activity data
    ///
    /// <div class="warning">WIP</div>
    pub related: Option<Vec<String>>,
+14 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ use nanoid::nanoid;
use owo_colors::{OwoColorize, Style, Styled};
use ring::digest::{Context, SHA256};
use rust_embed::Embed;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use similar::{
    ChangeTag::{self, Delete, Equal, Insert},
@@ -34,6 +35,18 @@ use which::which;
#[cfg(feature = "cli")]
pub mod cli;

/// SPDX compliant license identifier
///
/// See <https://spdx.org/licenses/>
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)]
pub enum License {
    /// MIT License
    Mit,
    /// Creative Commons
    CreativeCommons,
    /// Unknown license
    Unknown,
}
/// MIME types
///
/// Supports an incomplete list of common MIME types
@@ -117,7 +130,7 @@ pub struct Label {}
/// Semantic version
///
/// see <https://semver.org/>
#[derive(Builder, Clone, Copy, Debug, Deserialize, Display, Serialize)]
#[derive(Builder, Clone, Copy, Debug, Deserialize, Display, Serialize, JsonSchema)]
#[builder(start_fn = init)]
#[display("{}.{}.{}", major, minor, patch)]
pub struct SemanticVersion {