package rdf
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=fdca8ab06da34d9d76fe273f654ec6a1
sha512=fff3ad6cb5978e43ac3c509cc25a01d16be6e21b04df607e0595ec0e7226ba7b6e4e2ec86bbeae4aa3d6a181fa399c7c00a4b1c788ddc98486f5c8badf8867f7
doc/rdf/Rdf/Sparql/index.html
Module Rdf.SparqlSource
Sparql queries.
Error handling
type error = | Parse_error of Loc.loc * string| Value_error of Dt.error| Eval_error of Sparql_eval.error| Algebra_error of Sparql_algebra.error| Not_select| Not_ask| Not_construct| Not_describe| Not_get| Not_update| Not_implemented of string
Parsing and printing Sparql queries
Executing queries
Solutions
get_term solution varname returns the Term.term bound to varname in the solution.
is_bound solution varname returns whether the given variable name is bound in the solution.
solution_fold f sol acc is f var1 term1 (f var2 term2 (...) acc), folding over the bindings of the solution.
solution_iter f solution calls f on each pair (varname, term) of the solution.
Convenient functions to access solution bindings.
All these functions can raise Dt.Error exceptions in case the term bounded to the variable name is not compatible with the asked type.
The functions are just calls to Dt functions. For example, get_int retrieve the bounded term with get_term, then calls Dt.of_term to get a Dt.value, than calls Dt.int to retrieve an Int n value, then return n.
Same as get_string but the associated language tag is kep, if any.
Querying
execute ~base dataset q executes the sparql query q on dataset, using base as base iri. The form of the result depends on the kind of query:
- Select queries return a
Solution solutions - Ask queries return a
Bool bool - Construct queries return
Graph g. - Describe queries return a description graph.
For Construct and Describe queries, if a graph is provided, it is filled and the same graph is returned; else a new graph (in memory) is created, filled and returned. If the graph is created, it iri is the base iri provided.
Warning: Describe queries are not implemented yet.
Convenient functions for querying
Execute the given SELECT query.
Execute the given CONSTRUCT query.
Execute the given ASK query.
Execute the given DESCRIBE query.
Predefined functions
These are the functions named by an IRI, see details here.
A function takes a list of values and returns a value.