Skip to content

Commit

Permalink
added "for all" test with nominals
Browse files Browse the repository at this point in the history
  • Loading branch information
LckyLke committed Oct 29, 2024
1 parent 8f78f1c commit 1e3786c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/test_owlapy_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from owlapy.owl_individual import OWLNamedIndividual
from owlapy.parser import DLSyntaxParser
from owlapy.render import DLSyntaxObjectRenderer
from owlapy.class_expression import OWLObjectHasValue, OWLObjectSomeValuesFrom, OWLObjectOneOf
from owlapy.class_expression import OWLObjectHasValue, OWLObjectSomeValuesFrom, OWLObjectOneOf, OWLObjectAllValuesFrom


class TestOWLObjectHasValueConversions(unittest.TestCase):
Expand All @@ -21,6 +21,7 @@ def test_render(self):

self.assertEqual(rendered_c, "∃ hasChild.{Demir}")


def test_render_multiple_entities(self):
renderer = DLSyntaxObjectRenderer()
NS = "http://example.com/father#"
Expand All @@ -36,6 +37,22 @@ def test_render_multiple_entities(self):
self.assertEqual(renderer_c, "∃ hasChild.{Demir , Luke}")
self.assertEqual(c, parser.parse_expression(renderer_c))


def test_render_for_all_multiplie_entities(self):
renderer = DLSyntaxObjectRenderer()
NS = "http://example.com/father#"
parser = DLSyntaxParser(NS)
has_child = OWLObjectProperty(IRI(NS, 'hasChild'))

c = OWLObjectAllValuesFrom(property=has_child, filler=OWLObjectOneOf([
OWLNamedIndividual(IRI.create(NS, 'Demir')),
OWLNamedIndividual(IRI.create(NS, 'Luke'))]
))
renderer_c = renderer.render(c)
self.assertEqual(renderer_c, "∀ hasChild.{Demir , Luke}")
self.assertEqual(c, parser.parse_expression(renderer_c))





Expand Down

0 comments on commit 1e3786c

Please sign in to comment.