Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IKCAP committed Jul 5, 2024
1 parent 2e7286a commit d8c1f24
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions pylipd/utils/create_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ def get_todata_item(type, range):
"@type": "uri"
}}"""
elif type == "object":
todataitem += f"""
obj = {{
"@id": value_obj.id,
"@type": "uri"
}}
data = value_obj.to_data(data)"""
todataitem += f"""
if type(value_obj) is str:
obj = {{
"@value": value_obj,
"@type": "literal",
"@datatype": "http://www.w3.org/2001/XMLSchema#string"
}}
else:
obj = {{
"@id": value_obj.id,
"@type": "uri"
}}
data = value_obj.to_data(data)"""
return todataitem

def get_tojson_item(type):
Expand Down

0 comments on commit d8c1f24

Please sign in to comment.