code: def transform_jsonld(self, obj):
          
          rec = copy.deepcopy(obj)
          rec.update(self.context)
          compacted = jsonld.compact(rec, self.context)
          if not self.expanded:
              return compacted
          else:
              return jsonld.expand(compacted)[0]
docs: Compact JSON according to context.