<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.rdfInsert.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.rdfInsert</api:function-name><api:suggest>sem.rdfinsert</api:suggest><api:suggest>sem</api:suggest><api:suggest>rdfinsert</api:suggest><api:function-link mode="xquery" fullname="sem:rdf-insert">/apidoc/8.0/sem:rdf-insert.xml</api:function-link><api:function mode="javascript" name="rdfInsert" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.rdfInsert"><api:summary>
		 This function inserts triples into a specified database as 
		 one or more <code xmlns="http://www.w3.org/1999/xhtml">sem:triples</code> documents. It also 
		 creates graph metadata for the graph specified by the 
		 "graph" or "override-graph=URI" option. 
		 This is an update function that returns the document URIs of 
		 inserted documents.
	 </api:summary><api:params><api:param name="triples" type="sem.triple | ValueIterator | Array" class="javascript"><api:param-description>
		  The triples to insert.  
	  </api:param-description><api:param-name>triples</api:param-name><api:param-type>sem.triple | ValueIterator | Array</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
		  Insertion options. Valid options values include:
	<blockquote xmlns="http://www.w3.org/1999/xhtml">
        <dl>
          <dt>
             <pre>override-graph=URI</pre>
          </dt>
        <dd>
		The graph/context value to give to every quad, whether 
		specified in the data or not.
		</dd>
		  <dt>
             <pre>directory=URI</pre>
          </dt>
        <dd>
        The database directory path.
		</dd>
		</dl>
	</blockquote>	
	</api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param class="javascript" name="permissions" type="Object[]" optional="true"><api:param-description>
		Security permission objects corresponding to the permissions 
		for the document.    
	</api:param-description><api:param-name>permissions</api:param-name><api:param-type>Object[]</api:param-type></api:param><api:param name="collections" type="xs:string*" optional="true"><api:param-description>
		Additional collections to set on inserted documents. If you use 
		the collections argument when inserting triples, no graph 
		document will be created for these collections.
	</api:param-description><api:param-name>collections</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="quality" type="xs:int?" optional="true"><api:param-description>
		The quality setting for inserted documents.
	</api:param-description><api:param-name>quality</api:param-name><api:param-type>xs.int?</api:param-type></api:param><api:param name="forest-ids" type="xs:unsignedLong*" optional="true"><api:param-description>
		The forest IDs to use for inserted documents.
	</api:param-description><api:param-name>forest-ids</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
	  Using additional collections with <code xmlns="http://www.w3.org/1999/xhtml">sem:rdf-insert</code> in the 
	  context of SPARQL Update can result in undefined behavior.
  </api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
var sem = require("/MarkLogic/semantics.xqy");

sem.rdfInsert(
  sem.triple(
        sem.iri("http://example.com/ns/directory#m"),
	sem.iri("http://example.com/ns/person#firstName"), "Michael"));
 
 =&gt;
   /triplestore/74521a908ece2074.xml
 
</pre></api:example></api:function></api:function-page>