Skip to content

Commit

Permalink
updated __repr__ of boolean and string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Nov 13, 2024
1 parent 04e6fbf commit 12d4a88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions owlapy/owl_literal.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def __hash__(self):
return hash((self._v, self._type))

def __repr__(self):
return f'OWLLiteral({self._v})'
return f'OWLLiteral({self._v, self._type})'

def is_boolean(self) -> bool:
return True
Expand Down Expand Up @@ -664,7 +664,7 @@ def __hash__(self):
return hash((self._v, self._type))

def __repr__(self):
return f'OWLLiteral({self._v})'
return f'OWLLiteral({self._v}, {self._type})'

def is_string(self) -> bool:
return True
Expand Down
2 changes: 1 addition & 1 deletion tests/test_owlapy_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_data_properties_boolean(self):
self.assertEqual(p, c)

p = self.parser.parse_expression('hasFifeExamplesOfAcenthrylenes some {true, false, "false"^^xsd:boolean}')
filler = OWLDataOneOf((OWLLiteral(True), OWLLiteral(False), OWLLiteral(False)))
filler = OWLDataOneOf((OWLLiteral(True, BooleanOWLDatatype), OWLLiteral(False, BooleanOWLDatatype), OWLLiteral(False, BooleanOWLDatatype)))
c = OWLDataSomeValuesFrom(self.has_fife_examples, filler)
self.assertEqual(p, c)

Expand Down

0 comments on commit 12d4a88

Please sign in to comment.