Skip to content

Commit b24dd96

Browse files
committed
Ensure XML Schema types are bound to xsd prefix
References: * [AC-154] XML Schema datatype prefix needs to be explicit in all examples Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent c69d0fc commit b24dd96

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/src/compact.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def _accrue_local_context(doc_object):
6464
_logger.debug("total_context = %r." % total_context)
6565

6666
compacted = pyld.jsonld.compact(doc, total_context)
67+
68+
# Add xsd prefix back in to context dictionary. .compact() removes it, and this causes some xsd definitions like xsd:long to no longer resolve in SPARQL queries.
69+
compacted["@context"]["xsd"] = "http://www.w3.org/2001/XMLSchema#"
70+
6771
out_fh.write(json.dumps(compacted, indent=4))
6872

6973
if __name__ == "__main__":

0 commit comments

Comments
 (0)