sparql.pl
- sparql_query(+Query, -Reply, +Options)
- Where Query is either a SPARQL query text or a parsed
query. Reply depends on the type of query:
SELECT row(Col1, Col2, ....)
CONSTRUCT rdf(S,P,O)
DESCRIBE rdf(S,P,O)
ASK Reply == true or failure of pred Options are:
- entailment(Entailment)
- Specify the entailment module used. The default is
controlled by the setting
sparql:entailment
. - base_uri(Base)
- Specify the base IRI to use for parsing the query
- type(-Type)
- Returns one of
select(-VarNames)
, construct, describe or ask. - ordered(-Bool)
- True if query contains an ORDER BY clause
- distinct(-Bool)
- True if query contains a DISTINCT clause
- sparql_compile(+Query, -Compiled, +Options)
- Performs the compilation pass of solving a SPARQL query. Splitting serves two purposes. The result of the compilation can be cached if desired and through Options we can get information about the parsed query.
- optimise(+Parsed, -Optimised, +Options) is det[private]
- Perform sparql query optimization using rdf_optimise/2. Currently, UPDATE requests are not optimized.
- optimise_eval(+Goal0, -Goal) is det[private]
- Perform partial evaluation on sparql_true/1 and sparql_eval/2 goals.
- annotate_variables(+Goal, -Vars) is det[private]
- Annotate variables that appear in Goal. The annotation is a
variable attribute named
annotations
and the value of this attribute is a list of annotations. - optimise_eval(+GoalIn, -GoalOut)[private]
- sparql_run(+Compiled, -Reply) is nondet
- Runs a compiled SPARQL query, returning the result incrementally on backtracking. Provided there are no errors in the SPARQL implementation the only errors this can produce are resource-related errors.
- select_results(+Spec, -Reply, :Goal)
- Apply ordering and limits on result-set.
- select_result(+Bindings, -Row, -Names) is det[private]
- Transform the list Bindings of the form Name=Var into a Row term
of the form
row(Col1, Col2, ...)
and a termnames(Name1, ...)
. For example:?- select_result([x=1,y=2], Row, Names). Row = row(1,2), Names = names(x,y)
- sparql_describe(+IRI, -Triple)[private]
- Return -on backtracking- triples that describe IRI. The documentation does not specify which triples must be returned for a description. As a way to get started we simply return all direct properties.