Skip to content

Commit a769ef8

Browse files
committed
Fix rdflib datatypes not converted to string
1 parent 1feeb9f commit a769ef8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/pyld/jsonld.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4004,7 +4004,7 @@ def _object_to_rdf(self, item, issuer, triples, options):
40044004
elif _is_integer(value):
40054005
return Literal(
40064006
str(value),
4007-
datatype=URIRef(datatype) if datatype else XSD.integer,
4007+
datatype=datatype if datatype else XSD.integer,
40084008
normalize=False,
40094009
)
40104010
elif rdf_direction == 'compound-literal' and '@direction' in item:
@@ -4122,7 +4122,7 @@ def _rdf_to_object(self, o: Identifier, use_native_types, rdf_direction) -> dict
41224122
converted = True
41234123
# do not add native type
41244124
if not converted and type_ != XSD.string:
4125-
rval['@type'] = type_
4125+
rval['@type'] = str(type_)
41264126
elif rdf_direction == 'i18n-datatype' and type_.startswith(
41274127
'https://www.w3.org/ns/i18n#'
41284128
):

0 commit comments

Comments
 (0)