use crate::{
Axiom, AxiomAnnotations, ClassExpression, Individual, ObjectPropertyExpression, OperandSet,
StructuralModelError,
};
use iri_rfc3987::Iri;
impl<L, B> Axiom<L, B> {
pub fn same_individual(individuals: Vec<Individual<B>>) -> Result<Self, StructuralModelError> {
Ok(Self::SameIndividual {
individuals: OperandSet::try_new(individuals)?,
annotations: AxiomAnnotations::empty(),
})
}
pub fn different_individuals(
individuals: Vec<Individual<B>>,
) -> Result<Self, StructuralModelError> {
Ok(Self::DifferentIndividuals {
individuals: OperandSet::try_new(individuals)?,
annotations: AxiomAnnotations::empty(),
})
}
#[must_use]
pub fn class_assertion(class: ClassExpression<L, B>, individual: Individual<B>) -> Self {
Self::ClassAssertion {
class,
individual,
annotations: AxiomAnnotations::empty(),
}
}
#[must_use]
pub fn object_property_assertion(
property: ObjectPropertyExpression,
source: Individual<B>,
target: Individual<B>,
) -> Self {
Self::ObjectPropertyAssertion {
property,
source,
target,
annotations: AxiomAnnotations::empty(),
}
}
#[must_use]
pub fn negative_object_property_assertion(
property: ObjectPropertyExpression,
source: Individual<B>,
target: Individual<B>,
) -> Self {
Self::NegativeObjectPropertyAssertion {
property,
source,
target,
annotations: AxiomAnnotations::empty(),
}
}
#[must_use]
pub fn data_property_assertion(property: Iri<String>, source: Individual<B>, value: L) -> Self {
Self::DataPropertyAssertion {
property,
source,
value,
annotations: AxiomAnnotations::empty(),
}
}
#[must_use]
pub fn negative_data_property_assertion(
property: Iri<String>,
source: Individual<B>,
value: L,
) -> Self {
Self::NegativeDataPropertyAssertion {
property,
source,
value,
annotations: AxiomAnnotations::empty(),
}
}
}