From b72d2522b1af04551e1b3d0dbf06b2371cb51433 Mon Sep 17 00:00:00 2001 From: Alkid Date: Wed, 30 Oct 2024 15:38:08 +0100 Subject: [PATCH] Changed operator to logical AND for rendering and parsing facet restrictions #91 --- owlapy/parser.py | 4 ++-- owlapy/render.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/owlapy/parser.py b/owlapy/parser.py index 06bbcc9c..58a5b5e1 100644 --- a/owlapy/parser.py +++ b/owlapy/parser.py @@ -55,7 +55,7 @@ data_union = data_intersection (must_ws "or" must_ws data_intersection)* data_intersection = data_primary (must_ws "and" must_ws data_primary)* datatype_restriction = datatype_iri "[" maybe_ws facet_restrictions maybe_ws "]" - facet_restrictions = facet_restriction (maybe_ws "," maybe_ws facet_restriction)* + facet_restrictions = facet_restriction (maybe_ws "⊓" maybe_ws facet_restriction)* facet_restriction = facet must_ws literal facet = "length" / "minLength" / "maxLength" / "pattern" / "langRange" / "totalDigits" / "fractionDigits" / "<=" / ">=" / "<" / ">" @@ -454,7 +454,7 @@ def generic_visit(self, node, children): data_union = data_intersection (must_ws "⊔" must_ws data_intersection)* data_intersection = data_primary (must_ws "⊓" must_ws data_primary)* datatype_restriction = datatype_iri "[" maybe_ws facet_restrictions maybe_ws "]" - facet_restrictions = facet_restriction (maybe_ws "," maybe_ws facet_restriction)* + facet_restrictions = facet_restriction (maybe_ws "⊓" maybe_ws facet_restriction)* facet_restriction = facet must_ws literal facet = "length" / "minLength" / "maxLength" / "pattern" / "langRange" / "totalDigits" / "fractionDigits" / "≥" / "≤" / "<" / ">" diff --git a/owlapy/render.py b/owlapy/render.py index dd71dc03..69a88565 100644 --- a/owlapy/render.py +++ b/owlapy/render.py @@ -269,7 +269,7 @@ def _(self, r: OWLFacetRestriction) -> str: @render.register def _(self, r: OWLDatatypeRestriction) -> str: s = [self.render(_) for _ in r.get_facet_restrictions()] - return "%s[%s]" % (self.render(r.get_datatype()), (" %s " % _DL_SYNTAX.COMMA).join(s)) + return "%s[%s]" % (self.render(r.get_datatype()), (" %s " % _DL_SYNTAX.AND).join(s)) @render.register def _(self, r: OWLDataHasValue): @@ -463,7 +463,7 @@ def _(self, r: OWLFacetRestriction): @render.register def _(self, r: OWLDatatypeRestriction): s = [self.render(_) for _ in r.get_facet_restrictions()] - return "%s[%s]" % (self.render(r.get_datatype()), (" %s " % _MAN_SYNTAX.COMMA).join(s)) + return "%s[%s]" % (self.render(r.get_datatype()), (" %s " % _MAN_SYNTAX.AND).join(s)) @render.register def _(self, r: OWLDataHasValue):