Loading TOC...

MarkLogic 9 Product Documentation
op:prefixer

op:prefixer(
   $baseUri as xs:string
) as sem:iri

Summary

This function factory returns a new function that takes a name parameter and returns a sem:iri, prepending the specified base URI onto the name.

Parameters
$baseUri The base URI to be prepended to the name.

Example


xquery version "1.0-ml";

import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";

let $resource := op:prefixer("http://dbpedia.org/resource/")
let $foaf     := op:prefixer("http://xmlns.com/foaf/0.1/")
let $onto     := op:prefixer("http://dbpedia.org/ontology/")
let $person   := op:col("person")

return op:from-triples((
   op:pattern($person, $onto("birthPlace"), $resource("Brooklyn")), 
   op:pattern($person, $foaf("name"), op:col("name"))))
   => op:result() 
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.