Loading TOC...

sem.curieShorten

sem.curieShorten(
   $iri as sem.iri,
   [$mapping as Object]
) as String

Summary

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
$iriAn IRI.
$mappingAn optional set of prefix mappings. If not specified, a default set of prefixes is used.

Example

var 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
    

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy