op:prefixer( $baseUri as xs:string ) as sem:iri
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. |
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()