<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.rdfBuilder.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.rdfBuilder</api:function-name><api:suggest>sem.rdfbuilder</api:suggest><api:suggest>sem</api:suggest><api:suggest>rdfbuilder</api:suggest><api:function-link mode="xquery" fullname="sem:rdf-builder">/apidoc/8.0/sem:rdf-builder.xml</api:function-link><api:function mode="javascript" name="rdfBuilder" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.rdfBuilder"><api:summary>This function returns a function that builds triples 
		from CURIE and blank node syntax. The resulting function takes 
		three string arguments, representing subject, predicate, 
		and object respectively, which returns a sem:triple object 
		using the graph and prefix mappings passed in to the call to 
		<code xmlns="http://www.w3.org/1999/xhtml">sem:rdf-builder</code>. 
		Blank nodes specified with a leading underscore (_) will 
		be assigned blank node identifiers, and will maintain that 
		identity across multiple invocations; for example, 
		"_:person1" will refer to the same node as a later 
		invocation that also mentions "_:person1". In the 
		predicate position, the special value of "a" will be 
		interpreted as the same as "rdf:type".</api:summary><api:params><api:param name="prefixes" type="map:map?" optional="true"><api:param-description>An 
		  optional set of prefix mappings.</api:param-description><api:param-name>prefixes</api:param-name><api:param-type>Object?</api:param-type></api:param><api:param name="graph" type="sem:iri?" optional="true"><api:param-description>The graph 
		  value in which to place triples. Defaults to 
		  "http://marklogic.com/semantics#default-graph".</api:param-description><api:param-name>graph</api:param-name><api:param-type>sem.iri?</api:param-type></api:param></api:params><api:return>function(item(),item(),item()) as sem.triple</api:return><api:usage>
	  If you pass in a string to <code xmlns="http://www.w3.org/1999/xhtml">sem:rdf-builder</code>, it will be 
	  interpreted as a CURIE. If you want it to be interpreted as an IRI, 
	  then cast the string to an IRI using <code xmlns="http://www.w3.org/1999/xhtml">sem:iri</code>.
  </api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require("/MarkLogic/semantics.xqy");
var prefixes = {"a": "http://marklogic.com/a"};
var fac = sem.rdfBuilder();
xdmp.apply(fac, "_:person1", "a", "foaf:Person");
	
=&gt;
sem.triple(
  sem.blank("http://marklogic.com/semantics/blank/6198496751368939587"), 
  sem.iri("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), 
  sem.iri("http://xmlns.com/foaf/0.1/Person"))
    </pre>
  </api:example></api:function></api:function-page>