sem.curieShorten( iri as sem.iri, [mapping as Object] ) as String
This function shortens an IRI into a CURIE
(Compact URI) into a sem:iri
object. Returns the IRI string
unchanged if no mapping is available.
Parameters | |
---|---|
iri | An IRI. |
mapping | An optional set of prefix mappings. If not specified, a default set of prefixes is used. |
const sem = require("/MarkLogic/semantics.xqy"); sem.curieShorten(sem.iri("http://xmlns.com/foaf/0.1/person2")); // shortens and returns the CURIE (Compact URI) as a string => foaf:person2