Rdf.DtSourceComputing values in Sparql, mapping to/from RDF terms.
A value can be an error, and propagated in computations.
type error = | Type_error of value * stringThe value has not the given expected "type"
*)| Invalid_literal of Term.literalInvalid literal: bad integer string for an integer, ...
*)| Exception of exnTo keep the original exception which resulted in an error.
*)and value = | Err of errorValue is an error
*)| Blank of stringA blank node with its label
*)| Iri of Iri.tAn IRI.
*)| String of stringA string literal.
*)| Int of int * Iri.tAn integer and the original datatype IRI
*)| Float of floatA decimal, float or double.
*)| Bool of boolA Boolean.
*)| HexBinary of stringBinary data in hexadecimal, in lowercase
*)| Datetime of Term.datetimeA datetime.
*)| Ltrl of string * string optionA literal string with an optional language tag.
*)| Ltrdt of string * Iri.tA literal value with a specified datatype.
*)iri base v returns a Iri value, ensure the given value is an IRI. If it is a literal string, convert it to an IRI, eventually appending to the base IRI if the string expresses a relative IRI.
datatype v returns the IRI of the datatype of the value. If v is Err, Blank or Iri, return Err.
string_literal v returns a pair (string, optional language tag) if v is String of Ltrl. Else return Err.
string v returns a String value, converting any value to a string, except Err and Blank for which Err is returned.
int v returns a Int value, trying to convert literal values to an integer. Return Err if v is Err, Blank or Iri, or if the literal value could not be converted to an integer. Floats are truncated.
Same as int but for booleans. Bool true, String "true", String "1", Int n with n<>0 and Float f when f is not nan nor zero evaluate to Bool true. Bool false, String "false", String "0", Int 0 and Float f when f is nan or zero evaluate to Bool false. Any other value evaluates to Err.
datetime v returns a Datetime, if possible. String literals are converted if possible; else Err is returned.
Same as string, but languge tag is kept is present (i.e. if the value is a Ltrl).
Try to convert the given value to an Int or else to a Float, if the value is not already Int or Float.
of_literal lit returns a value from a literal term.