PublicShow -- SPARQL runtime support

See also
- merges this module with generic predicates as well as runtime libraries for other query languages.
- These routines are part of the entailment modules. See ../entailment/README.txt
Source sparql_true(+Term)
Generated from FILTER Term, where Term must be converted to a boolean as 'Effective Boolean Value'.
Source sparql_eval(+Expr, -Results)
Evaluate a SPARQL expression.
Source sparql_eval_raw(+Expr, -Result)
Same as sparql_eval/2, but return the raw result.
Source sparql_find(?From, ?To, ?F, ?T, :Q) is nondet
Implement *(PropertyPath). We should probably collect translated queries in a dynamic predicate to avoid the copy_term. Also, Q will quite often be simple. In that case we can map to rdf_reachable/3, although one of the problems is that rdf_reachable/3 uses rdf_has/3, and does not deal with graphs.

We should be a bit smarter here and choose between forward, backward, two-sided breath-first, etc. based on which start point is given.

To be done
- Maybe a thing for using tor? Planning most likely more important than the iteration speed.
Source sparql_minus(:QLeft, :QRight)
Realise SPARQL MINUS. This is defined to
  • Take the variables of QLeft
  • Determine the result-set for these variables for both QLeft and QRight
  • Substract those from QLeft that are in QRight
To be done
- : Both the result set and the minus set are in standard order of terms, so we can do ordered subtraction.
Source sparql_group(:Goal)
Same as call. Intended to keep groups together to avoid invalid optimizations.
Source sparql_group(:Goal, +OuterVars, +InnerVars)
Execute a group that contains non-steadfast variables, which asks for delayed unification of the output arguments.
Source sparql_service(+Silent, +URL, +Prefixes, +Bindings, +QText)
Execute a remote SPARQL SERVICE request
Silent- is one of silent or error
URL- is the address of the SPARQL server
Prefixes- is a list Prefix-URL
Bindings- is a list VarName=Var
QText- is a string holding the remote query
Source sparql_reset_bnodes
Reset the database for the BNODE(str) function
Source sparql_simplify(:Goal, -Simple) is det
Simplify goals to the SPARQL runtime functions before they are handed to the general optimizer and runtime evaluation.
Source sparql_subquery(+Proj, :Query, +Solutions) is nondet
Execute a SPARQL subquery.
Proj- is a list of variables that are shared with the outer query.
To be done
- Call the optimizer.
- Sub queries must be evaluated before the outer query, so we must move them to the head of the query evaluation. Not doing so causes no harm, but leads to repetitive execution of the subquery.
Source sparql_update(:Updates) is det
Handle SPARQL update requests.
To be done
- Realise authorization rules