sem.graphInsert( graphname as sem.iri, triples as sem.triple[], [permissions as Sequence], [collections as String[]], [quality as xs.int?], [forest-ids as (Number|String)[]] ) as Sequence
This function inserts triples into a named graph, creating the graph if necessary. It also creates the graph metadata for the graph specified by the "graphname" option. This is an update function that returns document IDs.
graph-insert
in the context of SPARQL Update can result in undefined behavior.
declareUpdate(); var sem = require("/MarkLogic/semantics.xqy"); sem.graphInsert(sem.iri('bookgraph'), sem.triple(sem.iri('urn:isbn:9780080540160'), sem.iri('http://purl.org/dc/elements/1.1/title'), "Query XML,XQuery, XPath, and SQL/XML in context")); => /triplestore/2c78915c5854b0f8.xml
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.