code: def _jsonld(graph, format, *args, **kwargs):
      
      import json
  
      from pyld import jsonld
      from renku.models._jsonld import asjsonld
  
      output = getattr(jsonld, format)([
          asjsonld(action) for action in graph.activities.values()
      ])
      return json.dumps(output, indent=2)
docs: Return formatted graph in JSON-LD ``format`` function.