#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum Cardinality {
ExactlyOne,
ZeroOrOne,
OneOrMore,
ZeroOrMore,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum ValueKind {
Uri,
Url,
String,
Integer,
Long,
Float,
DateTime,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum TargetClass {
Sbol(&'static str),
ProvActivity,
ProvAgent,
ProvAssociation,
ProvPlan,
ProvUsage,
OmMeasure,
OmUnit,
OmPrefix,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct ReferenceSpec {
pub target: TargetClass,
pub require_local: bool,
}
impl ReferenceSpec {
pub const fn new(target: TargetClass, require_local: bool) -> Self {
Self {
target,
require_local,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct FieldDescriptor {
pub predicate: &'static str,
pub rule: &'static str,
pub cardinality: Cardinality,
pub value_kind: ValueKind,
pub reference: Option<ReferenceSpec>,
}
impl FieldDescriptor {
pub const fn new(
predicate: &'static str,
rule: &'static str,
cardinality: Cardinality,
value_kind: ValueKind,
reference: Option<ReferenceSpec>,
) -> Self {
Self {
predicate,
rule,
cardinality,
value_kind,
reference,
}
}
}
#[derive(Clone, Copy, Debug)]
pub struct ClassDescriptor {
pub parents: &'static [&'static str],
pub fields: &'static [FieldDescriptor],
}