<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.rdfLoad.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.rdfLoad</api:function-name><api:suggest>sem.rdfload</api:suggest><api:suggest>sem</api:suggest><api:suggest>rdfload</api:suggest><api:function-link mode="xquery" fullname="sem:rdf-load">/apidoc/8.0/sem:rdf-load.xml</api:function-link><api:function mode="javascript" name="rdfLoad" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.rdfLoad"><api:summary>
		This function inserts an RDF document from a specified location
		into the designated database. It also creates the graph 
		metadata for the graph specified by the "graph=URI" 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="location" type="xs:string"><api:param-description>
		  The location of the input file. If the file is not a 
		  recognized format, an exception is thrown.
	  </api:param-description><api:param-name>location</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
	    Parsing options: Only one base, or graph, or override-graph 
	    option along with one format option (ntriple, nquad, turtle, 
	    trig, n3, rdfxml, or rdfjson) is allowed. The graph and 
	    override-graph options cannot be used together. Valid options 
	    include:
	<blockquote xmlns="http://www.w3.org/1999/xhtml">
        <dl>
          <dt>
             <pre>base=URI</pre>
          </dt>
        <dd>
        A base URI to use during parsing.
		</dd>
          <dt>
             <pre>graph=URI</pre>
          </dt>
        <dd>
		The graph/context value to give to quads with no 
		explicit graph specified in the data. Cannot be used with
		override-graph=URI (or an exception is thrown).
		</dd>
          <dt>
             <pre>override-graph=URI</pre>
          </dt>
        <dd>
		The graph/context value to give to every quad, 
		whether specified in the data or not. Cannot be used with
		graph=URI (or an exception is thrown).
        </dd>
		  <dt>
             <pre>directory=URI</pre>
          </dt>
        <dd>
        The database directory path.
		</dd>
          <dt>
             <pre>ntriple</pre>
          </dt>
        <dd>		
        Specify N-Triples format for input.
        </dd>
          <dt>
             <pre>nquad</pre>
          </dt>
        <dd>		
        Specify N-Quads format for input (default). 
		</dd>
          <dt>
             <pre>turtle</pre>
          </dt>
        <dd>	
        Specify Turtle format for input. 
		</dd>
          <dt>
             <pre>rdfxml</pre>
          </dt>
        <dd>	
        Specify RDF/XML format for input.
	    </dd>
          <dt>
             <pre>rdfjson</pre>
          </dt>
        <dd>	
        Specify RDF/JSON format for input. 
        </dd>
		 <dt>
             <pre>triplexml</pre>
         </dt>
        <dd>	
		Specify <code>sem:triple</code> XML format for input, either a 
		single <code>sem:triple</code> element or multiple elements 
		under a root element.  If you use the <code>triplexml</code>
		option, you cannot specify a graph.
        </dd>
          <dt>
             <pre>n3</pre>
          </dt>
        <dd>		
        Specify N3 format for input.
        </dd>
		<dt>
             <pre>trig</pre>
          </dt>
        <dd>		
        Specify TriG format for input.
        </dd>
          <dt>
             <pre>repair</pre>
          </dt>
        <dd>			
		Specify to repair if possible, or discard individual triples 
		that do not parse correctly. Otherwise any malformed input 
		results in an exception.
        </dd>
      </dl>	
    </blockquote>  
	</api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="http-opts" type="element()?" optional="true"><api:param-description>
		An options node as described for the function 
		<a href="./xdmp:http-get" xmlns="http://www.w3.org/1999/xhtml"><code>xdmp:http-get</code></a>.
	</api:param-description><api:param-name>http-opts</api:param-name><api:param-type>Node?</api:param-type></api:param><api:param name="permissions" type="item()*" optional="true"><api:param-description>
		Permissions to apply to the inserted documents.
                When run in an XQuery context, the permissions are a sequence of
	        XML elements (sec:permission). When importing this module into 
	        a Server-Side JavaScript context, the permissions are an array
	        of Objects.
	</api:param-description><api:param-name>permissions</api:param-name><api:param-type>ValueIterator</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-load</code> 
    in the context of SPARQL Update can result in undefined behavior.
  </api:usage><api:privilege>
    <p xmlns="http://www.w3.org/1999/xhtml"><code>http://marklogic.com/xdmp/privileges/xdmp-document-get</code></p> 
  </api:privilege><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
var sem = require("/MarkLogic/semantics.xqy");
 
sem.rdfLoad('C:/data/example.rdf', "rdfxml")
 
 =&gt; 
    /triplestore/fbd28af1471b39e9.xml
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
var sem = require("/MarkLogic/semantics.xqy");
	  
sem.rdfLoad(
    'C:/data/books.ttl',
    ["turtle", "graph=http://marklogic.com/semantics/sb/books1/"],
    null,
    xdmp.permission("demo-reader", "read")
    );
    
=&gt;
    /triplestore/fbd28af1471b39e9.xml
// permissions on graph for demo-reader now set to "read" 
</pre></api:example></api:function></api:function-page>