NAME
rdf/sparql/client - SPARQL Protocol HTTP client.
SYNOPSIS
from rdf/sparql/client import SPARQLProtocolClient;
let client := new SPARQLProtocolClient(
endpoint: "https://example.com/sparql",
);
let result := client.query("ASK { ?s ?p ?o }");
DESCRIPTION
SPARQLProtocolClient sends SPARQL Query and Update requests to a remote HTTP(S) SPARQL Protocol endpoint. Query results are parsed into the same dictionary shapes returned by rdf/sparql sparql_query. Successful updates return the same summary shape as sparql_update, using local syntax parsing to report operation names and counts.
The client prefers SPARQL JSON results for SELECT and ASK, and N-Quads for graph results. It can also parse SPARQL XML, CSV, TSV, N-Triples, N-Quads, Turtle, and RDF/XML responses when returned by the server.
EXPORTS
Classes
SPARQLProtocolClientConstruct with
endpoint. Optional constructor keys areuser_agent,default_graph_uri,named_graph_uri, andheaders.query(String query, ... options)Sends a SPARQL Query request and returns a result dictionary. Options may include
default_graph_uri,named_graph_uri, andheaders.update(String update, ... options)Sends a SPARQL Update request and returns an update summary dictionary. Options may include
using_graph_uri,using_named_graph_uri, andheaders.
Functions
sparql_protocol_query(String endpoint, String query, ... options)Convenience function that constructs a client and calls
query.sparql_protocol_update(String endpoint, String update, ... options)Convenience function that constructs a client and calls
update.
COPYRIGHT AND LICENCE
rdf/sparql/client is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.