diff --git a/tests/case_file/kb.json b/tests/case_file/kb.json index 1739ecc..454e492 100644 --- a/tests/case_file/kb.json +++ b/tests/case_file/kb.json @@ -4,7 +4,8 @@ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "uco-core": "https://unifiedcyberontology.org/ontology/uco/core#", "uco-observable": "https://unifiedcyberontology.org/ontology/uco/observable#", - "uco-types": "https://unifiedcyberontology.org/ontology/uco/types#" + "uco-types": "https://unifiedcyberontology.org/ontology/uco/types#", + "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@graph": [ { diff --git a/tests/src/compact.py b/tests/src/compact.py index 24b1509..16c25ce 100644 --- a/tests/src/compact.py +++ b/tests/src/compact.py @@ -64,6 +64,10 @@ def _accrue_local_context(doc_object): _logger.debug("total_context = %r." % total_context) compacted = pyld.jsonld.compact(doc, total_context) + + # 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. + compacted["@context"]["xsd"] = "http://www.w3.org/2001/XMLSchema#" + out_fh.write(json.dumps(compacted, indent=4)) if __name__ == "__main__":