anchor.diff:              sparql_result:result_to_rdf(ResolvedBindings, Uri)
       end.
   
  +%% @doc Try to decode the response from the SPARQL endpoint.
  +-spec decode(map()) -> m_rdf:rdf_resource() | map().
   decode(#{<<"@graph">> := _} = Data) ->
  +    %% Only DESCRIBE queries return JSON-LD.
       ginger_json_ld:deserialize(Data);
   decode(Data) ->
  +    %% Other SPARQL queries return JSON.
       Data.
   
   headers() ->
  
positive.code: -include_lib("zotonic.hrl").
  -include_lib("../include/rdf.hrl").
  
  describe(Endpoint, <<"https://", _/binary>> = Uri) ->
      describe(Endpoint, <<"<", Uri/binary, ">">>);
  describe(Endpoint, <<"http://", _/binary>> = Uri) ->
      describe(Endpoint, <<"<", Uri/binary, ">">>);
  describe(Endpoint, Clause) ->
      query(Endpoint, (<<"DESCRIBE ", Clause/binary>>)).
      
  query(Endpoint, Query) ->
      query(Endpoint, Query, headers()).
  
  -spec query(binary(), binary(), map()) -> list().
  query(Endpoint, Query, Headers) ->
      Qs = z_convert:to_binary(z_url:url_encode(Query)),
      Url = <<Endpoint/binary, "?query=", Qs/binary>>,
  
negative.code:             decode(Map)
      end.
  
  %% @doc Get specified properties from a single resource.
  -spec get_resource(url(), url(), [binary()]) -> m_rdf:rdf_resource() | undefined.
  get_resource(Endpoint, Uri, Properties) ->
      {Query, Arguments} = sparql_query:select_properties(Uri, Properties),
      case query(Endpoint, Query, #{<<"Accept">> => <<"application/json">>}) of
  