<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.typedLiteral.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.typedLiteral</api:function-name><api:suggest>sem.typedliteral</api:suggest><api:suggest>sem</api:suggest><api:suggest>typedliteral</api:suggest><api:function-link mode="xquery" fullname="sem:typed-literal">/apidoc/8.0/sem:typed-literal.xml</api:function-link><api:function mode="javascript" name="typedLiteral" type="builtin" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.typedLiteral"><api:summary>
  Returns a value to represent the RDF typed literal with lexical value 
  <code xmlns="http://www.w3.org/1999/xhtml">$value</code> and datatype IRI <code xmlns="http://www.w3.org/1999/xhtml">$datatype</code>. Returns a value
  of type <code xmlns="http://www.w3.org/1999/xhtml">sem:unknown</code> for datatype IRIs for which there is no 
  schema, and a value of type <code xmlns="http://www.w3.org/1999/xhtml">sem:invalid</code> for lexical values 
  which are invalid according to the schema for the given datatype. This 
  XQuery function backs up the SPARQL STRDT() function.
  <p xmlns="http://www.w3.org/1999/xhtml">This function is a built-in.</p>
</api:summary><api:params><api:param name="value" type="xs:string"><api:param-description>
    The lexical value.
  </api:param-description><api:param-name>value</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="datatype" type="sem:iri"><api:param-description>
    The datatype IRI.
  </api:param-description><api:param-name>datatype</api:param-name><api:param-type>sem.iri</api:param-type></api:param></api:params><api:return>xs.anyAtomicType</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require("/MarkLogic/semantics.xqy");
xdmp.describe(sem.typedLiteral("object", sem.iri("http://www.w3.org/2001/XMLSchema#string"))); 
=&gt;
"object"
</pre></api:example></api:function></api:function-page>