<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.bnode.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.bnode</api:function-name><api:suggest>sem.bnode</api:suggest><api:suggest>sem</api:suggest><api:suggest>bnode</api:suggest><api:function-link mode="xquery" fullname="sem:bnode">/apidoc/8.0/sem:bnode.xml</api:function-link><api:function mode="javascript" name="bnode" type="builtin" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.bnode"><api:summary>
  This function returns an identifier for a blank node, allowing the construction of a triple that refers to a blank node.
  This XQuery function backs up the SPARQL BNODE() function.
  <p xmlns="http://www.w3.org/1999/xhtml">This function is a built-in.</p>
</api:summary><api:params><api:param name="value" type="xs:anyAtomicType" optional="true"><api:param-description>
    If provided, the same blank node identifier is returned for the same argument
    value passed to the function.
  </api:param-description><api:param-name>value</api:param-name><api:param-type>xs.anyAtomicType</api:param-type></api:param></api:params><api:return>sem.blank</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require("/MarkLogic/semantics.xqy");

var person1 = sem.bnode();
var person2 = sem.bnode();
var t1 = sem.triple(person1,
         sem.iri("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
	       sem.iri("http://xmlns.com/foaf/0.1/Person"));
var t2 = sem.triple(person2,
	       sem.iri("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
	       sem.iri("http://xmlns.com/foaf/0.1/Person"));
var t3 = sem.triple(person1,
	       sem.iri("http://xmlns.com/foaf/0.1/knows"), person2)
var results = new Array();
results.push(t1, t2, t3);
results;

 =&gt; // returns identifiers for blank nodes 
[{"triple":
  {"subject":
    {"value":"http://marklogic.com/semantics/blank/2404403597012311801"}, 
   "predicate":
    {"value":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}, 
   "object":
    {"value":"http://xmlns.com/foaf/0.1/Person"}
   }
  }, 
 {"triple":
  {"subject":
    {"value":"http://marklogic.com/semantics/blank/499971585800807003"}, 
   "predicate":
    {"value":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}, 
   "object":
    {"value":"http://xmlns.com/foaf/0.1/Person"}}}, 
 {"triple":{
   "subject":
    {"value":"http://marklogic.com/semantics/blank/2404403597012311801"}, 
   "predicate":
    {"value":"http://xmlns.com/foaf/0.1/knows"}, 
   "object":
    {"value":"http://marklogic.com/semantics/blank/499971585800807003"}
	  }
 }]

</pre></api:example></api:function></api:function-page>