|Did you know ...||Search Documentation:|
|Pack sparkle -- prolog/sparkle.pl|
Samer Abdallah, Dept. of Computer Science, UCL (2014) Based on Yves Raimond's swic package, but completely re-written.
This module provides a little language for expressing SPARQL queries and a database of known SPARQL endpoints. Queries can be executed across multiple endpoints in parallel. When using auto-paging, multiple queries are made automatically to fetch new bindings as they are needed. For example,
EP ?? rdf(A,B,C).
will retrieve all triples from all endpoints in parallel, fetching 100 bindings at a time from each endpoint (assuming the setting sparkle:limit takes it's default value of 100).
query_goal(EP,Goal,Opts)where Opts is the value of the setting sparkle:select_options. See query_goal/3 for details. IF EP is unbound on entry, it is bound to the endpoint from which the current bindings were obtained.
If EP is ground on entry, the query is run against the specified endpoint. If EP is unbound on entry, the query is run agains all endpoints in parallel, possibly returning multiple results from each.
(The following applies only to queries that return bindings, not to simple boolean questions, which return only true or false.) Options are as follows:
sparql_dcg.pl. The return type depends on the query:
select(V:list(var), sparql_goal, options) :: sparql_phrase(row(N)) :- length(V,N). describe(resource,sparql_goal) :: sparql_phrase(rdf). describe(resource) :: sparql_phrase(rdf). ask(sparql_goal) :: sparql_phrase(bool). rdf ---> rdf(resource,resource,object). bool ---> true; false.
row(N) is the type of terms of functor row/N.
The following predicates are exported, but not or incorrectly documented.