Availability:
:- use_module(library(semweb/sparql_client)).
rdf(S,P,O)
for CONSTRUCT
and DESCRIBE
queries, row(...)
for
SELECT
queries and true
or false
for ASK
queries.
Options are
- host(+Host)
- port(+Port)
- path(+Path)
- scheme(+Scheme)
- The above four options set the location of the server.
- search(+ListOfParams)
- Provide additional query parameters, such as the graph.
- variable_names(-ListOfNames)
- Unifies ListOfNames with a list of atoms that describe the
names of the variables in a
SELECT
query.
Remaining options are passed to http_open/3.
The defaults for Host, Port and Path can be set using sparql_set_server/1.
The initial default for port is 80 and path is /sparql/
.
For example, the ClioPatria server understands the parameter
entailment
. The code below queries for all triples using
_rdfs_entailment.
?- sparql_query('select * where { ?s ?p ?o }', Row, [ search([entailment=rdfs]) ]).