MarkLogic 12 Product Documentation
op:graph-col

op:graph-col(
   $name as string
) as map:map

Summary

Identifies the graph for a triple providing one or more columns for a row. You pass the graph column as a system column parameter to the op:pattern function.

Parameters
$name The name to use for the graph column.

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:graph-col('graph-id'))))
   => op:result()

  
Powered by MarkLogic Server | Terms of Use | Privacy Policy