
op.graphCol( name as String ) as columnIdentifier
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. |
const op = require('/MarkLogic/optic');
// prefixer is a factory for sem:iri() constructors in a namespace
const resource = op.prefixer('http://dbpedia.org/resource/');
const foaf = op.prefixer('http://xmlns.com/foaf/0.1/');
const onto = op.prefixer('http://dbpedia.org/ontology/');
const person = op.col('person');
const Plan =
op.fromTriples([
op.pattern(person, onto('birthPlace'), resource('Brooklyn')),
op.pattern(person, foaf("name"), op.col("name"), op.graphCol('graph-id'))
])
.select();
Plan.result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.