Skip to content

Commit

Permalink
FIX: xml2ravens bools
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudocubic committed Feb 21, 2025
1 parent efdc979 commit b5b3df3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ravens/xml/xml2ravens.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,13 @@ def build_data(self, subject):

if p != self.rdf_type:
if isinstance(o, Literal):
try:
value = literal_eval(o.value)
except:
value = o.value
if o.value.lower() in ["true", "false"]:
value = bool(o.value)
else:
try:
value = literal_eval(o.value)
except:
value = o.value
elif pn in self.reference_paths:
if o in self.object_ids:
value = f"{self.rdf.value(subject=o, predicate=self.rdf_type).split("#")[-1]}::'{self.object_ids[o]}'"
Expand Down

0 comments on commit b5b3df3

Please sign in to comment.