code: def json_ld(self, output, **kwargs):
          
          raw_json_ld = output.serialize(format='json-ld',
                                         context=self.context).decode()
          # if there are fields that should be returned as arrays convert all
          # non-array fields to an array
          if not self.array_fields:
              return raw_json_ld
          json_data = json.loads(raw_json_ld)
          for i, item in enumerate(json_data['@graph']):
              if item.get("@type") in self.array_fields:
                  test_flds = self.array_fields[item['@type']]
                  for key, val in item.items():
                      if key in test_flds and not isinstance(val, list):
                          json_data['@graph'][i][key] = [val]
          # print(json.dumps(json_data, indent=4))
          return json.dumps(json_data, indent=4)
docs: Returns the json-ld formated result