From e66b6dfb354e3606444b319e03df67882efc4ac0 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Sun, 25 Feb 2024 17:38:10 +0100 Subject: [PATCH] Implement additional class restriction expression parsing --- src/from_pair.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/from_pair.rs b/src/from_pair.rs index 721be34..370e620 100644 --- a/src/from_pair.rs +++ b/src/from_pair.rs @@ -287,7 +287,10 @@ fn from_restriction_pair( Ok(ClassExpression::ObjectAllValuesFrom { ope, bce }) } Rule::ObjectHasValueRestriction => { - unimplemented!() + let mut pairs = inner.into_inner(); + let ope = FromPair::from_pair(pairs.next().unwrap(), ctx)?; + let i = FromPair::from_pair(pairs.next().unwrap(), ctx)?; + Ok(ClassExpression::ObjectHasValue { ope, i }) } Rule::ObjectHasSelfRestriction => { let mut pairs = inner.into_inner(); @@ -1132,7 +1135,21 @@ impl FromPair for DataPropertyFrame { } ) } - Rule::DataPropertyCharacteristicsClause => unimplemented!(), + Rule::DataPropertyCharacteristicsClause => { + annotated_axiom!( + pair, + inner, + ctx, + frame, + axiom = { + let dp = frame.entity.clone(); + match descend(pair).as_rule() { + Rule::FunctionalCharacteristic => FunctionalDataProperty(dp).into(), + rule => unexpected_rule!(ObjectPropertyFrame, rule), + } + } + ) + } Rule::DataPropertySubPropertyOfClause => { annotated_axiom!( pair,