Skip to content

Commit

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


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

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

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

c = OWLObjectSomeValuesFrom(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))






if __name__ == '__main__':
unittest.main()

0 comments on commit 8f78f1c

Please sign in to comment.