Loading TOC...

sem:typed-literal

sem:typed-literal(
   $value as xs:string,
   $datatype as sem:iri
) as xs:anyAtomicType

Summary

Returns a value to represent the RDF typed literal with lexical value $value and datatype IRI $datatype. Returns a value of type sem:unknown for datatype IRIs for which there is no schema, and a value of type sem:invalid for lexical values which are invalid according to the schema for the given datatype. This XQuery function backs up the SPARQL STRDT() function.

This function is a built-in.

Parameters
$value The lexical value.
$datatype The datatype IRI.

Example

xquery version "1.0-ml";
 
xdmp:describe(sem:typed-literal("object", sem:iri("http://www.w3.org/2001/XMLSchema#string")))
=>
"object"
<http://www.w3.org/2001/XMLSchema#string>

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.