Emits the form "text"^^<datatype>, escaping text according to the STRING_LITERAL2 production and the datatype
according to the IRIREF production; a missing or xsd:string datatype collapses to the string form.
Parameters
text: string
The lexical value of the literal
Optionaldatatype: string
The IRI identifying the literal's datatype, or omitted for a plain xsd:string literal
Returns string
The generated literal, datatype-annotated unless the datatype is omitted or xsd:string
Throws
RangeError if text is not a well-formed Unicode string, or if datatype is not a well-formed RFC 3987
reference, an isolated UTF-16 surrogate code point included
Generates a datatype-annotated RDF literal.
Emits the form
"text"^^<datatype>, escapingtextaccording to the STRING_LITERAL2 production and the datatype according to the IRIREF production; a missing orxsd:stringdatatype collapses to the string form.