Skip to content

Commit

Permalink
Fix parsing of Misc clause and implement xsd datatypes in `Dataty…
Browse files Browse the repository at this point in the history
…pe::from_pair`
  • Loading branch information
althonos committed Feb 25, 2024
1 parent eff4e77 commit 8aece65
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 112 deletions.
25 changes: 16 additions & 9 deletions src/frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,23 @@ impl<A: ForIRI> From<Individual<A>> for IndividualFrame<A> {

// ---------------------------------------------------------------------------

#[derive(Debug, Default)]
pub struct Misc;
#[derive(Debug, Clone)]
pub struct MiscClause<A: ForIRI>(pub AnnotatedAxiom<A>);

pub type MiscFrame<A> = Frame<A, Misc>;
impl<A: ForIRI> MiscClause<A> {
pub fn new(axiom: AnnotatedAxiom<A>) -> Self {
MiscClause(axiom)
}
}

impl<A: ForIRI> MiscFrame<A> {
pub fn new() -> Self {
Self {
entity: Misc,
axioms: Vec::new(),
}
impl<A: ForIRI> From<AnnotatedAxiom<A>> for MiscClause<A> {
fn from(axiom: AnnotatedAxiom<A>) -> Self {
MiscClause(axiom)
}
}

impl<A: ForIRI> From<MiscClause<A>> for AnnotatedAxiom<A> {
fn from(clause: MiscClause<A>) -> Self {
clause.0
}
}
Loading

0 comments on commit 8aece65

Please sign in to comment.