diff --git a/src/grammars/omn.pest b/src/grammars/omn.pest index 130eb29..0237103 100644 --- a/src/grammars/omn.pest +++ b/src/grammars/omn.pest @@ -293,7 +293,7 @@ ClassSubClassOfClause = { "SubClassOf:" ~ DescriptionAnnotatedList } ClassEquivalentToClause = { "EquivalentTo:" ~ DescriptionAnnotatedList } ClassDisjointWithClause = { "DisjointWith:" ~ DescriptionAnnotatedList } ClassDisjointUnionOfClause = { "DisjointUnionOf:" ~ Annotations? ~ Description2List } -ClassHasKeyClause = { "HasKey:" ~ Annotations? ~ PropertyExpression+ } +ClassHasKeyClause = { "HasKey:" ~ Annotations? ~ PropertyExpression ~ (COMMA ~ PropertyExpression)* } ClassClause = { ClassAnnotationsClause | ClassSubClassOfClause @@ -446,7 +446,7 @@ SWRLAtom = { | DataPropertyIRI ~ LBRACKET ~ SWRLIObject ~ COMMA ~ SWRLDObject ~ RBRACKET | "SameAs" ~ LBRACKET ~ SWRLIObject ~ COMMA ~ SWRLIObject ~ RBRACKET | "DifferentFrom" ~ LBRACKET ~ SWRLIObject ~ COMMA ~ SWRLIObject ~ RBRACKET - | "BuiltIn" ~ LBRACKET ~ SWRLBuiltinID ~ (COMMA ~ SWRLDObject)* ~ RBRACKET + | SWRLBuiltinID ~ LBRACKET ~ SWRLDObject ~ (COMMA ~ SWRLDObject)* ~ RBRACKET } SWRLBuiltinID = { IRI } diff --git a/src/io/omn/reader.rs b/src/io/omn/reader.rs index c5a8131..d453da7 100644 --- a/src/io/omn/reader.rs +++ b/src/io/omn/reader.rs @@ -39,4 +39,17 @@ pub mod test { Err(e) => panic!("parser failed: {}", e), } } + + #[test] + fn test_property_expression() { + OwlManchesterLexer::lex(Rule::PropertyExpression, "o:r").unwrap(); + } + + + #[test] + fn test_has_key() { + let _ = OwlManchesterLexer::lex(Rule::ClassHasKeyClause, "HasKey:\no:r\n").unwrap(); + let _ = OwlManchesterLexer::lex(Rule::ClassHasKeyClause, "HasKey:\no:r, o:s\n").unwrap(); + } + } diff --git a/src/ont/owl-manchester/multi-has-key.omn b/src/ont/owl-manchester/multi-has-key.omn index 29b061a..687a45b 100644 --- a/src/ont/owl-manchester/multi-has-key.omn +++ b/src/ont/owl-manchester/multi-has-key.omn @@ -25,7 +25,6 @@ DataProperty: o:A Class: o:C HasKey: - o:r, - o:s + o:r, o:s