MarkLogic Server 11.0 Product Documentation
sem:curie-shorten

sem:curie-shorten(
   $iri as sem:iri,
   [$mapping as map:map]
) as xs: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
iri An IRI.
mapping An optional set of prefix mappings. If not specified, a default set of prefixes is used.

Example

xquery version "1.0-ml"; 
 
import module namespace sem = "http://marklogic.com/semantics" 
      at "/MarkLogic/semantics.xqy";
      
sem:curie-shorten(sem:iri("http://xmlns.com/foaf/0.1/person2"))

  (: shortens and returns the CURIE (Compact URI) as a string :)
  =>
foaf:person2
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy