Emits the form "text"^^<datatype>, escaping text according to the STRING_LITERAL2 production and the datatype
IRI according to the IRIREF production. Since RDF 1.1 reads an unannotated literal as an xsd:string, a literal
with no datatype, or with the redundant xsd:string datatype, collapses to the bare quoted form emitted by
string.
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 IRI according to the IRIREF production. Since RDF 1.1 reads an unannotated literal as anxsd:string, a literal with no datatype, or with the redundantxsd:stringdatatype, collapses to the bare quoted form emitted by string.