Skip to content

Commit

Permalink
updated conversions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Oct 31, 2024
1 parent 4cd3ca1 commit 946837d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_owlapy_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from owlapy.providers import owl_datatype_max_exclusive_restriction, owl_datatype_min_exclusive_restriction, owl_datatype_min_max_exclusive_restriction, owl_datatype_min_max_inclusive_restriction

from owlapy.vocab import OWLFacet


class TestOWLConversions(unittest.TestCase):
def test_owlapy_to_dl_str_and_back(self):
NS = "http://example.com/father#"
Expand Down Expand Up @@ -75,7 +77,7 @@ def test_owlapy_to_dl_str_and_back(self):
c = OWLDataAllValuesFrom(property=has_age, filler=OWLDataUnionOf([owl_datatype_min_max_inclusive_restriction(40, 80), IntegerOWLDatatype]))
rendered_c = renderer.render(c)
self.assertEqual(c, parser.parse_expression(rendered_c))
self.assertEqual(rendered_c, "∀ hasAge.(xsd:integer[≥ 40 , ≤ 80] ⊔ xsd:integer)")
self.assertEqual(rendered_c, "∀ hasAge.(xsd:integer[≥ 40 ≤ 80] ⊔ xsd:integer)")
# (9)
c = OWLDataSomeValuesFrom(property=has_age,
filler=OWLDataIntersectionOf([OWLDataOneOf([OWLLiteral(32.5), OWLLiteral(4.5)]),
Expand Down Expand Up @@ -703,7 +705,7 @@ def test_ce_render(self):

dr = OWLDataAllValuesFrom(property=has_age, filler=OWLDataUnionOf([datatype_restriction, IntegerOWLDatatype]))
r = renderer.render(dr)
self.assertEqual(r, "∀ hasAge.(xsd:integer[≥ 40 , ≤ 80] ⊔ xsd:integer)")
self.assertEqual(r, "∀ hasAge.(xsd:integer[≥ 40 ≤ 80] ⊔ xsd:integer)")

dr = OWLDataSomeValuesFrom(property=has_age,
filler=OWLDataIntersectionOf([OWLDataOneOf([OWLLiteral(32.5), OWLLiteral(4.5)]),
Expand Down Expand Up @@ -776,7 +778,7 @@ def test_ce_render(self):

dr = OWLDataAllValuesFrom(property=has_age, filler=OWLDataUnionOf([datatype_restriction, IntegerOWLDatatype]))
r = renderer.render(dr)
self.assertEqual(r, "hasAge only (xsd:integer[>= 40 , <= 80] or xsd:integer)")
self.assertEqual(r, "hasAge only (xsd:integer[>= 40 and <= 80] or xsd:integer)")

dr = OWLDataSomeValuesFrom(property=has_age,
filler=OWLDataIntersectionOf([OWLDataOneOf([OWLLiteral(32.5), OWLLiteral(4.5)]),
Expand Down
Empty file removed tests/test_owlapy_render.py
Empty file.

0 comments on commit 946837d

Please sign in to comment.