Skip to content

Commit

Permalink
Changed operator to logical AND for rendering and parsing facet restr…
Browse files Browse the repository at this point in the history
…ictions #91
  • Loading branch information
alkidbaci committed Oct 30, 2024
1 parent 68a520e commit b72d252
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions owlapy/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" / "<=" / ">=" / "<" / ">"
Expand Down Expand Up @@ -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" / "≥" / "≤" / "<" / ">"
Expand Down
4 changes: 2 additions & 2 deletions owlapy/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit b72d252

Please sign in to comment.